Update.
authorFrancois Fleuret <francois@fleuret.org>
Sat, 9 Jun 2018 18:19:03 +0000 (20:19 +0200)
committerFrancois Fleuret <francois@fleuret.org>
Sat, 9 Jun 2018 18:19:03 +0000 (20:19 +0200)
ae_size.py

index 48dc2af..25ecc4a 100755 (executable)
@@ -11,10 +11,10 @@ def minimal_input_size(w, layer_specs):
     if layer_specs == []:
         return w
     else:
-        k, s = layer_specs[0]
-        w = math.ceil((w - k) / s) + 1
+        kernel_size, stride = layer_specs[0]
+        w = math.ceil((w - kernel_size) / stride) + 1
         w = minimal_input_size(w, layer_specs[1:])
-        return int((w - 1) * s + k)
+        return int((w - 1) * stride + kernel_size)
 
 ######################################################################
 
@@ -22,7 +22,7 @@ def minimal_input_size(w, layer_specs):
 
 if __name__ == "__main__":
 
-    layer_specs = [ (11, 5), (5, 2), (3, 2), (3, 2) ]
+    layer_specs = [ (11, 5), (5, 4), (3, 2), (3, 2) ]
 
     layers = []
     for kernel_size, stride in layer_specs: