LinearNeck¶
- class mmpretrain.models.necks.LinearNeck(in_channels, out_channels, gap_dim=0, norm_cfg={'type': 'BN1d'}, act_cfg=None, init_cfg=None)[source]¶
Linear neck with Dimension projection.
- Parameters:
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)[source]¶
forward function.
- Parameters:
inputs (Union[Tuple, torch.Tensor]) – The features extracted from the backbone. Multiple stage inputs are acceptable but only the last stage will be used.
- Returns:
A tuple of output features.
- Return type:
Tuple[torch.Tensor]