TorchLean API

NN.API.Models.Diffusion.Sampling

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 TTensor Float shapeIO (Tensor Float shape)) (alphaBars : Tensor Float [T]) (start : Fin T) (initial : Tensor Float shape) :
IO (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.

Instances For
    def TorchLean.diffusion.reverseDdim {shape : Shape} {T : } (predict : Fin TTensor Float shapeIO (Tensor Float shape)) (alphaBars : Tensor Float [T]) (initial : Tensor Float shape) :
    IO (Tensor Float shape)

    Reverse the entire schedule; an empty schedule leaves the input tensor unchanged.

    Instances For