备注
您正在阅读 MMClassification 0.x 版本的文档。MMClassification 0.x 会在 2022 年末被切换为次要分支。建议您升级到 MMClassification 1.0 版本,体验更多新特性和新功能。请查阅 MMClassification 1.0 的安装教程、迁移教程以及更新日志。
mmcls.models.utils.SELayer¶
- class mmcls.models.utils.SELayer(channels, squeeze_channels=None, ratio=16, divisor=8, bias='auto', conv_cfg=None, act_cfg=({'type': 'ReLU'}, {'type': 'Sigmoid'}), return_weight=False, init_cfg=None)[源代码]¶
Squeeze-and-Excitation Module.
- 参数
channels (int) – The input (and output) channels of the SE layer.
squeeze_channels (None or int) – The intermediate channel number of SElayer. Default: None, means the value of
squeeze_channels
ismake_divisible(channels // ratio, divisor)
.ratio (int) – Squeeze ratio in SELayer, the intermediate channel will be
make_divisible(channels // ratio, divisor)
. Only used whensqueeze_channels
is None. Default: 16.divisor (int) – The divisor to true divide the channel number. Only used when
squeeze_channels
is None. Default: 8.conv_cfg (None or dict) – Config dict for convolution layer. Default: None, which means using conv2d.
return_weight (bool) – Whether to return the weight. Default: False.
act_cfg (dict or Sequence[dict]) – Config dict for activation layer. If act_cfg is a dict, two activation layers will be configurated by this dict. If act_cfg is a sequence of dicts, the first activation layer will be configurated by the first dict and the second activation layer will be configurated by the second dict. Default: (dict(type=’ReLU’), dict(type=’Sigmoid’))