Shortcuts

SimMIMHead

class mmpretrain.models.heads.SimMIMHead(patch_size, loss)[source]

Head for SimMIM Pre-training.

Parameters:
  • patch_size (int) – Patch size of each token.

  • loss (dict) – The config for loss.

loss(pred, target, mask)[source]

Generate loss.

This method will expand mask to the size of the original image.

Parameters:
Returns:

The reconstruction loss.

Return type:

torch.Tensor