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

Need minus sign in reverse log density computation #16

Open
jaanli opened this issue Jan 8, 2020 · 0 comments
Open

Need minus sign in reverse log density computation #16

jaanli opened this issue Jan 8, 2020 · 0 comments

Comments

@jaanli
Copy link

jaanli commented Jan 8, 2020

return u, -a.sum(-1, keepdim=True)

This currently matches

return x, -a.sum(-1, keepdim=True)
- but L114 should have no minus sign for the log determinant of the Jacobian.

The forward computation is on

u = (inputs - m) * torch.exp(-a)

u = (inputs - m) * torch.exp(-a)

The inverse of this is

inputs = u * torch.exp(a) + m

So the log determinant jacobian of the inverse is a.sum(-1, keepdim=True) not -a.sum(-1, keepdim=True).

Might be missing something here!

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