Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What's the meaning of this code? #15

Open
hgfm opened this issue Jun 16, 2017 · 2 comments
Open

What's the meaning of this code? #15

hgfm opened this issue Jun 16, 2017 · 2 comments

Comments

@hgfm
Copy link

hgfm commented Jun 16, 2017

In the
def train(BATCH_SIZE):
discriminator_on_generator = \ generator_containing_discriminator(generator, discriminator)

what is discriminator_on_generator?Is it a model?

@mynameisvinn
Copy link

discriminator_on_generator is a model that combines a generator and discriminator. in other words, discriminator_on_generator is a stacked model that is a binary classifier, capable of distinguishing between fake and real images.

ultimately, it is discriminator_on_generator that trains the generator - the generator is never trained as a standalone model. the relevant bit of code is here:

g_loss = discriminator_on_generator.train_on_batch(
                noise, [1] * BATCH_SIZE)

@Moondra
Copy link

Moondra commented Dec 6, 2017

@mynameisvinn

Since discriminator_on_generator is trains the generator, why do you need to compile the generator?
g.compile(loss='binary_crossentropy', optimizer="SGD")

Also in the paper, it seems we need to max one model and minimize the other model, but we don't seem to be doing that here. We seem to be minimizing both loss functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants