torch.nn.AvgPool1d(kernel_size, stride=None, padding=0, ceil_mode=False, count_include_pad=True)

对信号的输入通道,提供1维平均池化(average pooling)

参数:

  • kernel_size(int or tuple) – 池化窗口大小
  • stride(int or tuple, optional) – max pooling的窗口移动的步长。默认值是 kernel_size
  • padding(int or tuple, optional) – 输入的每一条边补充0的层数
  • dilation(int or tuple, optional) – 一个控制窗口中元素步幅的参数
  • return_indices – 如果等于 True,会返回输出最大值的序号,对于上采样操作会有帮助
  • ceil_mode – 如果等于 True,计算输出信号大小的时候,会使用向上取整,代替默认的向下取整的操作

大小:
input:(N,C,L_in)
output:(N,C,L_out)

Lout=floor((Lin+2∗padding−kernelsize)/stride+1)

Example:

>>> # pool with window of size=3, stride=2
>>> m = nn.AvgPool1d(3, stride=2)
>>> m(Variable(torch.Tensor([[[1,2,3,4,5,6,7]]])))
Variable containing:
    (0 ,.,.) =
    2  4  6
    [torch.FloatTensor of size 1x1x3]

Original: https://blog.csdn.net/weixin_67609590/article/details/125257145
Author: 假面308
Title: torch.nn.AvgPool1d(kernel_size, stride=None, padding=0, ceil_mode=False, count_include_pad=True)

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/720630/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球