Skip to content
This repository was archived by the owner on Feb 7, 2025. It is now read-only.

Conversation

@matanat
Copy link
Contributor

@matanat matanat commented Dec 21, 2023

In reversed_step, when traversing the timesteps all the way to the last, an exception is raised by exceeding the boundaries of the alphas_cumprod. This is now fixed by setting the first value of the alphas_cumprod to either zero or to the second-to-last element. The behavior is set by the init argument set_alpha_to_one which control the behavior regarding the first element in the array.
Also, names of local variables in the function are fixed.

Linked to: issue 446

…mprod. This value in now set to zero or taken from the last element in the arrary depending on a value of an init argument. Also, names of local variables in reversed_step are fixed to reflect the actual logic.
@matanat
Copy link
Contributor Author

matanat commented Dec 21, 2023

Not sure about using the same set_alpha_to_one init argument for this. On the other hand, creating another argument to control this seems like an overkill and changing the name of the existing argument might break existing code.

@marksgraham marksgraham linked an issue Dec 21, 2023 that may be closed by this pull request
Copy link
Collaborator

@marksgraham marksgraham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @matanat

This looks good to me, thanks!

I think it is best to define a new variable first_alpha_cumprod, as you have done - it is clearer this way and will not break any compatibility with already implemented code.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DDIM reversed_step alpha_prod_t_next bug

2 participants