【问题标题】:What is tf.nn.max_pool's ksize parameter used for?tf.nn.max_pool 的 ksize 参数是干什么用的?
【发布时间】:2016-07-26 23:28:21
【问题描述】:

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 value 属于tensor : [1, 64, 64, 3]ksize=3。这意味着什么?

【问题讨论】:

  • 在大小为 ksize(内核大小)的区域上取最大值。
  • 根据描述,ksize为输入张量的每个维度捕获窗口的大小。如果批量大小 = 6,ksize=3,这是否意味着对于给定的池化内核,maxmum 将超过 3 个批次?

标签: computer-vision tensorflow


【解决方案1】:

documentation 声明:

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

一般来说,对于 64x64 像素的 RGB 图像,您的输入形状为 [batch_size, 64, 64, 3]

内核大小ksize 通常为[1, 2, 2, 1],如果您有一个 2x2 的窗口来获取最大值。在批量大小维度和通道维度上,ksize1,因为我们不想在多个示例或多个通道上取最大值。

【讨论】:

    猜你喜欢
    • 2010-11-20
    • 1970-01-01
    • 1970-01-01
    • 2019-10-22
    • 1970-01-01
    • 2011-10-03
    • 1970-01-01
    • 1970-01-01
    • 2013-03-18
    相关资源
    最近更新 更多