FocalLoss_Keras
FocalLoss_Keras copied to clipboard
Clipping y_pred for stability of loss
I think adding in a clipping might improve the stability of the focal loss implementation. This prevents the log(0) and the gradient of log(x) at x=1 from blowing up and giving nans eps = 1e-12 y_pred=K.clip(y_pred,eps,1.-eps)
@manyu90 I think your view is correct and thank you for your supplements.