TensorFlow中max pooling层各参数的意义

  官方教程中没有解释pooling层各参数的意义,找了很久终于找到,在tensorflow/python/ops/gen_nn_ops.py中有写:

def _max_pool(input, ksize, strides, padding, name=None):
  r"""Performs max pooling on the input.

  Args:
    input: A `Tensor` of type `float32`. 4-D input to pool over.
    ksize: A list of `ints` that has length `>= 4`.
      The size of the window for each dimension of the input tensor.
    strides: A list of `ints` that has length `>= 4`.
      The stride of the sliding window for each dimension of the
      input tensor.
    padding: A `string` from: `"SAME", "VALID"`.
      The type of padding algorithm to use.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `float32`. The max pooled output tensor.
  """
  return _op_def_lib.apply_op("MaxPool", input=input, ksize=ksize,
                              strides=strides, padding=padding, name=name)

  

  padding有两个参数,分别是‘SAME’和'VALID':

  1.SAME:pool后进行填充,使输出图片的大小与输入时相同

  2.VALID:不进行填充

 

参考:

  1.http://stackoverflow.com/questions/35298823/how-to-write-a-custom-pooling-layer-module-in-tensor-flow/35303470#35303470

  2.https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/core/util/padding.h

转载于:https://www.cnblogs.com/dcsds1/p/5203684.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值