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

the comment in vae.py is totally wrong ! #2

Open
wangpeng138375 opened this issue Mar 6, 2019 · 0 comments
Open

the comment in vae.py is totally wrong ! #2

wangpeng138375 opened this issue Mar 6, 2019 · 0 comments

Comments

@wangpeng138375
Copy link

`# ELBO
marginal_likelihood = tf.reduce_sum(x * tf.log(x_) + (1 - x) * tf.log(1 - x_), 1)
KL_divergence = 0.5 * tf.reduce_sum(tf.square(mu) + tf.square(sigma) - tf.log(1e-8 + tf.square(sigma)) - 1, 1)

marginal_likelihood = tf.reduce_mean(marginal_likelihood)
KL_divergence = tf.reduce_mean(KL_divergence)

ELBO = marginal_likelihood - KL_divergence

# minimize loss instead of maximizing ELBO
loss = -ELBO`

The result going right is just lucky.

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

1 participant