What is the difference between classes
and ignore_index
in some losses?
#31
Replies: 3 comments 15 replies
-
Here's a gist showcasing my concern: https://gist.github.com/DimitrisMantas/658e16bf9c651588474550a1ad5d76ca |
Beta Was this translation helpful? Give feedback.
-
I haven't had a chance to look at your gist yet. If you have a (C, H, W) prediction, classes allows you to ignore the loss for one or more of the these. ignore_index is different that it ignores the loss for pixels in the ground truth across all classes. This allows you to ignore pixels of a class present in the ground truth or that may be invalid (-1000, -1, etc.). So setting |
Beta Was this translation helpful? Give feedback.
-
Just to summarize what At the moment, with the old code from smp:
The current implementation of Regarding Finally, regarding ignoring the background, we should follow a similar approach to
and then compute the loss. Let me know your thoughts |
Beta Was this translation helpful? Give feedback.
-
Some losses, such as
DiceLoss
, accept both aclasses
and anignore_index
argument.I've noticed that I'm getting different results for seemingly equivalent configurations (e.g.,
classes = [1, 2]
, assuming a three-class problem, andignore_index = 0
), but I can't wrap my head around why.Beta Was this translation helpful? Give feedback.
All reactions