bregman.barycenter package

Submodules

bregman.barycenter.base module

class bregman.barycenter.base.ApproxBarycenter(manifold: TBregmanManifold)

Bases: Barycenter[TBregmanManifold], Generic[TBregmanManifold]

Abstract class for approximate barycenter calculation on Bregman manifolds. Different from the Barycenter class as additional precision parameter eps is included. Useful for barycenters which can only be approximated.

abstract barycenter(points: list[Point], weights: list[float], eps: float = 1e-05) Point

Calculate the approximate barycenter on a list of points with associated weights.

Parameters:
  • points – Points which the barycenter is being calculated for.

  • weights – Weights for each of the points in the barycenter.

  • eps – Precision of the barycenter calculation.

Returns:

Barycenter with precision eps of points with weights.

class bregman.barycenter.base.Barycenter(manifold: TBregmanManifold)

Bases: Generic[TBregmanManifold], ABC

Abstract class for barycenter calculation on Bregman manifolds.

Parameters:

manifold – Bregman manifold which the barycenter is defined on.

abstract barycenter(points: list[Point], weights: list[float]) Point

Calculate the barycenter on a list of points with associated weights.

Parameters:
  • points – Points which the barycenter is being calculated for.

  • weights – Weights for each of the points in the barycenter.

Returns:

Barycenter of points with weights.

bregman.barycenter.bregman module

class bregman.barycenter.bregman.BregmanBarycenter(manifold: BregmanManifold, dcoords: DualCoords = DualCoords.THETA)

Bases: DualBarycenter

Bregman barycenter on a Bregman manifold.

barycenter(points: list[Point], weights: list[float]) Point

Bregman barycenter of points with weights.

\[\min_{c} \sum_{i=1}^{n} B_F(p_i : c).\]

This corresponds to taking a weighted average on points in the appropriate dual coordinates.

Parameters:
  • points – Points which the Bregman barycenter is being calculated for.

  • weights – Weights for each of the points in the Bregman barycenter.

Returns:

Bregman barycenter of points with weights.

class bregman.barycenter.bregman.DualApproxBarycenter(manifold: BregmanManifold, dcoords: DualCoords = DualCoords.THETA)

Bases: ApproxBarycenter[BregmanManifold]

Approximate barycenter based on the dual coordinates of Bregman manifolds.

Parameters:

coord – Dual coordinates for the barycenter.

class bregman.barycenter.bregman.DualBarycenter(manifold: BregmanManifold, dcoords: DualCoords = DualCoords.THETA)

Bases: Barycenter[BregmanManifold]

Barycenter based on the dual coordinates of Bregman manifolds.

Parameters:

coord – Dual coordinates for the barycenter.

class bregman.barycenter.bregman.SkewBurbeaRaoBarycenter(manifold: BregmanManifold, dcoords: DualCoords = DualCoords.THETA)

Bases: DualApproxBarycenter

Skew Burea-Rao Barycenter on Bregman manifolds.

https://arxiv.org/pdf/1004.5049

barycenter(points: list[Point], weights: list[float], eps: float = 1e-05, alphas: list[float] | None = None) Point

Calculates the skew Burea-Rao barycenter over a vector of skew parameters. This is equivalent to calculating the barycenter over a list of different (Burea-Rao-type) divergences.

The barycenter is equivalent to the minimization:

\[\min_c \left( \sum_{i=1}^n w_i \alpha_i \right) F(c) - \left( \sum_{i=1}^n w_i F(\alpha_i \cdot c + (1-\alpha_i) \cdot p_i) \right).\]

This can be approximately solved via a ConCave-Convex Procedure (CCCP). See: https://arxiv.org/pdf/1004.5049

Parameters:
  • points – Points which the skew Burbea-Rao barycenter is being calculated for.

  • weights – Weights for each of the points in the skew Burbea-Rao barycenter.

  • eps – CCCP iteration progress tolerance.

  • alphas – Burbea-Rao \(\alpha\) skew vector.

Returns:

Approximate skew Burea-Rao barycenter calculated using CCCP with eps tolerance.

Module contents