Hello Neta!



 netaglazer:

you mean i should return loss.sum() ?


What I really mean is that you should reorganize your problem a
little bit and use BCEWithLogitsLoss.
However, if you have a good reason to be using MSELoss (and I’m
right that your input and target have shape [nBatch, nClass]),
then, yes, you should return out.sum() (rather than out.sum (0))
so that you will be summing over classes as well as the samples in
your batch.
Best.
K. Frank