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)Used by 9
- lucid.models
- lucid.models.generative.ddpm._model
- lucid.models.generative.dit._model
- lucid.models.generative.drifting._model
- lucid.models.generative.flow_matching._model
- lucid.models.generative.mean_flow._model
- lucid.models.generative.ncsn._model
- lucid.models.generative.rectified_flow._model
- lucid.models.generative.tvm._model