轻量级网络总结

1. SqueezeNet

SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and< 0.5 MB model size

考虑到卷积层的参数量为 C i n ∗ C o u t ∗ K ∗ K C_{in}*C_{out}*K*K CinCoutKK,显然,为了减少参数量,可以从输入输出通道数和卷积核尺寸两个角度出发:

  • 使用更多的1×1卷积
  • 减小3×3卷积的输入核输出通道数

根据以上两个基本原则,SqueezeNet中设计了一个Fire module,squeeze中只使用了1×1卷积,以较少的参数量为代价降低通道数,然后在expand中使用1×1和3×3扩展通道数。

在这里插入图片描述

class Fire(nn.Module):

    def __init__(self, inplanes, squeeze_planes,
                 expand1x1_planes, expand3x3_planes):
        super(Fire, self).__init__()
        self.inplanes = inplanes
        self.squeeze = nn.Conv2d(inplanes, squeeze_planes, kernel_size=1)
        self.squeeze_activation = nn.ReLU(inplace=True)
        self.expand1x1 = nn.Conv2d(squeeze_planes, expand1x1_planes,
                                   kernel_size=1)
        self.expand1x1_activation = nn.ReLU(inplace=True)
        self.expand3x3 = nn.Conv2d(squeeze_planes, expand3x3_planes,
                                   kernel_size=3, padding=1)
        self.expand3x3_activation = nn.ReLU(inplace=True)

    def forward(self, x):
        x = self.squeeze_activation(self.squeeze(x))
        return torch.cat(
评论 10
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值