class_docstr: Copy paste from the original DINO paper. We use this to verify our
  implementation.
  
  The only change from the original code is that distributed training is no
  longer assumed.
  
  Source: https://github.com/facebookresearch/dino/blob/cb711401860da580817918b9167ed73e3eef3dcf/main_dino.py#L363
class_docstr_tok: ["Copy","paste","from","the","original","DINO","paper",".","We","use","this","to","verify","our","implementation",".","The","only","change","from","the","original","code","is","that","distributed","training","is","no","longer","assumed",".","Source",":","https",":","\/\/github.com\/facebookresearch\/dino\/blob\/cb711401860da580817918b9167ed73e3eef3dcf\/main_dino.py","#","L363"]
docstr: Cross-entropy between softmax outputs of the teacher and student networks.
docstr_tok: ["Cross-entropy","between","softmax","outputs","of","the","teacher","and","student","networks","."]
code: def forward(self, student_output, teacher_output, epoch):
      """
      Cross-entropy between softmax outputs of the teacher and student networks.
      """
      student_out = student_output / self.student_temp
      student_out = student_out.chunk(self.ncrops)
  
      # teacher centering and sharpening
      temp = self.teacher_temp_schedule[epoch]
      teacher_out = F.softmax(
          (teacher_output - self.center) / temp, dim=-1
      )
      teacher_out = teacher_out.detach().chunk(2)
  
      total_loss = 0
      n_loss_terms = 0
      for iq, q in enumerate(teacher_out):
          for v in range(len(student_out)):
              if v == iq:
                  # we skip cases where student and teacher operate on the same view
                  continue
              s_out = F.log_softmax(student_out[v], dim=-1)
              loss = torch.sum(-q * s_out, dim=-1)
              total_loss += loss.mean()
              n_loss_terms += 1
      total_loss /= n_loss_terms
      self.update_center(teacher_output)
      return total_loss
  
file_path: lightly/tests/loss/test_DINOLoss.py
imports: import copy
  import itertools
  import unittest
  import numpy
  import torch
  import torch.nn.functional
  from torch import nn
  from lightly.loss import DINOLoss
  from lightly.models.utils import deactivate_requires_grad
label_desc: Use image node_id 2 for calling the OriginalDINOLoss obj's underlying member method code with example usage: obj.forward(student_output, teacher_output, epoch) and returns: total_loss