zoukankan      html  css  js  c++  java
  • PyTorch——池化(一)

    torch.nn.MaxPool2d(kernel_size, stride=None, padding=0, dilation=1, return_indices=False, ceil_mode=False)

    Parameters

    1 kernel_size – the size of the window to take a max over
    2 stride – the stride of the window. Default value is kernel_size
    3 padding – implicit zero padding to be added on both sides
    4 dilation – a parameter that controls the stride of elements in the window
    5 return_indices – if True, will return the max indices along with the outputs. Useful for torch.nn.MaxUnpool2d later
    6 ceil_mode – when True, will use ceil instead of floor to compute the output shape

    Shape

    Examples

    [32, 64, 112, 112] ——> [32, 64, 56, 56] 

    1 import torch
    2 import torch.nn as nn
    3 
    4 pool1 = nn.MaxPool2d(2, stride=2)
    5 print(pool1(input1).size())

    [32, 64, 112, 112] ——> [32, 64, 111, 111]

    1 import torch
    2 import torch.nn as nn
    3 
    4 pool1 = nn.MaxPool2d(2, stride=1)
    5 print(pool1(input1).size())
  • 相关阅读:
    WinForm常用代码
    XML编程与应用-读取XML
    基础SQL语句
    WPF基础——继承
    wpf控件
    手机网页支付
    Application_Start 多次启动问题
    更改Outlook 2013中Exchange数据文件存放路径
    MySql双机热备份
    图片轮播(Jquery)
  • 原文地址:https://www.cnblogs.com/timelesszxl/p/14549183.html
Copyright © 2011-2022 走看看