# ott.tools.sinkhorn_divergence.sinkhorn_divergence#

ott.tools.sinkhorn_divergence.sinkhorn_divergence(geom, *args, a=None, b=None, sinkhorn_kwargs=mappingproxy({}), static_b=False, share_epsilon=True, symmetric_sinkhorn=True, **kwargs)[source]#

Compute Sinkhorn divergence defined by a geometry, weights, parameters.

Parameters
• geom (`Type`[`Geometry`]) – Type of the geometry.

• args (`Any`) – Positional arguments to `prepare_divergences()` that are specific to each geometry.

• a (`Optional`[`Array`]) – the weight of each input point. The sum of all elements of a must match that of b to converge.

• b (`Optional`[`Array`]) – the weight of each target point. The sum of all elements of b must match that of a to converge.

• sinkhorn_kwargs (`Mapping`[`str`, `Any`]) – keywords arguments for `sinkhorn()` that is called twice if `static_b = True` else 3 times.

• static_b (`bool`) – if True, divergence of measure b against itself is not computed.

• share_epsilon (`bool`) – if True, enforces that the same epsilon regularizer is shared for all 2 or 3 terms of the Sinkhorn divergence. In that case, the epsilon will be by default that used when comparing x to y (contained in the first geometry). This flag is set to True by default, because in the default setting, the epsilon regularization is a function of the mean of the cost matrix.

• symmetric_sinkhorn (`bool`) – Use Sinkhorn updates in Eq. 25 of for symmetric terms comparing x/x and y/y.

• kwargs (`Any`) – keywords arguments to the generic class. This is specific to each geometry.

Return type

`SinkhornDivergenceOutput`

Returns

Sinkhorn divergence value, three pairs of potentials, three costs.