Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def _build_and_compile_aae(self, optimizer):
print("Compile Discriminator...")
self.discriminator_model.compile(loss='binary_crossentropy',
optimizer=optimizer,
metrics=['accuracy'])
self.discriminator_model.trainable = False
print("Conecting models...")
real_input = Input(shape=self.img_shape)
encoder_output = self.encoder_model(real_input)
decoder_output = self.decoder_generator_model(encoder_output)
discriminator_output = self.discriminator_model(encoder_output)
self.aae = Model(real_input, [decoder_output, discriminator_output], name = 'AAE')
self.aae.compile(loss=['mse', 'binary_crossentropy'],
loss_weights=[0.999, 0.001],
optimizer=optimizer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment