Open mrgloom opened 5 years ago
The paper says that a and b are the respective labels for fake data and real data that the discriminator assigns during training to calculate the loss. On lines 103 and 104, "valid" and "fake" are arrays initialized to all zeros and all ones respectively to be used in training. Fake corresponds to the parameter a, and valid corresponds to b. This means that in the code, a=0 and b=1, reflecting what equation 9 says. Then on line 132, the generator's loss is calculated by training against the valid array (corresponding to b), which means that c=b=1 like in equation 9. So the constants are held as the valid and fake NumPy arrays!
In paper https://arxiv.org/pdf/1611.04076.pdf section
3.2.3 Parameters Selection
ineq. 9
they useb=1, a=0, c=1
, but I can't see this constants in the code: https://github.com/eriklindernoren/Keras-GAN/blob/master/lsgan/lsgan.py#L29 https://github.com/eriklindernoren/Keras-GAN/blob/master/lsgan/lsgan.py#L50