David,
Thanks for looking into this.
The outputs are of shape [N, 1] (therefore, I squeeze it) and the targets are of shape [N, ].
The 2 loss functions nn.MSELoss() and AdjMSELoss() provide the exact same numerical results when I test them on two tensors*… BUT they do not provide similar results when the backward propagation is applied with loss.backward(). And I don’t understand why and which one is the right one…
* I created randomly two numpy arrays of respective size [N, 1] and [N, ]. I converted them into Torch tensors and computed the nn.MSELoss and the AdjMSELoss. These were systematically identical. The problem only arise when I apply loss.bacward()