title: When training GANs in Keras, are multiple passes required to optimize the generator and discriminator?
body: <p>I'm more familiar with tensorflow graph training than Keras, but I'm trying out Keras here.</p>
  
  <p>In building a GAN the generator needs be optimized against a different loss than the discriminator (the opposite loss). In base tensorflow this is easy enough to implement using either 2 optimizers or by calling <code>optimizer.compute_gradients(...)</code> and <code>optimizer.apply_gradients(...)</code> separately with the appropriate group of weights.</p>
  
  <p>In Keras, I don't see that I can achieve either of these. In implementations such as <a href="https://github.com/eriklindernoren/Keras-GAN/blob/master/infogan/infogan.py" rel="noreferrer">Keras-GAN</a>, it appears that the training of generator and discriminator are split into separate models and then trained independently batch-by-batch. This means many more passes are required per effective update than would be required with the base tensorflow implementation with two optimizers operating on one pass.</p>
  
  <p>Is there a way to implement the optimizer for GANs so that both generator and discriminator get trained in one pass in Keras?</p>
  
  <p>TF 1.14</p>