tf.nn.max_pool

本文详细介绍了max_pool函数的使用方法及参数设置,包括输入张量的格式、窗口大小、滑动步长等,并解释了填充算法及其选项。适用于深度学习模型中进行池化操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

max_pool函数经常用到,所以做个记录

参考官方文档

format:max_pool(value, ksize, strides, padding, data_format='NHWC', name=None)

    Args:
      value: A 4-D `Tensor` with shape `[batch, height, width, channels]` and type `tf.float32`.(注意这里数据类型必须是tf.float32,不然会出错)


      ksize: A list of ints that has length >= 4.  The size of the window for each dimension of the input tensor.(一般都是4个元素的list)
      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, either `'VALID'` or `'SAME'`. The padding algorithm.
        See the @{tf.nn.convolution$comment here}
      data_format: A string. 'NHWC' and 'NCHW' are supported.
      name: Optional name for the operation.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值