Skip to content
data

ScoreSDEOutput

extendsModelOutput
ScoreSDEOutput(score: Tensor, noise: Tensor, target: Tensor, std: Tensor, loss: Tensor | None = None)

What the model returns for a batch.

Attributes

scoreTensor
∇xlog⁡pt(x)\nabla_x \log p_t(x) at the perturbed sample, same shape as the input.
noiseTensor
What the network predicted, before it was divided by the standard deviation.
targetTensor
The noise actually added by the perturbation kernel. Returned because the objective is the error against it and recomputing it would mean redrawing.
The perturbation kernel's scale at the sampled times, (N,).
lossTensor or None
The denoising score-matching objective, set only by ScoreSDEForImageGeneration.

Examples

>>> import lucid
>>> from lucid.models import score_sde_vp
>>> model = score_sde_vp(sample_size=8, base_channels=8,
...     channel_mult=(1,), num_res_blocks=1, resnet_groups=4,
...     attention_resolutions=()).eval()
>>> out = model(lucid.randn((1, 3, 8, 8)))
>>> out.score.shape
(1, 3, 8, 8)

Used by 1