class_docstr: 2D Cross Entropy Loss with Auxilary Loss
class_docstr_tok: ["2D","Cross","Entropy","Loss","with","Auxilary","Loss"]
code: def forward(self, pred, lbl):
      gt_bones = (lbl - lbl[:, self.parent])[:, self.bone_idx]
      pred_bones = (pred - pred[:, self.parent])[:, self.bone_idx]
      self.loss_3d = torch.sqrt(torch.sum((lbl - pred) ** 2, -1)).mean()
      self.loss_bone = torch.sqrt(
          torch.sum((gt_bones - pred_bones) ** 2, -1)
      ).mean()
      self.train_cnt += 1
  
      self.summary_writer.add_scalar(
          "h36m_train3d_loss", self.loss_3d.item(), self.train_cnt
      )
      self.summary_writer.add_scalar(
          "h36m_bone_loss", self.loss_bone.item(), self.train_cnt
      )
      return self.loss_3d + self.loss_bone
  
file_path: insightface/body/human_pose/ambiguity_aware/lib/core/loss.py
imports: import torch
  from torch.nn import functional
  import numpy
  import torch.nn
  import math
label_desc: Use image node_id 2 for calling the Losses obj's underlying member method code with example usage: obj.forward(pred, lbl) and returns: unknown