fchollet / deep-learning-with-python-notebooks

Jupyter notebooks for the code samples of the book "Deep Learning with Python"
MIT License
17.95k stars 8.48k forks source link

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

Open Nevermetyou65 opened 2 years ago

Nevermetyou65 commented 2 years ago

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