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

Allow DDPM scheduler to use model's predicated variance #132

Merged
merged 2 commits into from
Aug 3, 2022

Conversation

eyalmazuz
Copy link
Contributor

This is an implementation of the Improved Denoising Diffusion Probabilistic Models
which added the ability to learn the variance instead of just predicting the noise.

It is assumed that the step method receives a tensor shape (B, C, ...) when predicting noise.
At the moment, it only implements variance. In order to use it fully, the user needs to write the additional loss function from the paper into their training loop.

For future contribution, I think it would be beneficial to implement a losses module with different loss functions like the VB loss in the Improved Diffusion paper or other loss functions used in different diffusion papers (and maybe a trainer object). If needed, I can make new PRs with the relevant additions, or this can be an ongoing PR (the former seems better in case I'll stop contributing for some reason).

to utilize model that also predict the variance.
Copy link
Member

@anton-l anton-l left a comment

Choose a reason for hiding this comment

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

Hi @eyalmazuz! Thank you for your contribution, this will be quite useful for when we bring OpenAI's guided diffusion and Glide models into the library!
We'll have to think a bit more about the API design for learned variance (cc @patil-suraj), but for now this will work fine :)

src/diffusers/schedulers/scheduling_ddpm.py Outdated Show resolved Hide resolved
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Aug 3, 2022

The documentation is not available anymore as the PR was closed or merged.

@anton-l anton-l merged commit b6447fa into huggingface:main Aug 3, 2022
yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request Dec 25, 2023
)

* Extented the ability of ddpm scheduler
to utilize model that also predict the variance.

* Update src/diffusers/schedulers/scheduling_ddpm.py

Co-authored-by: Anton Lozhkov <[email protected]>
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

Successfully merging this pull request may close these issues.

3 participants