• pyotrch--nn.Conv2d中groups参数的理解


    调用形式:    
    self.conv2 = nn.Conv2d(expand_size, expand_size, kernel_size=kernel_size, stride=stride,
                                   padding=kernel_size / 2, groups=expand_size, bias=False)

    官方参数说明:

    Args:
            in_channels (int): Number of channels in the input image
            out_channels (int): Number of channels produced by the convolution
            kernel_size (int or tuple): Size of the convolving kernel
            stride (int or tuple, optional): Stride of the convolution. Default: 1
            padding (int or tuple, optional): Zero-padding added to both sides of the input. Default: 0
            padding_mode (string, optional). Accepted values `zeros` and `circular` Default: `zeros`
            dilation (int or tuple, optional): Spacing between kernel elements. Default: 1
          groups (int, optional): Number of blocked connections from input channels to output channels. Default: 1
            bias (bool, optional): If ``True``, adds a learnable bias to the output. Default: ``True``

    group这个参数是用做分组卷积的,但是现在用的比较多的是groups = in_channel,可以参考上面英文文档的最后一句。当groups = in_channel时,是在做的depth-wise conv的,具体思想可以参考MobileNet论文

    缺点:参考shufflenet v2

  • 相关阅读:
    Linux上ssh免秘钥互登
    Linux版本显示和区别32位还是64位系统
    shell运行下的写日志
    oracle 分析函数
    oracle解锁
    Linux下的打包操作
    python 小记
    Python 之 random模块
    JS模块化工具requirejs教程02
    JS模块化工具requirejs教程01
  • 原文地址:https://www.cnblogs.com/ywheunji/p/12532417.html
Copyright © 2020-2023  润新知