Keras-GAN
Keras-GAN copied to clipboard
Keras-GAN: Help understanding the model setup?
Hi! Sorry for the basic question but I'm a bit of a beginner and I'm trying to understand how the model is set up. I have a 2-part question:
First, what is the reason for defining a model sequentially and then using it to create a model with the functional API? (for example...) https://github.com/eriklindernoren/Keras-GAN/blob/44d3320e84ca00071de8a5c0fb4566d10486bb1d/gan/gan.py#L54-L73
Second, when creating the combined model, the discriminator is set to not trainable but how is it able to be trained individually while being frozen to train the generator? https://github.com/eriklindernoren/Keras-GAN/blob/44d3320e84ca00071de8a5c0fb4566d10486bb1d/gan/gan.py#L40-L41
Thanks for your help! Sorry if these are super basic questions or don't make any sense
Regarding your second questions, see: https://github.com/eriklindernoren/Keras-GAN/issues/22#issuecomment-379553290
Essentially, it is important that trainable = false
is set between discriminator.compile()
and combined.compile()
.
Gotcha, thanks!
functional api is used for multi input multi output system