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

Scaling of PiGDM guidance #3

Open
man-sean opened this issue Sep 21, 2023 · 0 comments
Open

Scaling of PiGDM guidance #3

man-sean opened this issue Sep 21, 2023 · 0 comments

Comments

@man-sean
Copy link

In the PiGDM paper (Sec A.1, Algorithm 1) it says that we need to scale the guidance term by $\sqrt{\alpha_t}$.
In the code we scale by $\sqrt{\alpha_t} \cdot \sqrt{\alpha_{t-1}}$:

coeff = alpha_s.sqrt() 
if not self.awd:
    coeff = coeff - c2 * alpha_t.sqrt() / (1 - alpha_t).sqrt()
coeff = coeff * alpha_t.sqrt() * self.grad_term_weight

If we only scale by $\sqrt{\alpha_t}$ we get NaN during inference due to large guidance.
From were this additional scaling by $\sqrt{\alpha_{t-1}}$ comes from?

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