class_docstr: Bootstrap Your Own Latent A New Approach to Self-Supervised Learning
  Details can be found in:
  https://arxiv.org/pdf/2006.07733.pdf
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): stand projector is a mlp with 2 to 3 hidden layers,
          with (synchronized) BatchNorm and ReLU activation.
      predictor (nn.Module): predictor MLP of BYOL of similar structure as the
          projector MLP.
      feature_dim (int): output feature dimension.
      predictor_inner (int): inner channel size for predictor.
      mmt (float): momentum update ratio for the momentum backbone.
      norm (callable): normalization to be used in projector, default is
          synchronized batchnorm.
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",")",":","stand","projector","is","a","mlp","with","2","to","3","hidden","layers",",","with","(","synchronized",")","BatchNorm","and","ReLU","activation",".","predictor","(","nn.Module",")",":","predictor","MLP","of","BYOL","of","similar","structure","as","the","projector","MLP",".","feature_dim","(","int",")",":","output","feature","dimension",".","predictor_inner","(","int",")",":","inner","channel","size","for","predictor",".","mmt","(","float",")",":","momentum","update","ratio","for","the","momentum","backbone",".","norm","(","callable",")",":","normalization","to","be","used","in","projector",",","default","is","synchronized","batchnorm","."]
code: def __init__(
      self,
      backbone: nn.Module,
      projector: Optional[nn.Module] = None,
      predictor: Optional[nn.Module] = None,
      feature_dim: int = 2048,
      predictor_inner: int = 4096,
      mmt: float = 0.99,
      norm: Callable = nn.SyncBatchNorm,
  ) -> 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): stand projector is a mlp with 2 to 3 hidden layers,
              with (synchronized) BatchNorm and ReLU activation.
          predictor (nn.Module): predictor MLP of BYOL of similar structure as the
              projector MLP.
          feature_dim (int): output feature dimension.
          predictor_inner (int): inner channel size for predictor.
          mmt (float): momentum update ratio for the momentum backbone.
          norm (callable): normalization to be used in projector, default is
              synchronized batchnorm.
      """
      super().__init__()
  
      torch._C._log_api_usage_once("PYTORCHVIDEO.model.BYOL.__init__")
  
      self.mmt = mmt
      self.feature_dim = feature_dim
      if projector is not None:
          backbone = nn.Sequential(
              backbone,
              projector,
          )
      self.backbone = backbone
      self.backbone_mmt = copy.deepcopy(backbone)
      for p in self.backbone_mmt.parameters():
          p.requires_grad = False
      if predictor is None:
          self.predictor = nn.Sequential(
              nn.Linear(feature_dim, predictor_inner, bias=False),
              norm(predictor_inner),
              nn.ReLU(inplace=True),
              nn.Linear(predictor_inner, feature_dim, bias=True),
          )
      else:
          self.predictor = predictor
  
file_path: pytorchvideo/pytorchvideo/models/byol.py
imports: import copy
  from typing import Callable, Optional
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 1 to create a new BYOL object from inherited base classes: nn with example: obj = BYOL(backbone, projector, predictor, feature_dim, predictor_inner, mmt, norm)