I have multiple losses, and i want to weight them seperately. More specifically, i want to set the weight of loss1 to 1, and the weight of loss2 to 0.5, is that correct?
loss1 = nn.L1Loss(B, A)
loss2 = nn.L1Loss(C, A)
loss2 = loss2*0.5
loss1.backward(retain_variables=True)
loss2.backward()
optimizer.step()