deep-learning-with-python-notebooks icon indicating copy to clipboard operation
deep-learning-with-python-notebooks copied to clipboard

Question about GAN in chapter 12 about super() and training argument

Open Nevermetyou65 opened this issue 3 years ago • 0 comments

Hello, thanks for writing good books, I have a few questions regarding GANs.

  1. 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 as super(GAN, self).compile()? Isn't it just the same as plain super().compile() in python3?
  2. 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

Nevermetyou65 avatar Dec 22 '21 14:12 Nevermetyou65