Read the equation
Exponentiating −Cᵢⱼ/ε turns each transport cost into a positive kernel weight, with smaller costs receiving larger weights. The following alternating row and column scalings seek the supplied marginals. The function finally returns transport cost for the resulting plan; it does not add the entropy term to the reported objective, and finite iterations need a marginal-residual check.
Terms & definitions
| Term | Meaning in this source |
|---|---|
| K | Gibbs kernel |
| C | Pairwise transport costs |
| epsilon | Positive entropy-regularization scale |
How it works
Read the definition from its right-hand expression to the quantity on the left. Its surrounding source records the intended input, state, or parameter context. Where the source leaves an operation unspecified, this page preserves that gap.
Assumptions & limits
Source recovery establishes that the expression appears in this record. Its mathematical validity, implementation behavior, and interpretation must be assessed separately. See the linked source and research notes for the checks available for this version.
Original context
Read the surrounding source passage
n := len(p)
m := len(q)
if n == 0 || m == 0 {
return 0.0
}
// Initialize kernel K = exp(-C/ε)
K := make([][]float64, n)
for i := range K {
K[i] = make([]float64, m)
for j := range K[i] {
K[i][j] = math.Exp(-c[i][j] / epsilon)
}
}
// Initialize scaling vectors
u := make([]float64, n)Exact original notation
Initialize kernel K = exp(-C/ε)