def METHOD_NAME(y_pred, y_true, alpha, gamma, normalizer, label_smoothing=0.0):
    """Compute the focal loss between `logits` and the golden `target` values.
    Focal loss = -(1-pt)^gamma * log(pt)
    where pt is the probability of being classified to the true class.
    Args:
      y_pred: A float tensor of size [batch, height_in, width_in,
        num_predictions].
      y_true: A float tensor of size [batch, height_in, width_in,
        num_predictions].
      alpha: A float scalar multiplying alpha to the loss from positive examples
        and (1-alpha) to the loss from negative examples.
      gamma: A float scalar modulating loss from hard and easy examples.
      normalizer: Divide loss by this value.
      label_smoothing: Float in [0, 1]. If > `0` then smooth the labels.
    Returns:
      loss: A float32 scalar representing normalized total loss.
    """
    with tf1.name_scope("focal_loss"):
        normalizer = tf.cast(normalizer, dtype=y_pred.dtype)
        # compute focal loss multipliers before label smoothing, such that it will
        # not blow up the loss.
        pred_prob = tf.math.sigmoid(y_pred)
        p_t = (y_true * pred_prob) + ((1 - y_true) * (1 - pred_prob))
        alpha_factor = y_true * alpha + (1 - y_true) * (1 - alpha)
        modulating_factor = (1.0 - p_t) ** gamma
        # apply label smoothing for cross_entropy for each entry.
        if label_smoothing:
            y_true = y_true * (1.0 - label_smoothing) + 0.5 * label_smoothing
        ce = tf.nn.sigmoid_cross_entropy_with_logits(labels=y_true, logits=y_pred)
        # compute the final loss and return
        return (1 / normalizer) * alpha_factor * modulating_factor * ce