keras-team / keras-contrib

Keras community contributions
MIT License
1.59k stars 653 forks source link

Inconsistency in Jaccard Loss Implementation #526

Open stalhabukhari opened 4 years ago

stalhabukhari commented 4 years ago

I have come across a few implementations of Jaccard Loss that vary a lot. Among all those, the one by DeepMedic made more intuitive sense to me, as the 'per-class' score is computed first, resulting in a vector of size = # of classes, and then averaged over all classes. I feel that the keras-contrib implementation should be the same as well.

The new implementation will have the 'axis' argument to equate to all dimensions except the last (channel/class) dimension.

hv10 commented 4 years ago

We've come across the same problem in our ML task. We came up with the same solution as @stalhabukhari after some research, so we would be glad if the referenced issue could be integrated for future users.