DDIM Sampling #
Reverse a finite diffusion schedule with a caller-provided epsilon predictor. The predictor receives both the schedule index and current tensor, so image time channels and other conditioning remain independent of the sampling algorithm.
def
TorchLean.diffusion.reverseDdimFrom
{shape : Shape}
{T : ℕ}
(predict : Fin T → Tensor Float shape → IO (Tensor Float shape))
(alphaBars : Tensor Float [T])
(start : Fin T)
(initial : Tensor Float shape)
:
Run deterministic DDIM updates from start down through timestep zero.
The schedule coefficients must describe the same forward process used to train predict.
The endpoint convention is cumulative alpha one before the first timestep.