什么是tf.nn.max_pool的ksize参数用于?

问题描述 投票:16回答:1

tf.nn.max_pool的定义中,ksize用于什么?

tf.nn.max_pool(value, ksize, strides, padding, data_format='NHWC', name=None)

Performs the max pooling on the input.

Args:

value: A 4-D Tensor with shape [batch, height, width, channels] and type    tf.float32.
ksize: A list of ints that has length >= 4. The size of the window for each dimension of the input tensor.

例如,如果input valuetensor : [1, 64, 64, 3]ksize=3。那是什么意思?

computer-vision tensorflow
1个回答
40
投票

documentation说:

ksize:长度> = 4的整数列表。输入张量的每个维度的窗口大小。

通常对于图像,输入的形状为[batch_size, 64, 64, 3],用于64x64像素的RGB图像。

内核大小ksize通常是[1, 2, 2, 1],如果你有一个2x2窗口,你取得最大值。在批量大小维度和渠道维度上,ksize1,因为我们不希望在多个示例或多个通道上取最大值。

© www.soinside.com 2019 - 2024. All rights reserved.