每次学习新知识总是走马观花,理解不深刻,从现在开始坚持将学习到的东西记录下来,一来方便以后回顾,二来加深理解
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
tensorflow ——conv2d
tf.nn.conv2d(input, w, strides, padding)
其中 input 为输入,格式为[batch, height, width, channels], 分别为【输入的批次数量、图像的高(行数)、宽(列数)、通道(彩色为3,灰色为1)】
w 为卷积矩阵,二维、分别为[高,宽】
strides 为滑动窗口尺寸,分别为[1, height, width, 1], 通常 strides[0]=strdes[3]=1,因为一般不会在一个个图像,一个个通道之间滑动
padding 为扩展方式,有两种 vaild 和 same
1)不同的padding方式,VALID是采用丢弃的方式,比如上述的input_width=13,只允许滑动2次,多余的元素全部丢掉
2)SAME的方式,采用的是补全的方式,对于上述的情况,允许滑动3次,但是需要补3个元素,左奇右偶,在左边补一个0,右边补2个0
3) For the SAME
padding, the output height and width are computed as: