class_docstr: Implementation of the MoCo (Momentum Contrast)[0] architecture.
  
  Recommended loss: :py:class:`lightly.loss.ntx_ent_loss.NTXentLoss` with
  a memory bank.
  
  [0] MoCo, 2020, https://arxiv.org/abs/1911.05722
  
  Attributes:
      backbone:
          Backbone model to extract features from images.
      num_ftrs:
          Dimension of the embedding (before the projection head).
      out_dim:
          Dimension of the output (after the projection head).
      m:
          Momentum for momentum update of the key-encoder.
code: def __init__(
      self,
      backbone: nn.Module,
      num_ftrs: int = 32,
      out_dim: int = 128,
      m: float = 0.999,
      batch_shuffle: bool = False,
  ):
      super(MoCo, self).__init__()
  
      self.backbone = backbone
      self.projection_head = MoCoProjectionHead(
          num_ftrs, num_ftrs, out_dim
      )
      self.momentum_features = None
      self.momentum_projection_head = None
  
      self.m = m
      self.batch_shuffle = batch_shuffle
  
      # initialize momentum features and momentum projection head
      self._init_momentum_encoder()
  
      warnings.warn(
          Warning(
              "The high-level building block MoCo will be deprecated in version 1.3.0. "
              + "Use low-level building blocks instead. "
              + "See https://docs.lightly.ai/self-supervised-learning/lightly.models.html for more information"
          ),
          DeprecationWarning,
      )
  
file_path: lightly/lightly/models/moco.py
imports: import warnings
  import torch
  import torch.nn
  from lightly.models._momentum import _MomentumEncoderMixin
  from lightly.models.modules import MoCoProjectionHead
label_desc: Use image node_id 1 to create a new MoCo object from inherited base classes: nn, _MomentumEncoderMixin with example: obj = MoCo(backbone, num_ftrs, out_dim, m, batch_shuffle)