[Deeplearning]dwconv

dwconv 

是由一个两部分卷积组成的一个网络

第一部分是depthwise conv 是分通道的一个卷积 就是每个卷积核对应input的每一个通道 有图好理解很多 如下

 图源https://blog.csdn.net/tintinetmilou/article/details/81607721

因为上面每个层的特征都分开 没有有效的利用相同空间位置上不同层的有效信息,所以有了第二部分

第二部分是pointwise conv

它将第一部分各自独立的featuremap进行组合生成了新的

它是一个kernelsize为1,通道数为input通道数的一个卷积,具体如图

这里写图片描述

  图源https://blog.csdn.net/tintinetmilou/article/details/81607721

这个dwconv主要是为了降低卷积运算参数量。

但具体参数量计算请看 https://yinguobing.com/separable-convolution/#fn2

yolo系列里的代码如下

class DWConv(nn.Module):
    """Depthwise Conv + Conv"""
    def __init__(self, in_channels, out_channels, ksize, stride=1, act="silu"):
        super().__init__()
        self.dconv = BaseConv(
            in_channels, in_channels, ksize=ksize,
            stride=stride, groups=in_channels, act=act
        )
        self.pconv = BaseConv(
            in_channels, out_channels, ksize=1,
            stride=1, groups=1, act=act
        )

    def forward(self, x):
        x = self.dconv(x)
        return self.pconv(x)

  • 18
    点赞
  • 83
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
The deep learning toolbox includes various software libraries, frameworks, and tools that help developers and researchers build and train deep neural networks. Some of the popular deep learning toolboxes are: 1. TensorFlow: Developed by Google, TensorFlow is an open-source deep learning library that supports building and training neural networks for various applications. 2. PyTorch: Developed by Facebook, PyTorch is an open-source deep learning framework that provides a flexible platform for building and training neural networks. 3. Keras: Keras is a high-level neural networks API that runs on top of TensorFlow, Theano, or Microsoft Cognitive Toolkit. It simplifies the process of building deep learning models and enables fast experimentation. 4. Caffe: Caffe is an open-source framework for deep learning that is widely used for image recognition and classification tasks. 5. MXNet: Apache MXNet is an open-source deep learning framework that supports multiple programming languages and provides a scalable and efficient platform for building and training neural networks. 6. Torch: Torch is an open-source scientific computing framework that provides a range of tools and modules for building and training deep neural networks. 7. Theano: Theano is a Python library that enables efficient mathematical computations and supports building and training neural networks. These toolboxes enable developers and researchers to create complex deep learning models with ease and efficiency. They provide pre-built modules, functions, and algorithms that can be customized to suit specific requirements.
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值