Shortcuts

iTPNClipHead

class mmpretrain.models.heads.iTPNClipHead(embed_dims, num_embed, loss, init_cfg={'bias': 0, 'layer': 'Linear', 'std': 0.02, 'type': 'TruncNormal'})[source]

Head for iTPN Pre-training using Clip.

Compute the logits and the cross entropy loss.

Parameters:
  • embed_dims (int) – The dimension of embedding.

  • num_embed (int) – The number of classification types.

  • loss (dict) – The config of loss.

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

loss(feats, target, mask)[source]

Generate loss.

Parameters: