roatienza / Deep-Learning-Experiments

Videos, notes and experiments to understand deep learning
MIT License
1.1k stars 760 forks source link

dcgan loss puzzle #20

Closed HuangQinJian closed 5 years ago

HuangQinJian commented 5 years ago

in https://github.com/roatienza/Deep-Learning-Experiments/blob/master/Experiments/Tensorflow/GAN/dcgan_mnist.py you compute the discriminator loss as:

images_fake = self.generator.predict(noise)
x = np.concatenate((images_train, images_fake))
y = np.ones([2*batch_size, 1])
y[batch_size:, :] = 0
d_loss = self.discriminator.train_on_batch(x, y)

y[batch_size:, :] = 0 is this wrong?I think it is y[batch_size:, :] = 1