December 2018
Intermediate to advanced
268 pages
8h 23m
English
There are a few key things to notice in this initialization step, as shown here:
class GAN(object): def __init__(self,discriminator,generator): self.OPTIMIZER = Adam(lr=0.0002, decay=8e-9) self.Generator = generator self.Discriminator = discriminator self.Discriminator.trainable = False self.gan_model = self.model() self.gan_model.compile(loss='binary_crossentropy', optimizer=self.OPTIMIZER) self.gan_model.summary()
First, notice that we are grabbing both the discriminator and generator models. The discriminator then sets its trainability to False, meaning that during the adversarial training, it will not be training. The generator is consistently getting better, but the discriminator will remain the same. ...
Read now
Unlock full access