class_docstr: Knowledge distillation loops for training and evaluation. This module is independent of
  the model definition. This class inherits from the Pytorch Lightning's LightningModule:
  https://lightning.ai/docs/pytorch/stable/common/lightning_module.html
code: def _compute_loss(
      self,
      student_output: dict,
      teacher_output: dict,
      label: torch.Tensor,
  ):
      loss = 0
      hard_label_loss = self._compute_hard_label_loss(
          output=student_output,
          label=label,
      )
      loss += hard_label_loss * self.hard_label_weight
  
      if self.soft_label_weight > 0:
          soft_label_loss = self._compute_soft_label_loss(
              student_output=student_output,
              teacher_output=teacher_output,
          )
          loss += soft_label_loss * self.soft_label_weight
  
      if self.softmax_regression_weight > 0:
          softmax_regression_loss = (
              self._compute_softmax_regression_loss(
                  student_output=student_output,
                  teacher_output=teacher_output,
              )
          )
          loss += (
              softmax_regression_loss * self.softmax_regression_weight
          )
  
      if self.output_feature_loss_weight > 0:
          output_feature_loss = self._compute_output_feature_loss(
              student_output=student_output,
              teacher_output=teacher_output,
          )
          loss += output_feature_loss * self.output_feature_loss_weight
  
      if (
          self.rkd_loss_func.distance_loss_weight > 0
          or self.rkd_loss_func.angle_loss_weight > 0
      ):
          rkd_loss = self._compute_rkd_loss(
              student_output=student_output,
              teacher_output=teacher_output,
          )
          loss += rkd_loss
  
      return loss
  
imports: import logging
  from typing import Callable, List, Optional, Union
  import lightning.pytorch
  import torch
  import torch.nn.functional
  import torchmetrics
  from lightning.pytorch.utilities import grad_norm
  from omegaconf import DictConfig
  from torch import nn
  from torch.nn.modules.loss import _Loss
  from torchmetrics.aggregation import BaseAggregator
  from ..constants import FEATURES, LOGITS, WEIGHT
  from ..models.utils import run_model
  from .utils import apply_layerwise_lr_decay, apply_single_lr, apply_two_stages_lr, get_lr_scheduler, get_optimizer
label_desc: Use image node_id 7 for calling the DistillerLitModule obj's underlying member method code with example usage: obj._compute_loss(student_output, teacher_output, label) and returns: loss