Skip to content

Choosing the Appropriate add_noise() Method in diffusers.schedulers and Compatibility with Different Schedulers for Data Generation #10902

Answered by llmydota
llmydota asked this question in Q&A

You must be logged in to vote

I found that all schedulers can be interchanged, but during training, it's best to use the add_noise method from the DDPMScheduler:

# Add noise to the original samples
noisy_sample = scheduler.add_noise(original_samples, noise, timesteps)

# Train the model to predict noise
pred_noise = denoise_model(noisy_sample, timesteps)

During generation, you can choose any scheduler. However, when using a scheduler that implements the EulerDiscreteScheduler's add_noise method, you need to be cautious:

# Initialize model input as a zero tensor, similar to target data
model_input = torch.zeros(datashape)

# Add the maximum noise to the model input
model_input = scheduler.add_noise(model_input, torch…

Replies: 1 comment

You must be logged in to vote
0 replies
Answer selected by llmydota
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant