data
DiffusionModelOutput
extends
ModelOutputDiffusionModelOutput(sample: Tensor, loss: Tensor | None = None)Single-step output of a diffusion U-Net's forward pass.
Attributes
sampleTensorNetwork prediction at the supplied timestep. The semantic
interpretation depends on the parameterisation declared in
DiffusionModelConfig.prediction_type:
"epsilon"— predicted noise ."sample"— predicted clean signal ."v"— predicted velocity .
loss(Tensor or None, optional)Scalar training loss against ground-truth noise (MSE for the
"epsilon" parameterisation).Notes
Returned by _DDPMUNet.forward and other diffusion noise predictors.
The sampling loop in DiffusionMixin reads sample and
passes it to the scheduler's step method.
Examples
>>> import lucid
>>> from lucid.models import DiffusionModelOutput
>>> out = DiffusionModelOutput(sample=lucid.zeros(1, 3, 32, 32))
>>> out.sample.shape
(1, 3, 32, 32)