Shortcuts

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 (dict) – Config dict for the loss.

  • predictor (dict) – Config dict for the predictor.

  • init_cfg (dict or List[dict], optional) – Initialization config dict. Defaults to None.

loss(input, target)[source]

Forward head.

Parameters:
Returns:

The latent predict loss.

Return type:

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.