Commit 9ba50e07 authored by Nicolas Pernoud's avatar Nicolas Pernoud
Browse files

chore: refactored gan_01.py

parent 33712b68
/Lib
/Scripts
/share
pyvenv.cfg
\ No newline at end of file
......@@ -39,6 +39,7 @@ def build_gan(generator, discriminator):
model.add(generator)
model.add(discriminator)
discriminator.trainable = False
model.compile(loss='binary_crossentropy', optimizer=Adam())
return model
......@@ -46,10 +47,8 @@ discriminator = build_discriminator(img_shape)
discriminator.compile(loss='binary_crossentropy',
optimizer=Adam(), metrics=['accuracy'])
generator = build_generator(img_shape, z_dim)
gan = build_gan(generator, discriminator)
gan.compile(loss='binary_crossentropy', optimizer=Adam())
def sample_images(generator, iter, img_per_l=4, img_per_c=4):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment