bermanmaxim / LovaszSoftmax

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

possible bug #2

Closed alexander-rakhlin closed 6 years ago

alexander-rakhlin commented 6 years ago

Hi, Thank you for your work.

I believe there is error here

https://github.com/bermanmaxim/LovaszSoftmax/blob/6309c68a2276ada25ebf04692575bce937460f1a/lovasz_losses.py#L26

should be jaccard[1:p] = jaccard[1:p] - jaccard[:p-1]

bermanmaxim commented 6 years ago

Hi Alexander,

For pytorch tensors, pytorch Variables, as for python lists, these two are equivalent, since jaccard has length p in this case.

Did you observe something to the contrary in some version of pytorch/python?

alexander-rakhlin commented 6 years ago

Ah, sorry, I did not notice it has length of p. No, I did not, this was a formal consideration

bermanmaxim commented 6 years ago

No problem, thanks for your interest.