interpolants¶
interpolants
¶
Probability paths connecting noise x0 to data x1.
BaseInterpolant
¶
Bases: ABC
Base class for a probability path between noise x0 and data x1.
An interpolant defines, for each t in [0, 1], an intermediate point
x_t and its conditional target velocity u_t such that regressing
a model onto u_t (in expectation over the path) yields the marginal
velocity field of the flow-matching ODE.
Convention used throughout DeltaFlow: t = 0 corresponds to noise
(x_t = x_0) and t = 1 corresponds to data (x_t = x_1).
interpolate
abstractmethod
¶
Return (x_t, target_velocity) for the given data/time (and optional noise).
Source code in deltaflow/core/base_interpolant.py
LinearInterpolant
¶
Bases: BaseInterpolant
Straight-line (rectified-flow) probability path between noise and data.
The path linearly interpolates a noise sample \(x_0\) and a data sample \(x_1\),
whose conditional target velocity is the constant displacement
Because \(u_t\) does not depend on \(t\), the learned field regresses onto a single displacement vector per pair, which is what makes rectified-flow trajectories straight and cheap to integrate.
Coupling. This is the independent-coupling variant: if \(x_0\) is not
supplied it is drawn from a standard normal \(\mathcal{N}(0, I)\)
independently of \(x_1\). For OT-coupled linear paths see
OTInterpolant or use
OTCoupling on the training side.
References
Lipman et al., "Flow Matching for Generative Modeling" (2023), https://arxiv.org/abs/2210.02747.
OTInterpolant
¶
Bases: BaseInterpolant
Linear probability path with mini-batch optimal-transport coupling.
This reuses the straight-line path of
LinearInterpolant, but instead of
pairing noise and data independently it re-orders \(x_0\) within the batch
to approximately solve the discrete optimal-transport assignment. Given a
batch of noise \(\{x_0^{(i)}\}\) and data \(\{x_1^{(j)}\}\), it seeks a
permutation \(\pi\) minimising the total squared-\(L_2\) transport cost
then applies the linear interpolant to the matched pairs \(\bigl(x_0^{(\pi^\star(i))}, x_1^{(i)}\bigr)\). Concretely, each call
- draws (or receives) a batch of noise samples \(x_0\),
- computes \(\pi^\star\) so each noise sample is paired with the data sample that minimises the batch transport cost,
- applies
LinearInterpolanton the permuted pair.
In the large-batch limit this converges to a coupling drawn from the true OT plan and yields straighter learned trajectories that sample in fewer steps. It is the zero-entropy limit of the static Schrödinger bridge. Because the coupling is purely a re-ordering of \(x_0\), the training objective is identical to standard conditional flow matching and no other component (loss, solver, model) needs to change.
Solver. The exact assignment (Hungarian algorithm) is used when
scipy is installed, otherwise a deterministic greedy nearest-neighbour
fallback is used.
References
Tong et al., "Improving and generalizing flow-based generative models with minibatch optimal transport" (2023), https://arxiv.org/abs/2302.00482. "Flower: A Flow-Matching Solver for Inverse Problems" (2025), https://arxiv.org/abs/2509.26287.
Source code in deltaflow/interpolants/ot.py
SchrodingerBridgeInterpolant
¶
Bases: BaseInterpolant
Brownian-bridge probability path with tunable diffusivity sigma.
Conditioned on an endpoint pair \((x_0, x_1)\), the dynamic Schrödinger bridge reduces to a Brownian bridge around the straight-line mean,
whose conditional target velocity (the drift of the associated probability-flow ODE, obtained by differentiating the reparameterised path w.r.t. \(t\) at fixed \(z\)) is
As \(\sigma \to 0\) the bridge collapses onto the straight line of
LinearInterpolant. The
\((1 - 2t)/\sqrt{t(1 - t)}\) factor is unbounded as \(t \to 0, 1\) (the
conditional target is unbiased but its variance diverges at the boundary).
It is stabilised here by flooring the denominator at eps. Note this
floor is a pragmatic numerical safeguard, not the exact SF2M treatment,
which instead learns a joint score/flow parametrisation and does not clip
the drift.
Coupling. This interpolant defines only the path. It is agnostic to
how \((x_0, x_1)\) pairs are formed. Pairing endpoints with
OTCoupling (rather than drawing them
independently) pushes the discretised process toward the Schrödinger
bridge instead of an arbitrary diffusion mixture. The correspondence is
approximate: the true SB (Tong et al., 2024) couples the Brownian bridges
with the entropy-regularised OT plan \(\pi^\star_{2\sigma^2}\), whose
regularisation strength is tied to the diffusivity (\(\text{reg} =
2\sigma^2\)), whereas OTCoupling solves the unregularised
squared-\(L_2\) OT problem. Exact OT therefore corresponds to the
small-\(\sigma\) limit of the true bridge. For larger \(\sigma\) this is a
rectified-flow-style approximation rather than the exact entropic
Schrödinger bridge.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sigma
|
float
|
bridge diffusivity. \(\sigma = 0\) recovers the deterministic
straight-line path (equivalent to |
1.0
|
eps
|
float
|
numerical floor on the \(\sqrt{t(1-t)}\) denominator used when computing the target velocity, to keep it finite as \(t\) approaches 0 or 1. |
0.0001
|
References
De Bortoli et al., "Diffusion Schrödinger Bridge with Applications to Score-Based Generative Modeling" (2021), https://arxiv.org/abs/2106.01357. Tong et al., "Simulation-Free Schrödinger Bridges via Score and Flow Matching" (SF2M, 2024), https://arxiv.org/abs/2307.03672.
Source code in deltaflow/interpolants/schrodinger_bridge.py
VariancePreservingInterpolant
¶
Bases: BaseInterpolant
Trigonometric variance-preserving (VP) probability path.
Noise \(x_0\) and data \(x_1\) are mixed with a trigonometric schedule
so that \(\alpha_t^2 + \sigma_t^2 = 1\) for every \(t\), the marginal variance is preserved along the path (hence variance-preserving), matching the geometry of a VP diffusion. Differentiating the path at fixed endpoints gives the conditional target velocity
References
Lipman et al., "Flow Matching for Generative Modeling" (2023), Sec. 3.2, https://arxiv.org/abs/2210.02747. Ma et al., "SiT: Exploring Flow and Diffusion-Based Generative Models" (2024), https://arxiv.org/abs/2401.08740.