GANs-in-Action/gans-in-action

Is it an error when train the generator in Chapter7 SGAN ?

WendyMin opened this issue · 2 comments

The original code is:

# Train Generator
        g_loss = gan.train_on_batch(z, np.ones((batch_size, 1)))

But the generator generates fake images, so I think the input of gan.train_on_batch is fake=np.zeros((batch_size, 1))

# Train Generator
        g_loss = gan.train_on_batch(z, np.zeros((batch_size, 1)))

The original code is correct, because during Generator training, we want to fool the Discriminator.

Thanks. You are absolutely right.