I wonder if there are some problems with that definition:
Does it work with one-hot-encoded data? In particular, I would've expected axis to be everything but the channel dimension, but it is just the channel dimension.
Shouldn't it skip the background label? (At least optionally)
I also wondered about the multiplication at the end.
Furthermore, smooth = 100 looks like a really arbitrary default.
Here is jaccard loss implementation: https://github.com/keras-team/keras-contrib/blob/master/keras_contrib/losses/jaccard.py
Why jaccard loss is prefered to dice loss?
Why we apply
K.abs
? as I understandy_true
,y_pred
should be already in [0,1] range. https://github.com/keras-team/keras-contrib/blob/master/keras_contrib/losses/jaccard.py#L31Why default
smooth=100
? howsmooth
parameter affect training?As I understand adding
smooth
to denominator prevents division by zero(why not smooth=eps=1e-6?), but why it's added to numerator?Why we multiply loss by
smooth
at the end? https://github.com/keras-team/keras-contrib/blob/master/keras_contrib/losses/jaccard.py#L34