ott.math.legendre

Contents

ott.math.legendre#

ott.math.legendre(fun, **kwargs)[source]#

Legendre (Fenchel) transform of a function.

The solution is computed numerically using L-BFGS.

Parameters:
  • fun (Callable[[Array], Array]) – A function to be transformed, must be convex for the transform to be properly defined.

  • kwargs (Any) – Keyword arguments for lbfgs(), e.g. maximal iterations max_iters, convergence tolerance tol or optax.lbfgs() arguments.

Return type:

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

Returns:

A function that computes numerically the Legendre transform of the fun at a given point.