Shortcuts

LinearNeck

class mmpretrain.models.necks.LinearNeck(in_channels, out_channels, gap_dim=0, norm_cfg={'type': 'BN1d'}, act_cfg=None, init_cfg=None)[源代码]

Linear neck with Dimension projection.

参数:
  • in_channels (int) – Number of channels in the input.

  • out_channels (int) – Number of channels in the output.

  • gap_dim (int) – Dimensions of each sample channel, can be one of {0, 1, 2, 3}. Defaults to 0.

  • norm_cfg (dict, optional) – dictionary to construct and config norm layer. Defaults to dict(type=’BN1d’).

  • act_cfg (dict, optional) – dictionary to construct and config activate layer. Defaults to None.

  • init_cfg (dict, optional) – dictionary to initialize weights. Defaults to None.

forward(inputs)[源代码]

forward function.

参数:

inputs (Union[Tuple, torch.Tensor]) – The features extracted from the backbone. Multiple stage inputs are acceptable but only the last stage will be used.

返回:

A tuple of output features.

返回类型:

Tuple[torch.Tensor]

Read the Docs v: latest
Versions
latest
stable
mmcls-1.x
mmcls-0.x
dev
Downloads
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.