卷积块CBM(conv+batchnorm+mish)
发布日期:2021-05-14 15:18:15 浏览次数:13 分类:精选文章

本文共 3005 字,大约阅读时间需要 10 分钟。

���������������CBM������������������

���������������CBMconv+batchnorm+mish���������������������������������������������������������������������������������������������������������������������������������������������������������������������Batch Normalization���BN���������Mish���������������

������������Conv���

������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

Batch Normalization���BN���

Batch Normalization���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������BN���������������������������������������������������������������������������������������������BN������������������������������������������������������������������������������������

Mish������������

Mish���������������������������������������������������������ReLU���Sigmoid���������������������������������������������������������Mish��������������������������� [ \text{Mish}(x) = x \cdot \tanh(\text{softplus}(x)) ] ���������softplus���������������������_cosh������������������x���������������������������1������������������������������������������������������������������Mish������������������������������������������������

CBM������������

CBM������������������������������������������Mish������������������������������������������������������������������ [ CBM(x) = \text{Conv}(x) \rightarrow \text{BN}(x) \rightarrow \text{Mish}(x) ] ���������������������CBM������������������������������������������������������������������������������������

������������

������������CBM���������������������������������Python���PyTorch���������������������������������������������������������

  • ������������������������������������RGB���������������������������������32x32���������������3���

    import torch
    rgb = torch.randn(1, 3, 32, 32)
    print(rgb)
    print(rgb.shape) # (1, 3, 32, 32)
  • ���������������������������������������������������������������������������������3x3������������2���

    class BasicConv(nn.Module):
    def __init__(self, in_channels, out_channels, kernel_size=3, stride=1):
    super(BasicConv, self).__init__()
    self.conv = nn.Conv2d(in_channels, out_channels, kernel_size, stride, kernel_size//2, bias=False)
    test_downsample_conv = BasicConv(3, 1, 3, stride=2)
    x = test_downsample_conv(rgb)
    print(x)
    print(x.shape) # (1, 1, 16, 16)
  • ���������������������������������������������������������������������������������������������CBM���������������������������

    ������

    ���������������CBM������������������������������������������Mish���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

    上一篇:BackBone
    下一篇:Yolo-V4-Model(pytorch版本)

    发表评论

    最新留言

    很好
    [***.229.124.182]2025年04月28日 05时58分28秒

    关于作者

        喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
    -- 愿君每日到此一游!

    推荐文章