code: def training_step(self, batch, batch_idx):
      views = batch[0]
      images = views[0]  # views contains only a single view
      batch_size = images.shape[0]
      idx_keep, idx_mask = utils.random_token_mask(
          size=(batch_size, self.sequence_length),
          mask_ratio=self.mask_ratio,
          device=images.device,
      )
  
      # Encoding...
      x_encoded = self.forward_encoder(images, batch_size, idx_mask)
      x_encoded_masked = utils.get_at_index(x_encoded, idx_mask)
  
      # Decoding...
      x_out = self.forward_decoder(x_encoded_masked)
  
      # get image patches for masked tokens
      patches = utils.patchify(images, self.patch_size)
  
      # must adjust idx_mask for missing class token
      target = utils.get_at_index(patches, idx_mask - 1)
  
      loss = self.criterion(x_out, target)
      return loss
  
file_path: lightly/examples/pytorch_lightning/simmim.py
imports: import pytorch_lightning
  import torch
  import torchvision
  from torch import nn
  from lightly.models import utils
  from lightly.models.modules import masked_autoencoder
  from lightly.transforms.mae_transform import MAETransform
label_desc: Use image node_id 4 for calling the SimMIM obj's underlying member method code with example usage: obj.training_step(batch, batch_idx) and returns: loss