deep-learning-with-python-notebooks
deep-learning-with-python-notebooks copied to clipboard
Question about GAN in chapter 12 about super() and training argument
Hello, thanks for writing good books, I have a few questions regarding GANs.
- In the defined GAN class, we need to override the
compile
method to receive 2 optimizers. When using super why do we need to pass assuper(GAN, self).compile()
? Isn't it just the same as plainsuper().compile()
in python3? - Can I also pass argument
training=True/False
when calling discriminator and generator? For example
with tf.GradientTape() as tape:
predictions = self.discriminator(
self.generator(random_latent_vectors, training=True), training=False)
g_loss = self.loss_fn(misleading_labels, predictions)
something like this?? thanks