code: def get_loss(
      inputs, outputs: VoteNetResults, loss_params, weight_classes=None
  ):
      losses = {}
  
      inputs = to_dense_labels(inputs)
  
      # Vote loss
      vote_loss = compute_vote_loss(inputs, outputs)
      losses["vote_loss"] = vote_loss
  
      # Obj loss
      objectness_loss = compute_objectness_loss(
          inputs, outputs, loss_params
      )
      losses["objectness_loss"] = objectness_loss
  
      # Box loss and sem cls loss
      (
          center_loss,
          heading_cls_loss,
          heading_reg_loss,
          size_cls_loss,
          size_reg_loss,
          sem_cls_loss,
      ) = compute_box_and_sem_cls_loss(
          inputs, outputs, loss_params, weight_classes=weight_classes
      )
      losses["center_loss"] = center_loss
      losses["heading_cls_loss"] = heading_cls_loss
      losses["heading_reg_loss"] = heading_reg_loss
      losses["size_cls_loss"] = size_cls_loss
      losses["size_reg_loss"] = size_reg_loss
      losses["sem_cls_loss"] = sem_cls_loss
      box_loss = (
          center_loss
          + 0.1 * heading_cls_loss
          + heading_reg_loss
          + 0.1 * size_cls_loss
          + size_reg_loss
      )
      losses["box_loss"] = box_loss
  
      # Final loss function
      loss = (
          vote_loss
          + 0.5 * objectness_loss
          + box_loss
          + 0.1 * sem_cls_loss
      )
      loss *= 10  # TODO WHY???
      losses["loss"] = loss
  
      return losses
  
file_path: torch-points3d/torch_points3d/modules/VoteNet/loss_helper.py
imports: import torch
  import torch.nn
  import numpy
  from torch_points3d.core.losses import huber_loss, nn_distance
  from .votenet_results import VoteNetResults
label_desc: Use image node_id 5 for calling a global function with example usage: get_loss(inputs, outputs, loss_params, weight_classes) and returns: losses