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

About equation (9) in the paper. #5

Open
YukunLi99 opened this issue Jul 18, 2024 · 1 comment
Open

About equation (9) in the paper. #5

YukunLi99 opened this issue Jul 18, 2024 · 1 comment

Comments

@YukunLi99
Copy link

I find that the score is taken as the opposite number in the code. Why is the final score calculated in this way?
The equation (9) in the paper is:
屏幕截图 2024-07-18 143313
The following is the code implementation:

composition = -torch.logsumexp(torch.stack((-e1, -e2), dim=0), dim=0)
@linhaowei1
Copy link
Owner

Hello,

This might be a legacy typo. The composition score simulating the OR operator uses the function $-logsumexp(-e_1-e_2)$ in [1], while we adopt a different definition of energy functions $p(x) = e^{E(x)}$ to align with the definition of the OOD score.

In our experiments, I recall that the results using torch.logsumexp(torch.stack((e1, e2), dim=0), dim=0) and -torch.logsumexp(torch.stack((-e1, -e2), dim=0), dim=0) were similar (though I am not completely certain as it has been some time since then). If you are interested, feel free to give it a try.

[1] Du et al. Compositional Visual Generation with Energy Based Models. NeurIPS 2020.

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

2 participants