Hi
I have two networks. The input data goes into network 1(to be trained), and then outputs data which goes to network 2(already trained).
The output of network 2 is the loss data, which is compared with the input data to network 1. How can I train network 1 in pytorch, so that the gradients of network 1 are only updated while the loss still backpropagates from network 2 to network 1?
I appreciate simple explanation, with an example code, if possible