mmcls.models.FocalLoss¶
- class mmcls.models.FocalLoss(gamma=2.0, alpha=0.25, reduction='mean', loss_weight=1.0)[source]¶
Focal loss.
- Parameters
gamma (float) – Focusing parameter in focal loss. Defaults to 2.0.
alpha (float) – The parameter in balanced form of focal loss. Defaults to 0.25.
reduction (str) – The method used to reduce the loss into a scalar. Options are “none” and “mean”. Defaults to ‘mean’.
loss_weight (float) – Weight of loss. Defaults to 1.0.