mlyg / unified-focal-loss

Apache License 2.0
150 stars 22 forks source link

There is no symmetric_focal_tversky_loss in loss_functions.py #6

Closed oikosohn closed 2 years ago

oikosohn commented 2 years ago

I think symmetric_focal_tversky_loss needs to be partially changed from the code of the asymmetric_focal_tversky_loss

# asymmetric_focal_tversky_loss 
...
back_dice = (1-dice_class[:,0]) 
fore_dice = (1-dice_class[:,1]) * K.pow(1-dice_class[:,1], -gamma)

# symmetric_focal_tversky_loss 
...
back_dice = (1-dice_class[:,0]) * K.pow(1-dice_class[:,0], -gamma)
fore_dice = (1-dice_class[:,1]) * K.pow(1-dice_class[:,1], -gamma)

Is this right?

If I am wrong, can you tell me when it will be updated?

mlyg commented 2 years ago

Thanks again for spotting this! It is exactly as you would have suspected. I have added this loss function to the file.