annotated_deep_learning_paper_implementations
annotated_deep_learning_paper_implementations copied to clipboard
The classifier-free guidance of diffusion models is wrong.
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.