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

Possible bug in the code #3

Open
abdulfatir opened this issue Apr 7, 2019 · 3 comments
Open

Possible bug in the code #3

abdulfatir opened this issue Apr 7, 2019 · 3 comments

Comments

@abdulfatir
Copy link

p_c_z = torch.exp(torch.log(theta_tensor2) - torch.sum(0.5*torch.log(2*math.pi*lambda_tensor3)+\

Hi!
In this line, why did you replace - (minus) with + at the end?

@eelxpeng
Copy link
Owner

eelxpeng commented Apr 8, 2019

Note that it is -torch.sum(first_term + second_term). I enclose the two terms inside the sum with a negative sign on the front. In math, it should be -log(1/2*pi*sigma^2) - (x-mu)^2/sigma^2.

@abdulfatir
Copy link
Author

abdulfatir commented Apr 8, 2019 via email

@OmranKaddah
Copy link

Hi,
How about this? why are you adding pi?
qentropy = -0.5*torch.sum(1+z_log_var+math.log(2*math.pi), 1)

I think it is a wrong naming for logpzc variable. Better be KL divergence p_z_c and p_z_x
,and qentropy is included.
Also in the loss function, you are only considering binary cross-entropy case in the loss function.

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

3 participants