January 2019
Intermediate to advanced
316 pages
8h 16m
English
To train the generator network, we have to train the adversarial model. When we train the adversarial model, it trains the generator network only but freezes the discriminator network. We won't train the discriminator network, as we have already trained it. Perform the following steps to train the adversarial model:
z_noise = np.random.normal(0, 1, size=(batch_size, z_shape))
g_loss = adversarial_model.train_on_batch(z_noise, [1] * batch_size)
We train the adversarial model on the batch of noise vectors and real labels. ...
Read now
Unlock full access