Closed ghost closed 2 years ago
Hi. Thank you for your interest in our work!
I'm not sure if you are talking about the generator or style code. To implement the stop gradient described in paper, I used torch.no_grad()
or tensor.detach()
Here's the actual implementations:
If you are talking about freezing other networks during the generator update, I set requires_grad_(False)
. You can find it here.
I hope this helps you.
Got it. I'm talking about the style code. Thanks a lot!
Sorry to bother again. This model keeps the background of images very well, and I think this may be because the style codes are updated separately. If the style code is updated jointly, which code needs to be changed in addition to the three mentioned above?
Actually, the style code cannot be trained jointly. It's technically possible, but it will generate unrealistic samples.
Got it. Thanks for your reply!
Hi, thank you for sharing your code. Can you please tell me how to stop the gradient when training the generator in your code? Looking forward to your reply, thanks!