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

Variational Autoencoder: cannot understand why there is a '2' coefficient for log sigma #90

Open
stablum opened this issue Nov 22, 2016 · 3 comments

Comments

@stablum
Copy link

stablum commented Nov 22, 2016

Hi,

this is the line 190 of variational_autoencoder.py:

- 0.5 * T.sqr(tgt - mu) / T.exp(2 * ls))

where does that 2 coefficient for the log sigma come from? I did the derivations myself and I could not find it. This other implementation: https://github.com/y0ast/Variational-Autoencoder/blob/master/VAE.py does not include that multiplier. Any explanation? Is it a bug?

@f0k
Copy link
Member

f0k commented Nov 23, 2016

@tencia, do you still know what you did there?

@tencia
Copy link
Contributor

tencia commented Nov 23, 2016

No, unfortunately I don't remember where that term came from, sorry.

@loek-tonnaer
Copy link

Likely it's the square in sigma^2 ;) when dealing with log_sigma it "comes down", i.e. exp(2*log(sigma)) = exp(log(sigma^2)) = sigma^2

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

4 participants