code: def __init__(self, config):
      super().__init__(config)
  
      class_num = self._config["data"]["task"]["classes"]["num"]
      if "alpha" in self._config["data"]["task"]["classes"]:
          self.alpha = self._config["data"]["task"]["classes"]["alpha"]
          assert (
              len(self.alpha) == class_num
          ), "alpha len is not equal to class_num"
          self.alpha = tf.constant(self.alpha)
      else:
          self.alpha = tf.ones([class_num])
  
      self.gamma = 2
      if "gamma" in self._config["solver"]["optimizer"]:
          self.gamma = self._config["solver"]["optimizer"]["gamma"]
      assert self.gamma >= 0, "gamma must greater than or equal to zero"
  
imports: import delta.compat
  from delta.utils.loss.base_loss import Loss
  from delta.utils.loss.loss_utils import cross_entropy
  from delta.utils.loss.loss_utils import mask_sequence_loss
  from delta.utils.loss.loss_utils import ctc_lambda_loss
  from delta.utils.loss.loss_utils import crf_log_likelihood
  from delta.utils.loss.loss_utils import focal_loss
  from delta.utils.register import registers
label_desc: Use image node_id 1 to create a new FocalLoss object from inherited base classes: Loss with example: obj = FocalLoss(config)