dew.diffusion.schedules.source_grids
The schedule objects a published diffusion checkpoint’s grid is walked on.
source.py reads one scheduler file into a policy, and these are the
schedules that policy hands to Process. Each is an ordinary Dew schedule,
so a solver reads its rates, its model time and its prior the way it reads
any other.
The four are the training beta table indexed by t, a paired sigma/model-time table in variance-exploding or normalized-VP coordinates, the same table refined with the stage row a two-evaluation solver reads, and a rectified-flow table whose signal and noise sum to one.
| Name | Summary |
|---|---|
FlowGrid | A rectified-flow grid: alpha is 1 - sigma, not a normalized VP pair. |
SigmaGrid | A VE process with paired continuous sigma and model-time coordinates. |
StageSigmaGrid | A source VE grid that carries the stage rows of a two-evaluation solver. |
TabulatedVP | The training beta table as the sampling schedule, indexed by t. |
VPGrid | The same paired coordinates in normalized VP latent space. |
FlowGrid
Section titled “FlowGrid”class FlowGrid(_UniformGrid)A rectified-flow grid: alpha is 1 - sigma, not a normalized VP pair.
The source’s forward process is x_t = (1 - sigma) x_0 + sigma eps, so
signal and noise sum to one rather than their squares. Model times are
the sigmas times the training count, which is where the source’s
timesteps come from. The prior at sigma 1 is the unit Gaussian.
FlowGrid.rates
Section titled “FlowGrid.rates”def rates(t)SigmaGrid
Section titled “SigmaGrid”class SigmaGrid(sigmas: np.ndarray, model_times: np.ndarray, prior: float)A VE process with paired continuous sigma and model-time coordinates.
sigma_min and sigma_max are the prepared grid’s own positive
extremes, which is the domain a source noise sampler is built over.
StageSigmaGrid
Section titled “StageSigmaGrid”class StageSigmaGrid(sigmas: np.ndarray, model_times: np.ndarray, prior: float)A source VE grid that carries the stage rows of a two-evaluation solver.
Even coordinates are the grid points the outer walk visits. The odd one
between each pair is the source’s own interpolated evaluation, at the
sigma it places there and the model time it reads back for that sigma.
t_of_sigma resolves a sigma to a stage coordinate, the only inversion
these solvers ask of a schedule, since KDPM2’s midpoint and
DPMSolverSDE’s proposal both land on a stage row.
StageSigmaGrid.t_of_sigma
Section titled “StageSigmaGrid.t_of_sigma”def t_of_sigma(sigma)TabulatedVP
Section titled “TabulatedVP”class TabulatedVP(betas: np.ndarray, *, final_alpha_cumprod: float, stride: int | None)The training beta table as the sampling schedule, indexed by t.
stride is the fixed training transfer DDIM and PNDM step over, whatever
their evaluation grid is. None leaves the grid’s own interval, which is
what DDPM’s previous-timestep policy and the distilled schedules take. A
t below zero is the source’s “no previous alpha” end.
TabulatedVP.rates
Section titled “TabulatedVP.rates”def rates(t)TabulatedVP.model_time
Section titled “TabulatedVP.model_time”def model_time(t)TabulatedVP.step_interval
Section titled “TabulatedVP.step_interval”def step_interval(t, t_next)Published DDIM/PNDM transfer stride, independent of evaluation spacing.
TabulatedVP.half_interval
Section titled “TabulatedVP.half_interval”def half_interval(t, t_next)Published PRK uses the integer transfer stride divided by two.
VPGrid
Section titled “VPGrid”class VPGrid(_UniformGrid)The same paired coordinates in normalized VP latent space.
VPGrid.rates
Section titled “VPGrid.rates”def rates(t)