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)
######################################################################
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: