tensorflow——tf.nn.conv2d()

tf.nn.conv2d(input, filter, strides, padding, use_cudnn_on_gpu=None, name=None)

input:指需要做卷积的输入图像,它要求是一个Tensor,shape为[batch, in_height, in_width, in_channels]
filter:相当于CNN中的卷积核,它要求是一个Tensor,shape为[filter_height, filter_width, in_channels, out_channels],第三维in_channels,就是参数input的第四维
strides:卷积时在图像每一维的步长,这是一个一维的向量,长度为4
padding:string类型的量,只能是"SAME","VALID"其中之一,这个值决定了不同的卷积方式
use_cudnn_on_gpu:bool类型,是否使用cudnn加速,默认为true
结果返回一个Tensor,这个输出,就是我们常说的feature map
name:用以指定该操作的name

猜你喜欢

转载自blog.csdn.net/cherry1307/article/details/88227134