TPL icon indicating copy to clipboard operation
TPL copied to clipboard

About equation (9) in the paper.

Open YukunLi99 opened this issue 1 year ago • 1 comments

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)

YukunLi99 avatar Jul 18 '24 06:07 YukunLi99

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.

linhaowei1 avatar Jul 21 '24 14:07 linhaowei1