class_docstr: This is the loss which was proposed in the Barlow Twins https://arxiv.org/abs/2103.03230v1
  paper.
  See the paper for the details on the loss.
  
  Config params:
      lambda_ (float):        weight on the off-diagonal terms. It controls the trade-off
                              between the importance given to the invariance term versus the
                              redundancy reduction term.
      scale_loss (float):     In order to match the code that was used to develop Barlow
                              Twins, we include an additional parameter, scale-loss, that
                              multiplies the loss by a constant factor. We are working on a
                              version that will not require this parameter.
      embedding_dim (int):    dimensionality of the representation
class_docstr_tok: ["This","is","the","loss","which","was","proposed","in","the","Barlow","Twins","https",":","\/\/arxiv.org\/abs\/2103.03230v1","paper",".","See","the","paper","for","the","details","on","the","loss",".","Config","params",":","lambda_","(","float",")",":","weight","on","the","off-diagonal","terms",".","It","controls","the","trade-off","between","the","importance","given","to","the","invariance","term","versus","the","redundancy","reduction","term",".","scale_loss","(","float",")",":","In","order","to","match","the","code","that","was","used","to","develop","Barlow","Twins",",","we","include","an","additional","parameter",",","scale-loss",",","that","multiplies","the","loss","by","a","constant","factor",".","We","are","working","on","a","version","that","will","not","require","this","parameter",".","embedding_dim","(","int",")",":","dimensionality","of","the","representation"]
docstr: Instantiates BarlowTwinsLoss from configuration.
  
  Args:
      loss_config:    configuration for the loss
  
  Returns:
      BarlowTwinsLoss instance.
docstr_tok: ["Instantiates","BarlowTwinsLoss","from","configuration",".","Args",":","loss_config",":","configuration","for","the","loss","Returns",":","BarlowTwinsLoss","instance","."]
code: def from_config(cls, loss_config: AttrDict) -> "BarlowTwinsLoss":
      """
      Instantiates BarlowTwinsLoss from configuration.
  
      Args:
          loss_config:    configuration for the loss
  
      Returns:
          BarlowTwinsLoss instance.
      """
      return cls(loss_config)
  
file_path: vissl/vissl/losses/barlow_twins_loss.py
imports: import pprint
  import torch
  from classy_vision.generic.distributed_util import all_reduce_mean
  from classy_vision.losses import ClassyLoss, register_loss
  from torch import nn
  from vissl.utils.apex_helpers import SyncNormalizeFunction
  from vissl.utils.hydra_config import AttrDict
label_desc: Use image node_id 2 for calling the BarlowTwinsLoss obj's underlying member method code with example usage: obj.from_config(cls, loss_config) and returns: cls