code:

 vgg_16 = [
#
[3, 1], [3, 1], [2, 2],
#
[3, 1], [3, 1], [2, 2],
#
[3, 1], [3, 1], [3, 1], [2, 2],
#
[3, 1], [3, 1], [3, 1], [2, 2],
#
[3, 1], [3, 1], [3, 1], [2, 2],
# fc6, fake convolutional layer
[7, 1]
]
vgg16_layers = [
"3x3 conv 64", "3x3 conv 64", "pool1",
"3x3 conv 128", "3x3 conv 128", "pool2",
"3x3 conv 256", "3x3 conv 256", "3x3 conv 256", "pool3",
"3x3 conv 512", "3x3 conv 512", "3x3 conv 512", "pool4",
"3x3 conv 512", "3x3 conv 512", "3x3 conv 512", "pool5",
"7x7 fc"
]
def cal_receptive_field(kspairs, layers=None):
# K: composed kernel, also the receptive field,累计的感受野
# S: composed stride,累计的步长
K, S = 1, 1
# H = 224
if not layers:
layers = range(len(kspairs))
for layer, kspair in zip(layers, kspairs):
k, s = kspair
K = (k-1) * S + K
S = S * s
# H = H//s
# iamge size {0}'.format(H) print('layer {:<15}: {} [{:3},{:2}]'.format(layer, kspair, K, S)) cal_receptive_field(vgg_16, vgg16_layers)

参考:

Calculate Receptive Field for VGG16 | Zike's Blog

最新文章

  1. Bootstrap3系列:下拉菜单
  2. .net数据库操作
  3. Python开发实战教程(8)-向网页提交获取数据
  4. JS判断用户连续输入
  5. DuiVision开发教程(15)-DUI文本控制基础类
  6. IGeoFeatureLayer
  7. ue4构建光照失败问题与解决
  8. 双T型陷波滤波器
  9. HDU 1160 FatMouse&amp;#39;s Speed (最长有序的上升子序列)
  10. Achartengine.jar绘制动态图形一 --饼图
  11. JavaScript Cookie使用实例
  12. LintCode 1.A+B的问题
  13. 使用Gson解析复杂、变态的Json数据(包含中文key)
  14. Web browser发展演变
  15. exchange 2010 数据库管理
  16. 零配置使用springboot
  17. 图解MySQL 内连接、外连接
  18. jquery正则判断字符串有几个逗号
  19. .net面试题[转载]
  20. 二进制包 vs. 源代码包

热门文章

  1. JS基础 sessionStorage
  2. kernel源代码标记:mainline 、longterm、stable、linux-next、snapshot的含义
  3. 《python解释器源码剖析》第13章--python虚拟机中的类机制
  4. 服务器IP与个人IP的特点
  5. Kinect for Windows SDK开发入门(二):基础知识 上
  6. Anton and Chess(模拟+思维)
  7. java- 泛型类到底是类还是接口,&lt;T extends Comparable&gt;的写法中为什么没有用implements
  8. 揭秘PHP深受Web开发者喜爱的原因
  9. Maven 设置阿里镜像
  10. http文件服务器上传与下载功能