mjdietzx / SimGAN

Implementation of Apple's Learning from Simulated and Unsupervised Images through Adversarial Training
MIT License
411 stars 101 forks source link

A question about k_g parameters? #7

Closed AlexHex7 closed 6 years ago

AlexHex7 commented 6 years ago

In the paper, it set kd = 1, kg = 2.

Then, for each update of Dφ , we update Rθ twice

But in the code: k_g = 2 # number of generative network updates per step for _ in range(k_g * 2):

I think the 'k_g' should not * 2.

mjdietzx commented 6 years ago

I think b/c when we train the discriminator we train it on two batches (one real, one generated). When we train the generator we only train it on one batch (one to trick the discriminator). So since we already update D twice for each generator update I multiplied by 2.

AlexHex7 commented 6 years ago

@mjdietzx Oh, I see. Thanks!

hellojialee commented 6 years ago

in https://github.com/wayaai/SimGAN/blob/master/sim-gan.py#L309 print('Discriminator model loss real: {}.'.format(disc_loss_real / (log_interval k_d 2))) I think the 'k_d' should not *2