MoCoV3Head¶
- class mmpretrain.models.heads.MoCoV3Head(predictor, loss, temperature=1.0)[源代码]¶
Head for MoCo v3 Pre-training.
This head builds a predictor, which can be any registered neck component. It also implements latent contrastive loss between two forward features. Part of the code is modified from: https://github.com/facebookresearch/moco-v3/blob/main/moco/builder.py.
- 参数:
- loss(base_out, momentum_out)[源代码]¶
Generate loss.
- 参数:
base_out (torch.Tensor) – NxC features from base_encoder.
momentum_out (torch.Tensor) – NxC features from momentum_encoder.
- 返回:
The loss tensor.
- 返回类型: