OK. I prepared some stuff that could help.
lets assume that FIG1 is my network with two outputs and corresponding errors, i.e. [loss1, loss2].
I can write the gradients for each output separately as EQUATION SET#1.
Basically, what is different for them is the value of the loss, i.e. loss 1 for ‘up’ and loss 2 for ‘down’.
This differs from the case we go with sum (or mean) that would result in EQUATION SET#2.
So my question is, how can I use Pytorch to implement the former but not latter?

251060×1360 78.2 KB