January 2019
Intermediate to advanced
316 pages
8h 16m
English
Create the Keras models as we did previously, which are specified in the Stage-I StackGAN section under A Keras implementation of StackGAN:
Start by defining the optimizers required for the training:
dis_optimizer = Adam(lr=stage1_discriminator_lr, beta_1=0.5, beta_2=0.999)gen_optimizer = Adam(lr=stage1_generator_lr, beta_1=0.5, beta_2=0.999)
We will use the Adam optimizer with the learning rate equal to 0.0002 and the beta_1 value equal to 0.5 and beta_2 equal to 0.999.
Now build and create models:
stage2_dis = build_stage2_discriminator()stage2_dis.compile(loss='binary_crossentropy', optimizer=dis_optimizer)stage1_gen = build_stage1_generator()stage1_gen.compile(loss="binary_crossentropy", optimizer=gen_optimizer)stage1_gen.load_weights( ...
Read now
Unlock full access