ytm.guided.backends.act_loss.FocalBCE#

class ytm.guided.backends.act_loss.FocalBCE(alpha: float = 0.25, gamma: float = 2.0, eps: float = 1e-7)#

Bases: ActLoss

Sigmoid with focal binary cross-entropy per class, for imbalanced binary and multi-label classification.

Parameters:
alphafloat, default=0.25

Weight of the positive term, in [0, 1]. The negative term gets 1 - alpha.

gammafloat, default=2.0

Focusing exponent, must be >= 0. 0 gives weighted binary cross-entropy.

epsfloat, default=1e-7

Added inside the logs, must be > 0.