Shortcuts

备注

您正在阅读 MMClassification 0.x 版本的文档。MMClassification 0.x 会在 2022 年末被切换为次要分支。建议您升级到 MMClassification 1.0 版本,体验更多新特性和新功能。请查阅 MMClassification 1.0 的安装教程迁移教程以及更新日志

mmcls.models.ConvNeXt

class mmcls.models.ConvNeXt(arch='tiny', in_channels=3, stem_patch_size=4, norm_cfg={'eps': 1e-06, 'type': 'LN2d'}, act_cfg={'type': 'GELU'}, linear_pw_conv=True, drop_path_rate=0.0, layer_scale_init_value=1e-06, out_indices=- 1, frozen_stages=0, gap_before_final_norm=True, with_cp=False, init_cfg=None)[源代码]

ConvNeXt.

A PyTorch implementation of : A ConvNet for the 2020s

Modified from the official repo and timm.

参数
  • arch (str | dict) –

    The model’s architecture. If string, it should be one of architecture in ConvNeXt.arch_settings. And if dict, it should include the following two keys:

    • depths (list[int]): Number of blocks at each stage.

    • channels (list[int]): The number of channels at each stage.

    Defaults to ‘tiny’.

  • in_channels (int) – Number of input image channels. Defaults to 3.

  • stem_patch_size (int) – The size of one patch in the stem layer. Defaults to 4.

  • norm_cfg (dict) – The config dict for norm layers. Defaults to dict(type='LN2d', eps=1e-6).

  • act_cfg (dict) – The config dict for activation between pointwise convolution. Defaults to dict(type='GELU').

  • linear_pw_conv (bool) – Whether to use linear layer to do pointwise convolution. Defaults to True.

  • drop_path_rate (float) – Stochastic depth rate. Defaults to 0.

  • layer_scale_init_value (float) – Init value for Layer Scale. Defaults to 1e-6.

  • out_indices (Sequence | int) – Output from which stages. Defaults to -1, means the last stage.

  • frozen_stages (int) – Stages to be frozen (all param fixed). Defaults to 0, which means not freezing any parameters.

  • gap_before_final_norm (bool) – Whether to globally average the feature map before the final norm layer. In the official repo, it’s only used in classification task. Defaults to True.

  • 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, optional) – Initialization config dict

Read the Docs v: latest
Versions
master
latest
1.x
dev-1.x
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.