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
code: def __init__(
      self,
      teacher_model,
      student_model,
      train_loader,
      val_loader,
      optimizer_teacher,
      optimizer_student,
      loss_fn=nn.MSELoss(),
      class_loss=nn.CrossEntropyLoss(),
      res_loss=symmetric_mse_loss,
      temp=20.0,
      distil_weight=0.5,
      device="cpu",
      log=False,
      logdir="./Experiments",
  ):
      super(MeanTeacher, self).__init__(
          teacher_model,
          student_model,
          train_loader,
          val_loader,
          optimizer_teacher,
          optimizer_student,
          loss_fn,
          temp,
          distil_weight,
          device,
          log,
          logdir,
      )
      self.class_loss = class_loss.to(self.device)
      try:
          self.res_loss = res_loss.to(self.device)
      except:
          self.res_loss = res_loss
      self.loss_fn = loss_fn.to(self.device)
      self.log_softmax = nn.LogSoftmax(dim=1).to(self.device)
  
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 1 to create a new MeanTeacher object from inherited base classes: BaseClass with example: obj = MeanTeacher(teacher_model, student_model, train_loader, val_loader, optimizer_teacher, optimizer_student, loss_fn, class_loss, res_loss, temp, distil_weight, device, log, logdir)