In optimal transport (OT):
ccc = cost function (also called ground cost or transport cost).
It measures how expensive it is to move one unit of mass from location xxx in the source distribution to location yyy in the target distribution.
Typical choice:
c(x,y)=∥x−y∥2orc(x,y)=∥x−y∥c(x,y)=|x-y|^2 \quad \text{or} \quad c(x,y)=|x-y|c(x,y)=∥x−y∥2orc(x,y)=∥x−y∥
TTT (or γ\gammaγ) = transport plan / coupling.
It tells how much mass to move from each point in one distribution to each point in the other.
It is a joint distribution over xxx and yyy whose marginals are the two distributions you're transporting between.
Formally, if μ\muμ and ν\nuν are your two distributions:
minT∫c(x,y) T(x,y) dx dys.t.marginals of T are μ and ν\min_{T} \int c(x,y), T(x,y), dx,dy
\quad \text{s.t.} \quad
\text{marginals of }T\text{ are } \mu \text{ and } \nuTmin∫c(x,y)T(x,y)dxdys.t.marginals of T are μ and ν
How are TTT and ccc obtained in practice?
Given two distributions (e.g., two empirical datasets), you:
- Define the cost function ccc
You choose it based on geometry or problem meaning.
Common choices:
Euclidean distance squared: ∥x−y∥2|x-y|^2∥x−y∥2
Euclidean distance: ∥x−y∥|x-y|∥x−y∥
Cosine distance for embeddings
Application-specific cost (e.g., energy, time, semantic difference)
This is not learned: it is assumed / designed unless the paper does “learned OT”.
- Compute the transport plan TTT
Once you have ccc, you solve an OT problem to get TTT.
Typical solvers:
Sinkhorn algorithm (entropic regularization)
Linear assignment / Hungarian algorithm (if discrete & one-to-one)
POT (Python Optimal Transport), GeomLoss, or custom code in deep learning frameworks
Input:
samples {xi}{x_i}{xi} from distribution 1
samples {yj}{y_j}{yj} from distribution 2
Compute cost matrix:
Cij=c(xi,yj)C_{ij} = c(x_i, y_j)Cij=c(xi,yj)
Output:
transport matrix TijT_{ij}Tij, telling how much mass flows xi→yjx_i \to y_jxi→yj
In the ULD paper
The paper you linked builds a learning method on top of OT. They do not “extract” TTT and ccc from data directly:
✅ They define ccc (ground cost is known, usually Euclidean or energy-based)
✅ They compute TTT via an OT solver for the two distributions they compare
The distributions are usually:
empirical distributions of samples from two domains / modalities
latent distributions from neural encoders
geometry distributions on manifolds
Summary
SymbolMeaningHow obtainedccccost functionchosen by modeler (e.g. distance)TTToptimal transport plancomputed numerically using OT solver
Intuition
Think of replanning cities' goods shipments:
ccc: cost to ship goods between cities
TTT: plan telling how many trucks go from each city to each city
You pick the cost model → OT solves for the cheapest shipping strategy.
If you want, tell me your use case and I’ll show how to compute TTT in code (POT / PyTorch).