The two-time velocity network .
Parameters
configTVMConfigThe variant to build.
Attributes
patch_ embedlucid.nn.Conv2dPatchifying projection — stride equals kernel.
pos_ embedTensorFrozen two-dimensional sine-cosine table, added to the tokens.
time_ embed, interval_ embed, guidance_ embed_ScalarEmbedderEmbeddings of , and .
label_ embedlucid.nn.EmbeddingClass embedding, with the null label as its last row.
blockslucid.nn.ModuleListThe semi-Lipschitz DiT blocks.
final_FinalLayerModulated norm and projection back to patch space.
Notes
Reference: Zhou, Parger, Haque, and Song, "Terminal Velocity Matching", ICLR 2026 (arXiv:2511.19797), Sections 3–4 and Appendix F.1.
The forward returns the average velocity over — the displacement divided by its length — so that one step of the sampler is . Under the scaled parameterisation that is , the network's output times the guidance weight; otherwise it is itself. At it is the instantaneous velocity .
Examples
>>> import lucid
>>> from lucid.models.generative.tvm import TVMConfig, TVMModel
>>> config = TVMConfig(sample_size=8, patch_size=2, hidden_size=32,
... depth=2, num_heads=4, num_classes=10)
>>> model = TVMModel(config).eval()
>>> x = lucid.randn((1, 4, 8, 8))
>>> t, s = lucid.tensor([1.0]), lucid.tensor([0.0])
>>> model(x, t, s, lucid.tensor([3])).sample.shape
(1, 4, 8, 8)Used by 2
Constructors
1Instance methods
2forward(x: Tensor, t: Tensor, s: Tensor, labels: Tensor | None = None, guidance_scale: Tensor | float | None = None)Evaluate the average velocity from time t to time s.
Parameters
(B, in_channels, H, W) — the point on the path at t.(B,) start times.(B,) end times, s <= t. s = t gives the
instantaneous velocity.(B,) class indices. None uses the null label, index
num_classes.The guidance weight , per sample or shared. The
network is conditioned on .
None resolves as
resolve_guidance describes.Returns
DiffusionModelOutputsample of shape (B, out_channels, H, W) — the
average velocity, under the scaled
parameterisation and otherwise.
resolve_guidance(guidance_scale: Tensor | float | None, labels: Tensor | None)The guidance weight a call runs at.
Parameters
Returns
float or Tensorguidance_scale, or the default it resolves to.