You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello all,
reading the code of DeepLabCE, I found a possible problem in how the forward method is implemented.
The used criterion is CrossEntropyLoss and is set up with ignore_index parameter and reduction="none"; according to CrossEntropyLoss doc:
ignore_index (int, optional) – Specifies a target value that is ignored and does not contribute to the input gradient. When size_average is True, the loss is averaged over non-ignored targets.
then, ignore_index is used to:
modify the loss in order to ignore specific values (I think something like zeroing specific positions)
ignore values during the reduction (the doc says during size_average, but it has been deprecated so i think it does the same with reduction set to sum or mean).
The problem is that the forward of DeepLabCE applies the CrossEntropyLoss without the reduction and manually applies the mean after weighting and topk selection. Then, the first point is in someway applied, but the second is not.
Is this correct? Should the mean be applied considering the ignore_label / ignore_index ?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello all,
reading the code of DeepLabCE, I found a possible problem in how the forward method is implemented.
The used criterion is CrossEntropyLoss and is set up with ignore_index parameter and reduction="none"; according to CrossEntropyLoss doc:
then, ignore_index is used to:
The problem is that the forward of DeepLabCE applies the CrossEntropyLoss without the reduction and manually applies the mean after weighting and topk selection. Then, the first point is in someway applied, but the second is not.
Is this correct? Should the mean be applied considering the ignore_label / ignore_index ?
Thanks,
Giacomo
Beta Was this translation helpful? Give feedback.
All reactions