projects
/
pytorch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2d95f23
)
Update.
author
Francois Fleuret
<francois@fleuret.org>
Sun, 6 Jun 2021 14:08:03 +0000
(16:08 +0200)
committer
Francois Fleuret
<francois@fleuret.org>
Sun, 6 Jun 2021 14:08:03 +0000
(16:08 +0200)
conv_chain.py
patch
|
blob
|
history
diff --git
a/conv_chain.py
b/conv_chain.py
index
2d5af8e
..
d10798f
100755
(executable)
--- a/
conv_chain.py
+++ b/
conv_chain.py
@@
-1,7
+1,9
@@
#!/usr/bin/env python
#!/usr/bin/env python
-import torch
-from torch import nn
+# Any copyright is dedicated to the Public Domain.
+# https://creativecommons.org/publicdomain/zero/1.0/
+
+# Written by Francois Fleuret <francois@fleuret.org>
######################################################################
######################################################################
@@
-26,13
+28,16
@@
def conv_chain(input_size, output_size, depth, cond):
if __name__ == "__main__":
if __name__ == "__main__":
+ import torch
+ from torch import nn
+
# Example
c = conv_chain(
input_size = 64, output_size = 8,
depth = 5,
# We want kernels smaller than 4, strides smaller than the
# Example
c = conv_chain(
input_size = 64, output_size = 8,
depth = 5,
# We want kernels smaller than 4, strides smaller than the
- # kernels, and stride of 1 except in the two last layers
+ # kernels, and stride
s
of 1 except in the two last layers
cond = lambda d, k, s: k <= 4 and s <= k and (s == 1 or d <= 2)
)
cond = lambda d, k, s: k <= 4 and s <= k and (s == 1 or d <= 2)
)