tf.nn.conv2d(input, filter, strides, padding, use_cudnn_on_gpu=None, data_format=None, name=None)
根据4维的input和filter张量计算2维卷积
input张量[batch, in_height, in_width, in_channels]
filter/kernel 张量[filter_height, filter_width, in_channels, out_channels]
操作按照下面执行:
1. 将4维的filter变成2维 [filter_height * filter_width * in_channels, output_channels]
2. 从图像receptive field中抽取形成一个虚拟tensor [batch, out_heigt, out_width, filter_height*filter_width*in_channels]
3.
strides[0]=strides[3]=1. 对于大多数实例水平和垂直stride相同的情况, strides=[1, stride, stride, 1]
tf.nn.max_pool(value, ksize, strides, padding, data_format='NHWC', name=None)
在input上执行max pooling
- value: 4维张量 [batch, height, width, channels] type tf.float32
- ksize: 窗口大小。
- strides: 滑动窗口大小