ott.solvers.linear.discrete_barycenter.discrete_barycenter
ott.solvers.linear.discrete_barycenter.discrete_barycenter#
- ott.solvers.linear.discrete_barycenter.discrete_barycenter(geom, a, weights=None, dual_initialization=None, threshold=0.01, norm_error=1, inner_iterations=10, min_iterations=0, max_iterations=2000, lse_mode=True, debiased=False)[source]#
Compute discrete barycenter [Janati et al., 2020].
- Parameters
geom (
Geometry) – geometry object.a (
Array) – batch of histograms of shape[batch, num_a].weights (
Optional[Array]) – positive weights in the probability simplex.dual_initialization (
Optional[Array]) – array of shape[batch, num_b]for the initialization of g_v.threshold (
float) – tolerance to monitor convergence.norm_error (
int) – power used to define p-norm of error for marginal/target.inner_iterations (
float) – the Sinkhorn error is not recomputed at each iteration but every inner_num_iter instead to avoid computational overhead.min_iterations (
int) – the minimum number of Sinkhorn iterations carried out before the error is computed and monitored.max_iterations (
int) – the maximum number of Sinkhorn iterations.lse_mode (
bool) – True for log-sum-exp computations, False for kernel multiply.debiased (
bool) – whether to run the debiased version of the Sinkhorn divergence.
- Return type
- Returns
A
SinkhornBarycenterOutput, which contains two arrays of potentials, each of sizebatchtimesgeom.num_a, summarizing the OT between each histogram in the database onto the barycenter, described inhistogram, as well as a sequence of errors that monitors convergence.