Last active
June 4, 2018 14:38
-
-
Save ih4cku/d53f691cc79b9b433e3703740195b9f7 to your computer and use it in GitHub Desktop.
calc DeepLab receptive field
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# net architecture of http://ccvl.stat.ucla.edu/ccvl/DeepLab/train.prototxt | |
# format: [kernel, stride] | |
deep_lab_vgg = [ | |
# 1 | |
[3, 1], | |
[3, 1], | |
[2, 2], | |
# 2 | |
[3, 1], | |
[3, 1], | |
[2, 2], | |
# 3 | |
[3, 1], | |
[3, 1], | |
[3, 1], | |
[2, 2], | |
# 4 | |
[3, 1], | |
[3, 1], | |
[3, 1], | |
[2, 1], | |
# 5 | |
[5, 1], | |
[5, 1], | |
[5, 1], | |
[3, 1], | |
# fc6, kernel=4, hole=4 | |
[13, 1] | |
] | |
# K: composed kernel, also the receptive field | |
# S: composed stride | |
K, S = 1, 1 | |
for i in range(len(deep_lab_vgg)): | |
k, s = deep_lab_vgg[i] | |
K = (k-1) * S + K | |
S = S * s | |
print 'layer:', i, deep_lab_vgg[i], '[', K, S, ']' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i have the same questions!