MoCoV2Neck¶
- class mmpretrain.models.necks.MoCoV2Neck(in_channels, hid_channels, out_channels, with_avg_pool=True, init_cfg=None)[source]¶
The non-linear neck of MoCo v2: fc-relu-fc.
- Parameters:
in_channels (int) – Number of input channels.
hid_channels (int) – Number of hidden channels.
out_channels (int) – Number of output channels.
with_avg_pool (bool) – Whether to apply the global average pooling after backbone. Defaults to True.
init_cfg (dict or list[dict], optional) – Initialization config dict. Defaults to None.
- forward(x)[source]¶
Forward function.
- Parameters:
x (Tuple[torch.Tensor]) – The feature map of backbone.
- Returns:
The output features.
- Return type:
Tuple[torch.Tensor]