class_docstr: Implementation of Knowledge distillation using a mean teacher from the
  paper "Mean teachers are better role models:Weight-averaged consistency
  targets improvesemi-supervised deep learning results"
  https://arxiv.org/abs/1703.01780
  
  :param teacher_model (torch.nn.Module): Teacher model
  :param student_model (torch.nn.Module): Student model
  :param train_loader (torch.utils.data.DataLoader): Dataloader for training
  :param val_loader (torch.utils.data.DataLoader): Dataloader for validation
  :param optimizer_teacher (torch.optim.*): Optimizer for training teacher
  :param optimizer_student (torch.optim.*): Optimizer for training student
  
  :param loss (str): Consistency criterion for loss
  :param class_loss (torch.nn.Module): Class Criterion for loss
  :param res_loss (torch.nn.Module): Residual Logit Criterion for loss
  
  :param temp (float): Temperature parameter for distillation
  :param distil_weight (float): Weight paramter for distillation loss
  :param device (str): Device for training; 'cpu' for cpu and 'cuda' for gpu
  :param log (bool): True if logging required
  :param logdir (str): Directory for storing logs
docstr: Function used for calculating the KD loss during distillation
  
  :param y_pred_student (torch.FloatTensor): Prediction made by the student model
  :param y_pred_teacher (torch.FloatTensor): Prediction made by the teacher model
  :param y_true (torch.FloatTensor): Original label
docstr_tok: ["Function","used","for","calculating","the","KD","loss","during","distillation",":","param","y_pred_student","(","torch.FloatTensor",")",":","Prediction","made","by","the","student","model",":","param","y_pred_teacher","(","torch.FloatTensor",")",":","Prediction","made","by","the","teacher","model",":","param","y_true","(","torch.FloatTensor",")",":","Original","label"]
code: def calculate_kd_loss(self, y_pred_student, y_pred_teacher, y_true):
      """
      Function used for calculating the KD loss during distillation
  
      :param y_pred_student (torch.FloatTensor): Prediction made by the student model
      :param y_pred_teacher (torch.FloatTensor): Prediction made by the teacher model
      :param y_true (torch.FloatTensor): Original label
      """
      class_logit, consis_logit = y_pred_student
      class_loss = self.class_loss(class_logit, y_true)
  
      num_classes = consis_logit.size()[1]
      res_loss = self.res_loss(class_logit, consis_logit) / num_classes
  
      student_softmax = self.log_softmax(consis_logit, dim=1)
      teacher_softmax = self.log_softmax(y_pred_teacher[0], dim=1)
      consis_loss = (
          self.loss_fn(student_softmax, teacher_softmax) / num_classes
      )
  
      return class_loss + res_loss + consis_loss
  
file_path: KD_Lib/KD_Lib/KD/vision/mean_teacher/mean_teacher.py
imports: import torch
  import torch.nn.functional
  from torch import nn
  from KD_Lib.KD.common import BaseClass
label_desc: Use image node_id 2 for calling the MeanTeacher obj's underlying member method code with example usage: obj.calculate_kd_loss(y_pred_student, y_pred_teacher, y_true) and returns: unknown