-
Notifications
You must be signed in to change notification settings - Fork 24.8k
Description
📚 Documentation
Concern about MultiLabelSoftMarginLoss, I think there is still a problem with its doc.
As @DNGros pointed out, there is a lot of confusion when using MultiLabelMarginLoss and MultiLabelSoftMarginLoss, and he improved the docs. #15863
However, for the docs of MultiLabelSoftMarginLoss it's still not correct.
Since if you set the label as the docs
Target: (N, C)(N,C) , label targets padded by -1 ensuring same shape as the input.
pad it like [0,3,-1,-1], the result will be wrong.
If we look at the equation
we will find it, in fact, write clearly that label y need to be 0 or 1.
If we feed the -1 padded label, the loss actually sometimes will become negative number, and this is shown by my experiment.
So I think the right Target format for MultiLabelSoftMarginLoss is just one_hot vector.
And we can give a good example code as MultiLabelMarginLoss has.