PNDMScheduler<T>
Models & Types · AiDotNet.Diffusion.Schedulers
PNDM (Pseudo Numerical Methods for Diffusion Models) scheduler implementation.
Inheritance: NoiseSchedulerBase<T> → PNDMScheduler<T>
For Beginners
PNDM is an advanced method for fast image generation.
Think of diffusion like walking down a mountain (from noise to clean image):
- DDPM: Take 1000 tiny careful steps
- DDIM: Take 50 medium steps
- PNDM: Take 20 smart steps using “momentum” from previous steps
The key insight is that PNDM remembers its previous predictions and uses them to make better guesses about where to step next. It’s like a ball rolling down a hill - it uses its momentum to move faster.
Advantages:
- Very fast generation (often 20-25 steps for good quality)
- Uses multi-step methods from numerical analysis
- Good balance of speed and quality
The scheduler operates in two phases:
- Prk (Pseudo Runge-Kutta) for initial steps
- Plms (Pseudo Linear Multi-Step) for remaining steps
How It Works
PNDM uses pseudo numerical methods to accelerate diffusion sampling. It can achieve high-quality results with even fewer steps than DDIM by using a combination of linear multi-step methods and improved transfer techniques.
Reference: “Pseudo Numerical Methods for Diffusion Models on Manifolds” by Liu et al., 2022
Constructors
| Constructor | Summary |
|---|---|
PNDMScheduler(SchedulerConfig<T> config) |
Initializes a new instance of the PNDM scheduler. |
Methods
| Method | Summary |
|---|---|
Dictionary<string, object> GetState() |
|
Vector<T> Step(Vector<T> modelOutput, int timestep, Vector<T> sample, T eta, Vector<T> noise) |
Performs one PNDM denoising step. |
void LoadState(Dictionary<string, object> state) |
|
void SetTimesteps(int inferenceSteps) |
Sets up the inference timesteps and resets the scheduler state. |