bermanmaxim / LovaszSoftmax

Code for the Lovász-Softmax loss (CVPR 2018)
http://bmax.im/LovaszSoftmax
MIT License
1.38k stars 269 forks source link

how to combine lovasz hinge and bce in binary segmentaion task appropriately? #31

Open yu-Mas opened 3 years ago

yu-Mas commented 3 years ago

Dear BermanMaxin, Thanks for your great work,it has helped me a lot! I got a confusion that how to combine lovasz hinge and bce in binary segmentaion task appropriately. As we all know,lovasz hinge expects logits(without sigmoid),but bce need relust after sigmoid.What confuses me is that whether these two different types(with/without sigmoid) losses can get along well. Other combo loss,e.g. bce+lovasz softmax,bce+dice, all need sigmoid so in my mind there is no problem. Could you give me some advice about this,thanks! In addition,if 'per_image=False' can bring a faster convergence when batch size is big. Thanks.

mingqizhang commented 3 years ago

You can use function lovasz_softmax(), and set the classes=[1].