Hi,
I have a loss function with two parts: loss = loss1+loss2 and backpropagate.
I am looking for a way to calculate the gradient of each part with respect to the model parameter (weight &bias). How should I handle this?
Currently, I can only get the gradient from the summation loss:
loss.backward()
print(self.Network[numlayer].weight.grad)

How do print out the for example gradient of loss1 wrt weight?
Thank you!
Bests,