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
>>> unet = DDPMUNet(cfg)
>>> out = unet(x_noisy, t)
>>> out.sample.shape == x_noisy.shape
True