class_docstr: Momentum Contrast for unsupervised Visual Representation Learning
  Details can be found in:
  https://arxiv.org/abs/1911.05722
class_docstr_tok: ["Momentum","Contrast","for","unsupervised","Visual","Representation","Learning","Details","can","be","found","in",":","https",":","\/\/arxiv.org\/abs\/1911.05722"]
docstr: Args:
      backbone (nn.Module): backbone for byol, input shape depends on the forward
          input size. Standard inputs include `B x C`, `B x C x H x W`, and
          `B x C x T x H x W`.
      projector (nn.Module): An mlp with 2 to 3 hidden layers,
          with (synchronized) BatchNorm and ReLU activation.
      backbone_mmt (nn.Module): backbone for byol, input shape depends on the forward
          input size. Standard inputs include `B x C`, `B x C x H x W`, and
          `B x C x T x H x W`.
      projector_mmt (nn.Module): Am mlp with 2 to 3 hidden layers,
          with (synchronized) BatchNorm and ReLU activation.
      mmt (float): momentum update ratio for the momentum backbone.
docstr_tok: ["Args",":","backbone","(","nn.Module",")",":","backbone","for","byol",",","input","shape","depends","on","the","forward","input","size",".","Standard","inputs","include","`","B","x","C","`",",","`","B","x","C","x","H","x","W","`",",","and","`","B","x","C","x","T","x","H","x","W","`",".","projector","(","nn.Module",")",":","An","mlp","with","2","to","3","hidden","layers",",","with","(","synchronized",")","BatchNorm","and","ReLU","activation",".","backbone_mmt","(","nn.Module",")",":","backbone","for","byol",",","input","shape","depends","on","the","forward","input","size",".","Standard","inputs","include","`","B","x","C","`",",","`","B","x","C","x","H","x","W","`",",","and","`","B","x","C","x","T","x","H","x","W","`",".","projector_mmt","(","nn.Module",")",":","Am","mlp","with","2","to","3","hidden","layers",",","with","(","synchronized",")","BatchNorm","and","ReLU","activation",".","mmt","(","float",")",":","momentum","update","ratio","for","the","momentum","backbone","."]
code: def __init__(
      self,
      mmt: float,
      backbone: nn.Module,
      backbone_mmt: nn.Module,
      projector: Optional[nn.Module] = None,
      projector_mmt: Optional[nn.Module] = None,
  ) -> None:
      """
      Args:
          backbone (nn.Module): backbone for byol, input shape depends on the forward
              input size. Standard inputs include `B x C`, `B x C x H x W`, and
              `B x C x T x H x W`.
          projector (nn.Module): An mlp with 2 to 3 hidden layers,
              with (synchronized) BatchNorm and ReLU activation.
          backbone_mmt (nn.Module): backbone for byol, input shape depends on the forward
              input size. Standard inputs include `B x C`, `B x C x H x W`, and
              `B x C x T x H x W`.
          projector_mmt (nn.Module): Am mlp with 2 to 3 hidden layers,
              with (synchronized) BatchNorm and ReLU activation.
          mmt (float): momentum update ratio for the momentum backbone.
      """
      super().__init__()
  
      self.mmt: float = mmt
  
      if projector is not None:
          backbone = nn.Sequential(
              backbone,
              projector,
          )
      init_net_weights(backbone)
      self.backbone = backbone
  
      if projector_mmt is not None:
          backbone_mmt = nn.Sequential(
              backbone_mmt,
              projector_mmt,
          )
      init_net_weights(backbone_mmt)
      self.backbone_mmt = backbone_mmt
  
      for p in self.backbone_mmt.parameters():
          p.requires_grad = False
  
      self._copy_weights_to_backbone_mmt()
  
imports: import math
  from dataclasses import dataclass
  from typing import Any, Callable, List, Optional, Tuple, Union
  import pytorchvideo_trainer.module.distributed_utils
  import torch
  import torch.nn
  import torch.nn.functional
  from hydra.core.config_store import ConfigStore
  from omegaconf import MISSING
  from pytorchvideo.models.resnet import create_resnet
  from pytorchvideo.models.weight_init import init_net_weights
  from pytorchvideo_trainer.module.ssl_helper import create_mlp_util, SSLBaseModule
  from pytorchvideo_trainer.module.video_classification import Batch, BatchKey, EnsembleMethod
  from torchrecipes.core.conf import ModuleConf
  from torchrecipes.utils.config_utils import get_class_name_str
label_desc: Use image node_id 1 to create a new MOCO object from inherited base classes: nn with example: obj = MOCO(mmt, backbone, backbone_mmt, projector, projector_mmt)