Skip to content

Instantly share code, notes, and snippets.

@jkotra
Created May 16, 2019 10:25
Show Gist options
  • Select an option

  • Save jkotra/87c6477f59b48c8adab962e445f7c4fd to your computer and use it in GitHub Desktop.

Select an option

Save jkotra/87c6477f59b48c8adab962e445f7c4fd to your computer and use it in GitHub Desktop.
# calculate size during Conv opr.
F = 5 # kernel
P = 0 # padding
S = 1 # Strides
shape = [38, 18]
new_shape = []
for i in range(2):
X = shape[i]
new_shape.append(((X - F + 2*P)/S) + 1)
print(new_shape)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment