zoukankan      html  css  js  c++  java
  • Rethinking Bottleneck Structure for Efficient Mobile Network Design

    Rethinking Bottleneck Structure for Efficient Mobile Network Design

    一. 论文简介

    减少模块提取特征时的丢失,增强模块提取特征的能力

    采用类似hourglass的结构,先降采样后升采样(相对于通道

    二. 模块详解

    2.1 整体结构介绍

    depth-wise(w/ Relu) + points-wise(W/O Relu) + point-wise(W/ Relu) + depth-wise(W/O Relu)

    class SandGlassModule(nn.Module):
        def __init__(self, inp, oup, stride, reduction_ratio):
            super(SandGlass, self).__init__()
            assert stride in [1, 2]
    
            hidden_dim = round(inp // reduction_ratio)
            self.identity = stride == 1 and inp == oup
    
            self.conv = nn.Sequential(
                # dw + relu
                nn.Conv2d(inp, inp, 3, 1, 1, groups=inp, bias=False),
                nn.BatchNorm2d(inp),
                nn.ReLU6(inplace=True),
                # pw + linear(non-relu)
                nn.Conv2d(inp, hidden_dim, 1, 1, 0, bias=False),
                nn.BatchNorm2d(hidden_dim),
                # pw + relu
                nn.Conv2d(hidden_dim, oup, 1, 1, 0, bias=False),
                nn.BatchNorm2d(oup),
                nn.ReLU6(inplace=True),
                # dw + linear(non-relu)
                nn.Conv2d(oup, oup, 3, stride, 1, groups=oup, bias=False),
                nn.BatchNorm2d(oup),
            )
    
        def forward(self, x):
            if self.identity:
                return x + self.conv(x)
            else:
                return self.conv(x)
    
    
  • 相关阅读:
    软件工程系统开发课堂测试01
    java--printf
    java--局部类只能访问外包方法的final局部成员
    java--内部类实现“类的多重继承”
    java--内部类
    【转】java--final
    java--实例成员 & 静态成员
    java--方法和成员的继承,访问
    Java--格式化输出
    HDOJ 1005
  • 原文地址:https://www.cnblogs.com/wjy-lulu/p/13615118.html
Copyright © 2011-2022 走看看