priorschedule
Prior schedule functions for DDPM diffusion models.
This module defines a base abstract class for prior schedules and two common concrete implementations:
- LinearPriorSchedule: \(\alpha(t) = t\)
- QuadraticPriorSchedule: \(\alpha(t) = t^2\)
Classes:
-
PriorSchedule
–Abstract base for defining \(\alpha(t)\) schedules.
-
LinearPriorSchedule
–Simple linear schedule.
-
QuadraticPriorSchedule
–Simple quadratic schedule.
Notes
It is assumed that the time steps t
are normalized to the range [0, 1].
PriorSchedule
¶
Bases: ABC
Abstract base class for prior schedules in DDPM models.
A prior schedule defines the mixing coefficient \(\alpha(t)\) that controls how the model incorporates the prior distribution over time steps in a diffusion process.
Methods:
-
alpha
–Compute the schedule coefficient \(\alpha\) at time \(t\).
alpha(t)
abstractmethod
¶
Compute the schedule coefficient \(\alpha\) at time \(t\).
Parameters:
-
t
((array_like, shape(dim1))
) –Time steps \(t\in[0, 1]\).
Returns:
-
alpha_t
((array_like, shape(dim1))
) –Mixing coefficients corresponding to each time in \(t\).
Source code in src/fpsl/ddm/priorschedule.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
|
LinearPriorSchedule
¶
Bases: PriorSchedule
Linearly increasing prior schedule.
\(\alpha(t) = t\)
Methods:
-
alpha
–Compute the schedule coefficient \(\alpha\) at time \(t\).
alpha(t)
¶
Linear schedule function.
Parameters:
-
t
((array_like, shape(dim1))
) –Time steps \(t\in[0, 1]\).
Returns:
-
alpha_t
((array_like, shape(dim1))
) –Equal to the input t.
Source code in src/fpsl/ddm/priorschedule.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
|
QuadraticPriorSchedule
¶
Bases: PriorSchedule
Quadratically increasing prior schedule \(\alpha(t) = t^2\).
Methods:
-
alpha
–Compute the schedule coefficient \(\alpha\) at time \(t\).
alpha(t)
¶
Quadratic schedule function.
Parameters:
-
t
((array_like, shape(dim1))
) –Time steps \(t\in[0, 1]\).
Returns:
-
alpha_t
((array_like, shape(dim1))
) –Squares of the input t.
Source code in src/fpsl/ddm/priorschedule.py
127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
|