igul222 / improved_wgan_training

Code for reproducing experiments in "Improved Training of Wasserstein GANs"
MIT License
2.35k stars 668 forks source link

Use different generated fake images to calculate D_loss and G_loss? #53

Closed watsonyanghx closed 6 years ago

watsonyanghx commented 6 years ago

I see when calculating D_loss, you use the fake images generated by this https://github.com/igul222/improved_wgan_training/blob/master/gan_cifar_resnet.py#L192 , but when calculating the G_loss, you use another generated images by this https://github.com/igul222/improved_wgan_training/blob/master/gan_cifar_resnet.py#L293 .

Since I'm new to GAN and this is not the same as other implementations, could anyone tell me if this implementation (use different generated fake images to calculate D_loss and G_loss) is right? And what's the difference between them?

igul222 commented 6 years ago

Both sets of images are random draws from the same generator; i.e. they can be considered samples from the same distribution. The difference is that when we update the generator, we use 2x the batch size because this speeds up convergence a little.