code: def __init__(self, loss, dbinfo):
      super(LossFactory, self).__init__()
  
      self._loss = loss
      self.special_args = {}
      self.search_for_args = []
      if self._loss == "cross_entropy":
          self._loss_func = nn.functional.cross_entropy
          self.special_args = {"weight": dbinfo["class_weights"]}
          # self.search_for_args = ['cloug_flag']
  
      elif self._loss == "focal_loss":
          self._loss_func = FocalLoss(alphas=dbinfo["class_weights"])
  
      elif self._loss == "KLDivLoss":
          self._loss_func = WrapperKLDivLoss()
          self.search_for_args = ["segm_size", "label_vec"]
  
      else:
          raise NotImplementedError
  
imports: from typing import Any
  from collections import OrderedDict
  import torch
  import torch.nn
  import torch.nn.functional
  from torch.autograd import Variable
  from torch_points3d.datasets.segmentation import IGNORE_LABEL
  from .metric_losses import *
label_desc: Use image node_id 1 to create a new LossFactory object from inherited base classes: torch.nn.modules.loss with example: obj = LossFactory(loss, dbinfo)