January 2019
Intermediate to advanced
316 pages
8h 16m
English
To create an adversarial model, take both the generator and discriminator networks and create a new Keras model.
def build_adversarial_model(gen_model, dis_model): input_layer = Input(shape=(1024,)) input_layer2 = Input(shape=(100,)) input_layer3 = Input(shape=(4, 4, 128))
# Get output of the generator model x, mean_logsigma = gen_model([input_layer, input_layer2]) # Make discriminator trainable false dis_model.trainable = False
# Get output of the discriminator models valid = dis_model([x, input_layer3])
Read now
Unlock full access