Skip to content

Instantly share code, notes, and snippets.

@mohcinemadkour
Created July 25, 2020 05:43
Show Gist options
  • Save mohcinemadkour/ea440f48970e17edc0456208d9697179 to your computer and use it in GitHub Desktop.
Save mohcinemadkour/ea440f48970e17edc0456208d9697179 to your computer and use it in GitHub Desktop.
def caloutdim(hin, kernel_size, stride=1, padding=0, dilation=1):
return int(np.floor((hin+2*padding-dilation*(kernel_size-1)-1)/stride+1))
d = [28]
d.append(caloutdim(d[-1], 5, padding=2))
d.append(caloutdim(d[-1], 2, 2))
d.append(caloutdim(d[-1], 5, padding=2))
d.append(caloutdim(d[-1], 2, 2))
print(d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment