LatentPredictHead¶
- class mmpretrain.models.heads.LatentPredictHead(loss, predictor, init_cfg=None)[source]¶
Head for latent feature prediction.
This head builds a predictor, which can be any registered neck component. For example, BYOL and SimSiam call this head and build NonLinearNeck. It also implements similarity loss between two forward features.
- Parameters:
- loss(input, target)[source]¶
Forward head.
- Parameters:
input (torch.Tensor) – NxC input features.
target (torch.Tensor) – NxC target features.
- Returns:
The latent predict loss.
- Return type: