View Source Bumblebee.Diffusion.PndmScheduler (Bumblebee v0.6.0)
Pseudo numerical methods for diffusion models (PNDMs).
The sampling is based on two numerical methods for solving ODE: the Runge-Kutta method (RK) and the linear multi-step method (LMS). The gradient at each step is computed according to either of these methods, however the transfer part (approximating the next sample based on current sample and gradient) is non-linear. Because of this property, the authors of the paper refer to them as pseudo numerical methods, denoted as PRK and PLMS respectively.
Configuration
:num_train_steps
- the number of diffusion steps used to train the model. Defaults to1000
:beta_schedule
- the beta schedule type, a mapping from a beta range to a sequence of betas for stepping the model. Either of:linear
,:quadratic
, or:squared_cosine
. Defaults to:linear
:beta_start
- the start value for the beta schedule. Defaults to0.0001
:beta_end
- the end value for the beta schedule. Defaults to0.02
:prediction_type
- prediction type of the denoising model. Either of::noise
(default) - the model predicts the noise of the diffusion process:angular_velocity
- the model predicts velocity in angular parameterization. See Section 2.4 in Imagen Video: High Definition Video Generation with Diffusion Models, then Section 4 in Progressive Distillation for Fast Sampling of Diffusion Models and Appendix D
. Defaults to
:noise
:alpha_clip_strategy
- each step $t$ uses the values of $\bar{\alpha}\_t$ and $\bar{\alpha}\_{t-1}$, however for $t = 0$ there is no previous alpha. The strategy can be either:one
($\bar{\alpha}\_{t-1} = 1$) or:alpha_zero
($\bar{\alpha}\_{t-1} = \bar{\alpha}\_0$) . Defaults to:alpha_zero
:timesteps_offset
- an offset added to the inference steps. You can use a combination oftimesteps_offset: 1
andalpha_clip_strategy: :alpha_zero
, so that the last step $t = 1$ uses $\bar{\alpha}\_1$ and $\bar{\alpha}\_0$, as done in stable diffusion . Defaults to0
:reduce_warmup
- whentrue
, the first few samples are computed using lower-order linear multi-step, rather than the Runge-Kutta method. This results in less forward passes of the model . Defaults tofalse