class_docstr: Loss used in MSN (https://arxiv.org/pdf/2204.07141.pdf)
  
  Args:
      temperature (float): temperature
      teacher_momentum (float): controls EMA of teacher
class_docstr_tok: ["Loss","used","in","MSN","(","https",":","\/\/arxiv.org\/pdf\/2204.07141.pdf",")","Args",":","temperature","(","float",")",":","temperature","teacher_momentum","(","float",")",":","controls","EMA","of","teacher"]
code: def __init__(self, temperature: float, teacher_momentum: float):
      super().__init__()
  
      # Store loss configuration for DINOHook to access
      self.temperature = temperature
      self.teacher_momentum = teacher_momentum
      self.teacher_temp_min = temperature
      self.teacher_temp_max = temperature
      self.teacher_temp_warmup_iters = 0
      self.crops_for_teacher = [0]
  
      # Momentum teacher related attributes
      self.momentum_teacher = None
      self.checkpoint = None
      self.teacher_output = None
      self.teacher_temp = None
      self.is_distributed = is_distributed_training_run()
      self.use_gpu = get_cuda_device_index() > -1
  
file_path: vissl/vissl/losses/msn_loss.py
imports: import logging
  import pprint
  from typing import List
  import torch
  from classy_vision.generic.distributed_util import get_cuda_device_index, is_distributed_training_run
  from classy_vision.losses import ClassyLoss, register_loss
  from fairscale.nn import FullyShardedDataParallel
  from vissl.config import AttrDict
  from vissl.models.model_helpers import get_no_ddp_model
label_desc: Use image node_id 1 to create a new MSNLoss object from inherited base classes: ClassyLoss with example: obj = MSNLoss(temperature, teacher_momentum)