class mmpretrain.models.backbones.PoolFormer(arch='s12', pool_size=3, norm_cfg={'num_groups': 1, 'type': 'GN'}, act_cfg={'type': 'GELU'}, in_patch_size=7, in_stride=4, in_pad=2, down_patch_size=3, down_stride=2, down_pad=1, drop_rate=0.0, drop_path_rate=0.0, out_indices=-1, frozen_stages=0, init_cfg=None)[源代码]


A PyTorch implementation of PoolFormer introduced by: MetaFormer is Actually What You Need for Vision

Modified from the official repo <>.

  • arch (str | dict) –

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

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

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

    • mlp_ratios (list[int]): Expansion ratio of MLPs.

    • layer_scale_init_value (float): Init value for Layer Scale.

    Defaults to ‘S12’.

  • 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').

  • in_patch_size (int) – The patch size of input image patch embedding. Defaults to 7.

  • in_stride (int) – The stride of input image patch embedding. Defaults to 4.

  • in_pad (int) – The padding of input image patch embedding. Defaults to 2.

  • down_patch_size (int) – The patch size of downsampling patch embedding. Defaults to 3.

  • down_stride (int) – The stride of downsampling patch embedding. Defaults to 2.

  • down_pad (int) – The padding of downsampling patch embedding. Defaults to 1.

  • drop_rate (float) – Dropout rate. Defaults to 0.

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

  • out_indices (Sequence | int) – Output from which network position. Index 0-6 respectively corresponds to [stage1, downsampling, stage2, downsampling, stage3, downsampling, stage4] 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.

  • init_cfg (dict, optional) – Initialization config dict

Read the Docs v: dev
On Read the Docs
Project Home

Free document hosting provided by Read the Docs.