Keras-GAN icon indicating copy to clipboard operation
Keras-GAN copied to clipboard

Keras-GAN: Help understanding the model setup?

Open a-poor opened this issue 5 years ago • 3 comments

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

a-poor avatar Jul 30 '19 19:07 a-poor

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().

TheGuywithTheHat avatar Oct 04 '19 19:10 TheGuywithTheHat

Gotcha, thanks!

a-poor avatar Oct 12 '19 16:10 a-poor

functional api is used for multi input multi output system

hiteshnitetc avatar Jun 12 '20 14:06 hiteshnitetc