kandi X-RAY | gan-intro Summary
kandi X-RAY | gan-intro Summary
gan-intro
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Train model
- Generate random samples
- Save an animation
- Plots the distribution of the distribution
- Compute the discriminator
- Compute a tensor
- Minibatch layer
- Parse command line arguments
- Generate tensorflow
gan-intro Key Features
gan-intro Examples and Code Snippets
Community Discussions
Trending Discussions on gan-intro
QUESTION
In my implementation of a GAN network the output of the discriminator is something like 2.05145e+07
which leads to 1 - disc_output
-> 1-2.05145e+07=-2.05145e+07
(a negativ number) therefore log(1-2.05145e+07)
leads to NaN.
I am not the first one with this kind of problem. One solution is to only allow positive values inside the log
like done here.
Does anyone knows any better solution to this?
maybe some different loss function ?
ANSWER
Answered 2017-Aug-04 at 14:05Because discriminator returns a probability value, its output must be between 0 and 1. Try using sigmoid
( https://www.tensorflow.org/api_docs/python/tf/sigmoid) before using discriminator outputs.
Additionally, as others did, I suggest using tf.log(tf.maximum(x, 1e-9))
in case of a numerical instability.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install gan-intro
You can use gan-intro 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