ott.geometry.costs.EuclideanP.h_transform

ott.geometry.costs.EuclideanP.h_transform#

EuclideanP.h_transform(f, ridge=1e-08, solver=None)#

Compute the h-transform of a concave function.

Return a callable \(f_h\) defined as:

\[f_h(x) = \min_y h(x - y) - f(y)\]

This is equivalent, up to a change of variables, \(z = x - y\), to define

\[\begin{split}\min_z h(z) - f(x - z). \\ \min_z h(z) + \tilde{f}(z, x).\end{split}\]

where \(\tilde{f}(z, x) := -f(x - z)\).

Parameters:
Return type:

Callable[[Array, Optional[Array], Any], float]

Returns:

The h-transform \(f_h\) of \(f\).