You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
In loss.py there is FocalLoss which has alpha=0.25. alpha_t = alpha * true + (1-alpha)(1-true). This is alright for a binary scenario. I have a multilabel scenario highly imbalanced. How can I use model.class_weights (which calculates the inverse frequency) as class weights for Focal Loss. When I pass model.class_weights as alpha parameter in FocalLoss I get dimension mismatch error. How can I do it?
P.S: I intend to use Focal Loss, thus not resorting to --image-weights flag for sampling while training.
Any help is highly appreciated. @glenn-jocher
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
In loss.py there is
FocalLoss
which hasalpha=0.25
.alpha_t = alpha * true + (1-alpha)(1-true)
. This is alright for a binary scenario. I have a multilabel scenario highly imbalanced. How can I usemodel.class_weights
(which calculates the inverse frequency) as class weights for Focal Loss. When I passmodel.class_weights
as alpha parameter inFocalLoss
I get dimension mismatch error. How can I do it?P.S: I intend to use Focal Loss, thus not resorting to
--image-weights
flag for sampling while training.Any help is highly appreciated. @glenn-jocher
Beta Was this translation helpful? Give feedback.
All reactions