Skip to content
data

TVMOutput

extendsModelOutput
TVMOutput(loss: Tensor, terminal_loss: Tensor, flow_matching_loss: Tensor)

What a TVM training step reports.

Attributes

lossTensor
The objective of Eq. 15, a scalar — the two terms below, summed per sample and averaged over the batch.
terminal_lossTensor
The batch mean of the terminal-velocity term, ∥ddsfθ−uθ∗(x^s,s)∥2/w2\lVert \frac{d}{ds} f_\theta - u_{\theta^*}(\hat x_s, s)\rVert^2 / w^2. Zero for samples drawn with s=ts = t.
flow_matching_lossTensor
The batch mean of the guided Flow Matching term. Reported apart because the two move differently: Flow Matching settles early while the terminal term keeps falling, and a terminal term that stalls while Flow Matching is fine is the first sign of a bad target EMA.

Examples

>>> import lucid
>>> from lucid.models.generative.tvm._model import TVMOutput
>>> out = TVMOutput(
...     loss=lucid.zeros(()),
...     terminal_loss=lucid.zeros(()),
...     flow_matching_loss=lucid.zeros(()),
... )
>>> out.loss.shape
()

Used by 1