数字理解
输出结果的shape计算:
‘SAME’ 类型的padding,其输出的height和width计算如下:
out_height = ceil(float(in_height) / float(strides[1])) ceil:向上取整
out_width = ceil(float(in_width) / float(strides[2]))
‘VALID’类型的padding, 其输出的height和width计算如下:
out_height = ceil(float(in_height – filter_height + 1) / float(strides[1]))
out_width = ceil(float(in_width – filter_width + 1) / float(strides[2]))
图片理解
具体计算理解
1 | x = |
1 | def testConv2DSameEven(self): |
总结
1 | 1. net = conv2d_same(inputs, num_outputs, 3, stride=stride) |