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:
- loss(feats, target, mask)[source]¶
Generate loss.
- Parameters:
feats (torch.Tensor) – Features from backbone.
target (torch.Tensor) – Target generated by target_generator.
mask (torch.Tensor) – Generated mask for pretraing.