假设图片大小 HXW
卷积核大小 H_f X W_f
Padding P
Stride S1 XS2
1.卷积后尺寸计算
out_height=(H - H_f + 2P) / S1 +1out_width= (W - W_f + 2P) / S2 +1
2.tensorflow中卷积参数same和valid运算之后的维度计算
(1)sameout_height=ceil (float( H ))/float( S1 )
out_width= ceil (float( W))/float(S2)
(2)valid
out_height= ceil(float(H - H_f +1))/float( S1)out_width= ceil(float(W -W_f+1)) /float ( S2 )
3. Pooling 中padding的含义
Valid : 直接丢弃
Same : 两边补0
Example :
图片: 500 X 500
pooling: 3X3
输出:
500 / 3 = 166.67
Same: 167
Valid: 166