Announcing the TensorFlow Dev Summit 2020 Learn more

tfa.losses.sigmoid_focal_crossentropy

View source on GitHub

Args

Aliases: tfa.losses.focal_loss.sigmoid_focal_crossentropy

tfa.losses.sigmoid_focal_crossentropy(
    y_true,
    y_pred,
    alpha=0.25,
    gamma=2.0,
    from_logits=False
)
y_true: true targets tensor.
y_pred: predictions tensor.
alpha: balancing factor.
gamma: modulating factor.

Returns:

Weighted loss float Tensor. If reduction is NONE,this has the same shape as y_true; otherwise, it is scalar.