Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Nicolas PERNOUD
gan_demo
Commits
9ba50e07
Commit
9ba50e07
authored
Feb 17, 2020
by
Nicolas Pernoud
Browse files
chore: refactored gan_01.py
parent
33712b68
Changes
2
Show whitespace changes
Inline
Side-by-side
.gitignore
0 → 100644
View file @
9ba50e07
/Lib
/Scripts
/share
pyvenv.cfg
\ No newline at end of file
gan_01.py
View file @
9ba50e07
...
...
@@ -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
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment