Skip to content

Laplace Scheduler for DDPM #11320

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 2 commits into
base: main
Choose a base branch
from

Conversation

gapatron
Copy link

@gapatron gapatron commented Apr 15, 2025

What does this PR do?

This PR adds a Laplace noise scheduler that samples more frequently around mid-range noise levels (centered around log SNR = 0), following the formulation described in Improved Noise Schedule For Diffusion Training.

Improvements include:

  • Improved sample quality (lower FID)
  • Faster convergence during training
  • Robust performance across resolution and loss objectives.

Before submitting

Who can review?

Core library:

Sorry, something went wrong.

… (around log SNR=0), increasing performance (lower FID) with faster convergence speed, and robust to resolution and objective. Reference: https://arxiv.org/pdf/2407.03297.
@hlky
Copy link
Contributor

hlky commented Apr 15, 2025

@bot /style

Copy link
Contributor

Style fixes have been applied. View the workflow run here.

@a-r-r-o-w
Copy link
Member

@gapatron Thank you for the PR. The changes look good to me!

Could you run make fix-copies and push the relevant changes? Also, could you share some generation results and comparisons for anyone reviewing the PR to have something to look at immediately?

cc @asomoza

@gapatron
Copy link
Author

Of course! I am working on a background infilling problem for astronomical images. The Laplace scheduler gives me more consistent results across configurations, in general. Please take a look at the images below, which contain a significant region masked and then infilled with various trained models. All of them are taken from an evaluation batch, at epoch 25.

Laplace Schedule
epsilon-prediction
batch_0_viz

x-prediction
batch_0_viz

v-prediction
batch_0_viz

Cosine Schedule
epsilon-prediction
batch_0_viz

x-prediction
batch_0_viz

v-prediction
batch_0_viz

Linear Schedule
epsilon-prediction
batch_0_viz

x-prediction
batch_0_viz

v-prediction
batch_0_viz

Laplace scheduler, empirically, is the more robust and the leas likely to blow up without clip sampling. Additionally, for large masks the Laplace scheduler consistently provides me with the smoother, most natural infills. I attach the numerical results of these experiments, in case they are helpful.

Results
results.csv

P.S.: @a-r-r-o-w a ,@yiyixuxu is this okay? I tried pushing it from my Windows, which gave me some issues, so I had to force-revert to a previous version of the commit.

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.

None yet

3 participants