class_docstr: Basic implementation of a general Knowledge Distillation framework
  
  :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/testing
  :param optimizer_teacher (torch.optim.*): Optimizer used for training teacher
  :param optimizer_student (torch.optim.*): Optimizer used for training student
  :param loss_fn (torch.nn.Module): Loss Function used for distillation
  :param temp (float): Temperature parameter for distillation
  :param distil_weight (float): Weight paramter for distillation loss
  :param device (str): Device used 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.KLDivLoss(),
      temp=20.0,
      distil_weight=0.5,
      device="cpu",
      log=False,
      logdir="./Experiments",
  ):
      self.train_loader = train_loader
      self.val_loader = val_loader
      self.optimizer_teacher = optimizer_teacher
      self.optimizer_student = optimizer_student
      self.temp = temp
      self.distil_weight = distil_weight
      self.log = log
      self.logdir = logdir
  
      if self.log:
          self.writer = SummaryWriter(logdir)
  
      if device == "cpu":
          self.device = torch.device("cpu")
      elif device == "cuda":
          if torch.cuda.is_available():
              self.device = torch.device("cuda")
          else:
              print(
                  "Either an invalid device or CUDA is not available. Defaulting to CPU."
              )
              self.device = torch.device("cpu")
  
      if teacher_model:
          self.teacher_model = teacher_model.to(self.device)
      else:
          print("Warning!!! Teacher is NONE.")
  
      self.student_model = student_model.to(self.device)
      self.loss_fn = loss_fn.to(self.device)
      self.ce_fn = nn.CrossEntropyLoss().to(self.device)
  
file_path: KD_Lib/KD_Lib/KD/common/base_class.py
imports: import os
  from copy import deepcopy
  import matplotlib.pyplot
  import torch
  import torch.nn
  from torch.utils.tensorboard import SummaryWriter
label_desc: Use image node_id 1 to create a new BaseClass object  with example: obj = BaseClass(teacher_model, student_model, train_loader, val_loader, optimizer_teacher, optimizer_student, loss_fn, temp, distil_weight, device, log, logdir)