Consider this situation, I combine network a and b’s parametrs into one optimizer, then for loss_a produced by a and loss_b produced by b, I do this:
err = loss_a+loss_b
err.backward()
optimizer.step()
Is it same as:
loss_a.backward()
optimizer_a.step()
loss_b.backward()
optimizer_b.step()
Thanks.