huggingface / huggingface/diffusers

Formulation of reverse diffusion process in DDPM ( 1 - alpha_prod_t = beta_prod_t assumption)

Offen
#9,474 5 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug stale
Vorherrschende Sprache
Python
Sterne
34.5k
Forks
7.3k
Ø Merge
3 T. 3 Std.
Gemergte PRs (30 T.)
91

Beschreibung

### Describe the bug

I looked into sampling code of DDPM, and I believe there's a mistake:
#### I believe the code makes assumption that 1 - alpha_prod_t = beta_prod_t, which simply isn't true.

Original sampling algorithm:
[original paper](https://arxiv.org/pdf/2006.11239)
![image](https://github.com/user-attachments/assets/ce07bbb7-5a9d-44e6-9f0e-18bf42963317)

x_0 prediction from sample and predicted noise :

Eqn 15 from paper, as referenced in code snippet as well:
![Screenshot 2024-09-19 at 6 26 48 PM](https://github.com/user-attachments/assets/3ce27e0b-515b-4cd3-b722-454594139f83)

code implementation in diffusers:
https://github.com/huggingface/diffusers/blob/1e8cf2763d37fa66cfba2fb87acfe3443068ce43/src/diffusers/schedulers/scheduling_ddpm.py#L446-L449

### Here, it clearly seems like the 1 - alpha_prod_t = beta_prod_t is being used.

investigated from post by @AlejandroBaron in https://github.com/huggingface/diffusers/discussions/9431_

### Reproduction

I haven't tested out code, but this seems fundamental formulation issue.

### Logs

_No response_

### System Info

0.30.3

### Who can help?

@sayakpaul @DN6 @yiy

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start in src/diffusers/schedulers/scheduling_ddpm.py at lines 446-449, then compare the implementation with Eq. 15 of the linked DDPM paper and the referenced discussion. Verify whether the reported relationship between alpha_prod_t and beta_prod_t is actually assumed, and establish the correct behavior with a reproducible check before proposing a fix.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
machine-learning
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.