I have two networks, for example, netA and netB. However, I want to use different loss functions to update different networks. For example, I want to use loss1 to update netA, and use loss2 to update netB.
I have defined different optimizers for netA and netB. Each optimizer optimizes only the parameters of the corresponding network.
The total pipeline is shown in the following diagram.

微信图片编辑_202107281456592766×588 48.8 KB

The optimized pipeline I came up with is shown below：

微信图片编辑_202107281457271855×2566 144 KB

What I want to ask is, is the above process correct?