class_docstr: Implementation of the BYOL architecture.
  
  Attributes:
      backbone:
          Backbone model to extract features from images.
      num_ftrs:
          Dimension of the embedding (before the projection mlp).
      hidden_dim:
          Dimension of the hidden layer in the projection and prediction mlp.
      out_dim:
          Dimension of the output (after the projection/prediction mlp).
      m:
          Momentum for the momentum update of encoder.
class_docstr_tok: ["Implementation","of","the","BYOL","architecture",".","Attributes",":","backbone",":","Backbone","model","to","extract","features","from","images",".","num_ftrs",":","Dimension","of","the","embedding","(","before","the","projection","mlp",")",".","hidden_dim",":","Dimension","of","the","hidden","layer","in","the","projection","and","prediction","mlp",".","out_dim",":","Dimension","of","the","output","(","after","the","projection\/prediction","mlp",")",".","m",":","Momentum","for","the","momentum","update","of","encoder","."]
code: def __init__(
      self,
      backbone: nn.Module,
      num_ftrs: int = 2048,
      hidden_dim: int = 4096,
      out_dim: int = 256,
      m: float = 0.9,
  ):
      super(BYOL, self).__init__()
  
      self.backbone = backbone
      # the architecture of the projection and prediction head is the same
      self.projection_head = BYOLProjectionHead(
          num_ftrs, hidden_dim, out_dim
      )
      self.prediction_head = BYOLProjectionHead(
          out_dim, hidden_dim, out_dim
      )
      self.momentum_backbone = None
      self.momentum_projection_head = None
  
      self._init_momentum_encoder()
      self.m = m
  
      warnings.warn(
          Warning(
              "The high-level building block BYOL 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/byol.py
imports: import warnings
  import torch
  import torch.nn
  from lightly.models._momentum import _MomentumEncoderMixin
  from lightly.models.modules import BYOLProjectionHead
label_desc: Use image node_id 1 to create a new BYOL object from inherited base classes: nn, _MomentumEncoderMixin with example: obj = BYOL(backbone, num_ftrs, hidden_dim, out_dim, m)