output_source = model(source_image)
loss_s = crossentropyloss(output_source,0)
loss_s.backward()
output_target = model(target_image)
loss_t = crossentropyloss(output_target,1)
loss_t.backward()
or
output_source = model(source_image)
loss_s = crossentropyloss(output_source,0)
output_target = model(target_image)
loss_t = crossentropyloss(output_target,1)
loss = loss_s + loss_t
loss.backward()
which one is right approach?
thank you in advance