class_docstr: Implementation of BarlowTwins[0] network.
  
  Recommended loss: :py:class:`lightly.loss.barlow_twins_loss.BarlowTwinsLoss`
  
  Default params are the ones explained in the original paper [0].
  [0] Zbontar,J. et.al. 2021. Barlow Twins... https://arxiv.org/abs/2103.03230
  
  Attributes:
      backbone:
          Backbone model to extract features from images.
          ResNet-50 in original paper [0].
      num_ftrs:
          Dimension of the embedding (before the projection head).
      proj_hidden_dim:
          Dimension of the hidden layer of the projection head. This should
          be the same size as `num_ftrs`.
      out_dim:
          Dimension of the output (after the projection head).
code: def __init__(
      self,
      backbone: nn.Module,
      num_ftrs: int = 2048,
      proj_hidden_dim: int = 8192,
      out_dim: int = 8192,
  ):
      super(BarlowTwins, self).__init__()
  
      self.backbone = backbone
      self.num_ftrs = num_ftrs
      self.proj_hidden_dim = proj_hidden_dim
      self.out_dim = out_dim
  
      self.projection_mlp = BarlowTwinsProjectionHead(
          num_ftrs, proj_hidden_dim, out_dim
      )
  
      warnings.warn(
          Warning(
              "The high-level building block BarlowTwins 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/barlowtwins.py
imports: import warnings
  import torch
  import torch.nn
  from lightly.models.modules import BarlowTwinsProjectionHead
label_desc: Use image node_id 1 to create a new BarlowTwins object from inherited base classes: nn with example: obj = BarlowTwins(backbone, num_ftrs, proj_hidden_dim, out_dim)