class_docstr: This module wraps a standard criterion and adds an extra knowledge distillation loss by
  taking a teacher model prediction and using it as additional supervision.
class_docstr_tok: ["This","module","wraps","a","standard","criterion","and","adds","an","extra","knowledge","distillation","loss","by","taking","a","teacher","model","prediction","and","using","it","as","additional","supervision","."]
code: def __init__(
      self,
      base_criterion: torch.nn.Module,
      teacher_model: torch.nn.Module,
      distillation_type: str,
      alpha: float,
      tau: float,
  ):
      super().__init__()
      self.base_criterion = base_criterion
      self.teacher_model = teacher_model
      assert distillation_type in ["none", "soft", "hard"]
      self.distillation_type = distillation_type
      self.alpha = alpha
      self.tau = tau
  
imports: import torch
  from torch.nn import functional
label_desc: Use image node_id 1 to create a new DistillationLoss object from inherited base classes: torch.nn with example: obj = DistillationLoss(base_criterion, teacher_model, distillation_type, alpha, tau)