Closed jhauret closed 3 months ago
Still on the basic GAN tutorial, I spotted a few more track of improvements:
validation_step
is not defined.global_step=0
is overwriting the results of previous epochs.retain_graph=True
).I am willing to implement and submit a PR if you find this helpful :smiley:
Hello @jhauret, I apologize for the late reply, it was not in good shape until a few days ago, so would you be interested in sending PR with the fix? :rabbit:
Hi @Borda, I hope you're feeling better now. Yes, I'll do it the first week of August!
📚 Documentation
In the training_step of the GAN(L.LightningModule) the generator and discriminator forward are called several times on the same input. Obviously this slows down the training because more computation is required. I wonder if we could just reuse the results of the first call. After all, the
toggle_optimiser
/untoggle_optimiser
functions should make it safe, right?For the generator:
self.generated_imgs = self(z)
self.discriminator(self(z))
self.discriminator(self(z).detach())
For the discriminator:
self.discriminator(self(z))
self.discriminator(self(z).detach())
cc @borda