keras-dcgan | Keras implementation of Deep Convolutional Generative | Machine Learning library
kandi X-RAY | keras-dcgan Summary
kandi X-RAY | keras-dcgan Summary
Keras implementation of Deep Convolutional Generative Adversarial Networks
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Train the neural network
- Constructs a discriminator model
- Creates a generator of model
- Combine generated images
- Construct a model containing a discriminator
- Generate random image
- Parse command line arguments
keras-dcgan Key Features
keras-dcgan Examples and Code Snippets
Community Discussions
Trending Discussions on keras-dcgan
QUESTION
I would like to build a DCGAN for MNIST by myself in TensorFlow. However, I'm struggling to find out how I should set up the loss function for the generator. In a Keras DCGAN implementation the author used a little "workaround" for this problem: he simply built 3 models. The generator (G), the discriminator (D) and third one, where he just combined G with D, while setting the train-ability of D to false there.
This way, he can feed D with real images + generated images to train D and train the G+D-combined model, because the loss of D is propagated to G, since D is not trainable in the G+D-combined model.
In TensorFlow, I've built G and D already. Training D is relatively simple, since I just need to combine a batch of real MNIST training images with generated ones and call the training op:
...ANSWER
Answered 2017-May-12 at 13:08In the generator step training, you can think that the network involves the discriminator too. But to do the backpropagation, you will only consider the generator weights. A good explanation for it is found here.
As mentioned in original paper, the Discriminator cost is:
And the generator cost is:
Of course, you don't need to calculate it by hand. Tensorflow already handles it. To do all the process, you can implement the following:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install keras-dcgan
You can use keras-dcgan like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page