备注
您正在阅读 MMClassification 0.x 版本的文档。MMClassification 0.x 会在 2022 年末被切换为次要分支。建议您升级到 MMClassification 1.0 版本,体验更多新特性和新功能。请查阅 MMClassification 1.0 的安装教程、迁移教程以及更新日志。
mmcls.models.utils.InvertedResidual¶
- class mmcls.models.utils.InvertedResidual(in_channels, out_channels, mid_channels, kernel_size=3, stride=1, se_cfg=None, conv_cfg=None, norm_cfg={'type': 'BN'}, act_cfg={'type': 'ReLU'}, drop_path_rate=0.0, with_cp=False, init_cfg=None)[源代码]¶
Inverted Residual Block.
- 参数
in_channels (int) – The input channels of this module.
out_channels (int) – The output channels of this module.
mid_channels (int) – The input channels of the depthwise convolution.
kernel_size (int) – The kernel size of the depthwise convolution. Defaults to 3.
stride (int) – The stride of the depthwise convolution. Defaults to 1.
se_cfg (dict, optional) – Config dict for se layer. Defaults to None, which means no se layer.
conv_cfg (dict) – Config dict for convolution layer. Defaults to None, which means using conv2d.
norm_cfg (dict) – Config dict for normalization layer. Defaults to
dict(type='BN')
.act_cfg (dict) – Config dict for activation layer. Defaults to
dict(type='ReLU')
.drop_path_rate (float) – stochastic depth rate. Defaults to 0.
with_cp (bool) – Use checkpoint or not. Using checkpoint will save some memory while slowing down the training speed. Defaults to False.
init_cfg (dict | list[dict], optional) – Initialization config dict.