add scaled_linear schedule in DDIM

This commit is contained in:
patil-suraj 2022-06-29 15:12:58 +02:00
parent eceeb97242
commit 65788e46ed
1 changed files with 3 additions and 0 deletions

View File

@ -71,6 +71,9 @@ class DDIMScheduler(SchedulerMixin, ConfigMixin):
if beta_schedule == "linear":
self.betas = np.linspace(beta_start, beta_end, timesteps, dtype=np.float32)
elif beta_schedule == "scaled_linear":
# this schedule is very specific to the latent diffusion model.
self.betas = np.linspace(beta_start**0.5, beta_end**0.5, timesteps, dtype=np.float32) ** 2
elif beta_schedule == "squaredcos_cap_v2":
# Glide cosine schedule
self.betas = betas_for_alpha_bar(timesteps)