TF 2.0 is out! Get hands-on practice at TF World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

tfa.losses.sigmoid_focal_crossentropy

View source on GitHub

Args

Aliases:

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.