tf.nn.conv2d 这个函数的功能是:给定4维的input和filter,计算出一个2维的卷积结果。

这个函数的功能是:给定4维的input和filter,计算出一个2维的卷积结果。

conv2d(input, filter, strides, padding, use_cudnn_on_gpu=None, data_format=None, name=None)

前几个参数分别是input, filter, strides, padding, use_cudnn_on_gpu, …下面来一一解释
input:待卷积的数据。格式要求为一个张量,[batch, in_height, in_width, in_channels].
分别表示 批次数,图像高度,宽度,输入通道数。
filter: 卷积核。格式要求为[filter_height, filter_width, in_channels, out_channels].
分别表示 卷积核的高度,宽度,输入通道数,输出通道数。
strides :一个长为4的list. 表示每次卷积以后卷积窗口在input中滑动的距离
padding :有SAME和VALID两种选项,表示是否要保留图像边上那一圈不完全卷积的部分。如果是SAME,则保留
use_cudnn_on_gpu :是否使用cudnn加速。默认是True

转自:http://blog.csdn.net/u014595019/article/details/52728886

Related posts

Leave a Comment