Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def _build_and_compile_discriminator_model(self, optimizer):
discriminator_input = Input(shape=self.img_shape)
discriminator_sequence = Sequential(
[Flatten(input_shape=self.img_shape),
Dense(512),
LeakyReLU(alpha=0.2),
Dense(256),
LeakyReLU(alpha=0.2),
Dense(1, activation='sigmoid')])
discriminator_tensor = discriminator_sequence(discriminator_input)
self.discriminator_model = Model(discriminator_input, discriminator_tensor)
self.discriminator_model.compile(loss='binary_crossentropy',
optimizer=optimizer,
metrics=['accuracy'])
self.discriminator_model.trainable = False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment