code: def __init__(
      self,
      n_class,
      loss_type="CrossEntropy",
      loss_func_params=None,
      name="loss_function",
  ):
      super(LossFunction, self).__init__(name=name)
      self._num_classes = n_class
      if loss_func_params is not None:
          self._loss_func_params = loss_func_params
      else:
          self._loss_func_params = {}
      self._data_loss_func = None
      self.make_callable_loss_func(loss_type)
  
file_path: NiftyNet/niftynet/layer/loss_classification.py
imports: from __future__ import absolute_import, print_function, division
  import numpy
  import tensorflow
  from niftynet.engine.application_factory import LossClassificationFactory
  from niftynet.layer.base_layer import Layer
label_desc: Use image node_id 1 to create a new LossFunction object from inherited base classes: Layer with example: obj = LossFunction(n_class, loss_type, loss_func_params, name)