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

The classifier-free guidance of diffusion models is wrong. #177

Open
luowyang opened this issue Apr 9, 2023 · 0 comments
Open

The classifier-free guidance of diffusion models is wrong. #177

luowyang opened this issue Apr 9, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@luowyang
Copy link

luowyang commented Apr 9, 2023

The classifier-free guidance equation of diffusion models here is wrong, which is
$$\epsilon_\theta(x_t, c) = s\epsilon_\text{cond}(x_t, c) + (s - 1)\epsilon_\text{cond}(x_t, c_u).$$
However, the correct equation is given in the Imagen paper, Section 2.2, Equation (2), as
$$\epsilon_\theta(x_t, c) = s\epsilon_\text{cond}(x_t, c) + (1 - s)\epsilon_\text{cond}(x_t, c_u).$$
The code here implements the correct equation, though. So there should be no need to fix the code.

I believe all the sampling articles such as this and this use the wrong equation, so they should also be corrected.

@vpj vpj self-assigned this Jun 30, 2023
@vpj vpj added the bug Something isn't working label Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants