code: def __init__(self):
      super().__init__()
      # create a ResNet backbone and remove the classification head
      resnet = models.ResNetGenerator("resnet-18")
      self.backbone = nn.Sequential(
          *list(resnet.children())[:-1], nn.AdaptiveAvgPool2d(1)
      )
  
      # create a model based on ResNet
      self.projection_head = heads.SMoGProjectionHead(512, 2048, 128)
      self.prediction_head = heads.SMoGPredictionHead(128, 2048, 128)
      self.backbone_momentum = copy.deepcopy(self.backbone)
      self.projection_head_momentum = copy.deepcopy(
          self.projection_head
      )
      utils.deactivate_requires_grad(self.backbone_momentum)
      utils.deactivate_requires_grad(self.projection_head_momentum)
  
      # smog
      self.n_groups = 300
      memory_bank_size = 10000
      self.memory_bank = loss.memory_bank.MemoryBankModule(
          size=memory_bank_size
      )
      # create our loss
      group_features = torch.nn.functional.normalize(
          torch.rand(self.n_groups, 128), dim=1
      ).to(self.device)
      self.smog = heads.SMoGPrototypes(
          group_features=group_features, beta=0.99
      )
      self.criterion = nn.CrossEntropyLoss()
  
file_path: lightly/examples/pytorch_lightning/smog.py
imports: import copy
  import pytorch_lightning
  import torch
  import torchvision
  from sklearn.cluster import KMeans
  from torch import nn
  from lightly import loss, models
  from lightly.models import utils
  from lightly.models.modules import heads
  from lightly.transforms.smog_transform import SMoGTransform
label_desc: Use image node_id 1 to create a new SMoGModel object from inherited base classes: pl with example: obj = SMoGModel()