code: def __init__(self):
      super().__init__()
  
      # create a ResNet backbone and remove the classification head
      resnet = ResNetGenerator("resnet-18", 1, num_splits=8)
      self.backbone = nn.Sequential(
          *list(resnet.children())[:-1],
          nn.AdaptiveAvgPool2d(1),
      )
  
      # create a moco model based on ResNet
      self.projection_head = MoCoProjectionHead(512, 512, 128)
      self.backbone_momentum = copy.deepcopy(self.backbone)
      self.projection_head_momentum = copy.deepcopy(
          self.projection_head
      )
      deactivate_requires_grad(self.backbone_momentum)
      deactivate_requires_grad(self.projection_head_momentum)
  
      # create our loss with the optional memory bank
      self.criterion = NTXentLoss(
          temperature=0.1, memory_bank_size=(memory_bank_size, 128)
      )
  
imports: import copy
  import pytorch_lightning
  import torch
  import torch.nn
  import torchvision
  from lightly.data import LightlyDataset
  from lightly.loss import NTXentLoss
  from lightly.models import ResNetGenerator
  from lightly.models.modules.heads import MoCoProjectionHead
  from lightly.models.utils import batch_shuffle, batch_unshuffle, deactivate_requires_grad, update_momentum
  from lightly.transforms import MoCoV2Transform, utils
label_desc: Use image node_id 1 to create a new MocoModel object from inherited base classes: pl with example: obj = MocoModel()