Skip to content

[Scheduler] Add Variational Diffusion Models (VDM) scheduler #7737

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

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
9653bb9
Add VDMScheduler to diffusers/schedulers
Apr 17, 2024
e54d9a1
Merge branch 'main' of https://github.com/huggingface/diffusers into …
Apr 17, 2024
e5439c3
Refactor VDMScheduler class in scheduling_vdm.py
Apr 18, 2024
89b0c28
Merge branch 'main' of https://github.com/huggingface/diffusers into …
Apr 18, 2024
5a9bc62
Refactor VDMScheduler class in scheduling_vdm.py
Apr 18, 2024
cb4019e
Refactor VDMScheduler in scheduling_vdm.py
Apr 18, 2024
02b71ef
Refactor VDMScheduler in scheduling_vdm.py
Apr 18, 2024
fb00457
Refactor VDMScheduler in scheduling_vdm.py
Apr 18, 2024
f077255
Merge branch 'main' of https://github.com/huggingface/diffusers into …
Apr 18, 2024
af440df
Merge branch 'main' of https://github.com/huggingface/diffusers into …
Apr 19, 2024
487f871
Refactor VDMScheduler class in scheduling_vdm.py
Apr 19, 2024
3902411
Refactor VDMScheduler's predicted previous sample computation
Apr 19, 2024
6199b57
Refactor VDMScheduler class and add docstrings
Apr 22, 2024
7c4a4a7
Update copyright information in scheduling_vdm.py
Apr 22, 2024
f962b14
Merge branch 'main' of https://github.com/huggingface/diffusers into …
Apr 22, 2024
533ae9b
Add VDMScheduler to diffusers/__init__.py and implement VDMScheduler …
Apr 22, 2024
a05af00
Refactor diffusers module and schedulers
Apr 22, 2024
880c7f8
Add VDMScheduler and VDMSchedulerOutput to the API documentation.
Apr 22, 2024
f6da6e6
Merge main
May 17, 2024
5f63951
Merge branch 'main' of github.com:huggingface/diffusers into vdm-sche…
probabilisticrobotics Jun 11, 2024
a5eedfd
Refactor VDMScheduler class in scheduling_vdm.py
probabilisticrobotics Jun 11, 2024
9fc5b58
Refactor VDMScheduler in scheduling_vdm.py
probabilisticrobotics Jun 11, 2024
766f142
Fix prediction calculation in VDMScheduler
Jun 12, 2024
d6de708
Merge branch 'main' into vdm-scheduler
hummat Sep 14, 2024
bac8902
Merge branch 'main' into vdm-scheduler
hummat Sep 16, 2024
756cd92
Merge branch 'main' into vdm-scheduler
hummat Sep 29, 2024
fe27771
Merge branch 'main' into vdm-scheduler
hummat Oct 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions docs/source/en/api/schedulers/vdm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!--Copyright 2024 The HuggingFace Team. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
-->

# VDMScheduler

[Variational Diffusion Models](https://arxiv.org/abs/2107.00630) (VDM) by Diederik P. Kingma, Tim Salimans, Ben
Poole and Jonathan Ho introduces a family of diffusion-based generative models that achieve state-of-the-art
log-likelihoods on standard image density estimation benchmarks by formulating diffusion as a continuous-time problem
in terms of the signal-to-noise ratio.

The abstract from the paper is:

*Diffusion-based generative models have demonstrated a capacity for perceptually impressive synthesis, but can they
also be great likelihood-based models? We answer this in the affirmative, and introduce a family of diffusion-based
generative models that obtain state-of-the-art likelihoods on standard image density estimation benchmarks. Unlike
other diffusion-based models, our method allows for efficient optimization of the noise schedule jointly with the
rest of the model. We show that the variational lower bound (VLB) simplifies to a remarkably short expression in terms
of the signal-to-noise ratio of the diffused data, thereby improving our theoretical understanding of this model class.
Using this insight, we prove an equivalence between several models proposed in the literature. In addition, we show that
the continuous-time VLB is invariant to the noise schedule, except for the signal-to-noise ratio at its endpoints. This
enables us to learn a noise schedule that minimizes the variance of the resulting VLB estimator, leading to faster
optimization. Combining these advances with architectural improvements, we obtain state-of-the-art likelihoods on image
density estimation benchmarks, outperforming autoregressive models that have dominated these benchmarks for many years,
with often significantly faster optimization. In addition, we show how to use the model as part of a bits-back
compression scheme, and demonstrate lossless compression rates close to the theoretical optimum. Code is available at
[this https URL](https://github.com/google-research/vdm).*

## VDMScheduler
[[autodoc]] VDMScheduler

## VDMSchedulerOutput
[[autodoc]] schedulers.scheduling_vdm.VDMSchedulerOutput
2 changes: 2 additions & 0 deletions src/diffusers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@
"TCDScheduler",
"UnCLIPScheduler",
"UniPCMultistepScheduler",
"VDMScheduler",
"VQDiffusionScheduler",
]
)
Expand Down Expand Up @@ -662,6 +663,7 @@
TCDScheduler,
UnCLIPScheduler,
UniPCMultistepScheduler,
VDMScheduler,
VQDiffusionScheduler,
)
from .training_utils import EMAModel
Expand Down
2 changes: 2 additions & 0 deletions src/diffusers/schedulers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
_import_structure["scheduling_tcd"] = ["TCDScheduler"]
_import_structure["scheduling_unclip"] = ["UnCLIPScheduler"]
_import_structure["scheduling_unipc_multistep"] = ["UniPCMultistepScheduler"]
_import_structure["scheduling_vdm"] = ["VDMScheduler"]
_import_structure["scheduling_utils"] = ["AysSchedules", "KarrasDiffusionSchedulers", "SchedulerMixin"]
_import_structure["scheduling_vq_diffusion"] = ["VQDiffusionScheduler"]

Expand Down Expand Up @@ -172,6 +173,7 @@
from .scheduling_tcd import TCDScheduler
from .scheduling_unclip import UnCLIPScheduler
from .scheduling_unipc_multistep import UniPCMultistepScheduler
from .scheduling_vdm import VDMScheduler
from .scheduling_utils import AysSchedules, KarrasDiffusionSchedulers, SchedulerMixin
from .scheduling_vq_diffusion import VQDiffusionScheduler

Expand Down
Loading