zoukankan      html  css  js  c++  java
  • pytorch卷积的输入输出以及计算公式

    1、nn.Conv2d
    class torch.nn.Conv2d(in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1, bias=True)
    二维卷积层, 输入的尺度是(N, C_in, H, W),输出尺度(N, C_out, H_out, W_out)。

    [out = (input + 2 * padding - kernel\_size) / stride + 1 ]

    2、nn.ConvTranspose2d
    class torch.nn.ConvTranspose2d(in_channels, out_channels, kernel_size, stride=1, padding=0, output_padding=0, groups=1, bias=True, dilation=1)

    [out = (input - 1) * stride - 2 * padding + kernel\_size ]

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

    [out = (input + 2 * padding - kernel\_size) / stride + 1 ]

    4、nn.Conv3d
    class torch.nn.Conv3d(in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1, bias=True)

    [out = (imput + 2 * padding - kernel\_size) / stride + 1 ]

    5、nn.ConvTranspose3d
    class torch.nn.ConvTranspose3d(in_channels, out_channels, kernel_size, stride=1, padding=0, output_padding=0, groups=1, bias=True)

    [out = (input - 1) * stride - 2 * padding + kernel\_size ]

  • 相关阅读:
    P3703 [SDOI2017]树点涂色
    CF1446D2 Frequency Problem (Hard Version)
    P3703 [SDOI2017]树点涂色
    ESP8266 Ticker库
    CSS 动画
    Sublime 安装
    XMLHttpRequest.responseText
    数据结构
    Linux 无需公网IP,远程SSH访问Linux服务器!
    Linux 安装
  • 原文地址:https://www.cnblogs.com/zyr001/p/14539849.html
Copyright © 2011-2022 走看看