bubbliiiing / mobilenet-yolov4-pytorch

这是一个mobilenet-yolov4的库,把yolov4主干网络修改成了mobilenet,修改了Panet的卷积组成,使参数量大幅度缩小。
MIT License
369 stars 104 forks source link

mobilenet_v3中的InvertedResidual #16

Open wangerxiao719 opened 3 years ago

wangerxiao719 commented 3 years ago
            # pw
            nn.Conv2d(inp, hidden_dim, 1, 1, 0, bias=False),
            nn.BatchNorm2d(hidden_dim),
            h_swish() if use_hs else nn.ReLU(inplace=True),

            # dw
            nn.Conv2d(hidden_dim, hidden_dim, kernel_size, stride, (kernel_size - 1) // 2, groups=hidden_dim, bias=False),
            nn.BatchNorm2d(hidden_dim),

            # Squeeze-and-Excite
            SELayer(hidden_dim) if use_se else nn.Identity(),

            h_swish() if use_hs else nn.ReLU(inplace=True),

            # pw-linear
            nn.Conv2d(hidden_dim, oup, 1, 1, 0, bias=False),
            nn.BatchNorm2d(oup),

Squeeze-and-Excite之后的激活函数是不是应该放在SElayer之前

bubbliiiing commented 2 years ago

啊哼?什么意思

wangerxiao719 commented 2 years ago

激活函数的位置不影响吗

bubbliiiing commented 2 years ago

激活函数前传的时候位置对就行了。