class_docstr: Module for calculating RKD Angle Loss
class_docstr_tok: ["Module","for","calculating","RKD","Angle","Loss"]
docstr: Forward function
  
  :param teacher (torch.FloatTensor): Prediction made by the teacher model
  :param student (torch.FloatTensor): Prediction made by the student model
  :param normalize (bool): True if inputs need to be normalized
docstr_tok: ["Forward","function",":","param","teacher","(","torch.FloatTensor",")",":","Prediction","made","by","the","teacher","model",":","param","student","(","torch.FloatTensor",")",":","Prediction","made","by","the","student","model",":","param","normalize","(","bool",")",":","True","if","inputs","need","to","be","normalized"]
code: def forward(self, teacher, student, normalize=True):
      """
      Forward function
  
      :param teacher (torch.FloatTensor): Prediction made by the teacher model
      :param student (torch.FloatTensor): Prediction made by the student model
      :param normalize (bool): True if inputs need to be normalized
      """
  
      with torch.no_grad():
          t = teacher.unsqueeze(0) - teacher.unsqueeze(1)
          if normalize:
              t = F.normalize(t, p=2, dim=2)
          t = torch.bmm(t, t.transpose(1, 2)).view(-1)
  
      s = student.unsqueeze(0) - student.unsqueeze(1)
      if normalize:
          s = F.normalize(s, p=2, dim=2)
      s = torch.bmm(s, s.transpose(1, 2)).view(-1)
      return F.smooth_l1_loss(s, t)
  
file_path: KD_Lib/KD_Lib/KD/vision/RKD/loss_metric.py
imports: import torch
  import torch.nn.functional
  from torch import nn
label_desc: Use image node_id 1 for calling the RKDAngleLoss obj's underlying member method code with example usage: obj.forward(teacher, student, normalize) and returns: F