topo.eval.rmetric

Module Contents

Classes

RiemannMetric

RiemannMetric computes and stores the Riemannian metric and its dual

Functions

riemann_metric(Y, laplacian[, n_dim])

compute_G_from_H(H)

eigsorted(cov)

get_eccentricity(emb, laplacian[, H_emb])

topo.eval.rmetric.riemann_metric(Y, laplacian, n_dim=None)
topo.eval.rmetric.compute_G_from_H(H)
class topo.eval.rmetric.RiemannMetric(Y, L)

Bases: object

RiemannMetric computes and stores the Riemannian metric and its dual associated with an embedding Y. The Riemannian metric is currently denoted by G, its dual by H, and the Laplacian by L. G at each point is the matrix inverse of H.

In the future, this class will be extended to compute H only once, for mdimY dimensions, but to store multiple G’s, with different dimensions. In the near future plans is also a “lazy” implementation, which will compute G (and maybe even H) only at the requested points.

This implementation is from megaman, by Marina Meila (License simplified BSD), with adaptations from Davi Sidarta-Oliveira as included in TopOMetry for performance and scikit-learn compability.

Parameters:
  • Y (embedding coordinates, shape = (n, mdimY)) –

  • L (Laplacian matrix, shape = (n, n)) –

Variables:
  • mdimG (dimension of G, H) –

  • mdimY (dimension of Y) –

  • H (dual Riemann metric, shape = (n, mdimY, mdimY)) –

  • G (Riemann metric, shape = (n, mdimG, mdimG)) –

  • Hvv ((transposed) singular vectors of H, shape = (n, mdimY, mdimY)) –

  • Hsvals (singular values of H, shape = (n, mdimY)) –

  • Gsvals (singular values of G, shape = (n, mdimG)) –

  • detG (determinants of G, shape = (n,1)) –

Notes

H is always computed at full dimension self.mdimY G is computed at mdimG (some contradictions persist here)

References

“Non-linear dimensionality reduction: Riemannian metric estimation and the problem of geometric discovery”, Dominique Perraul-Joncas, Marina Meila, arXiv:1305.7255

get_dual_rmetric(invert_h=False)

Computes the dual Riemannian Metric.

get_rmetric(return_svd=False)

Compute the Riemannian Metric

get_mdimG()
get_detG()

Gets the determinant of the Riemannian metric.

fit(Y, L=None)

Fit the Riemannian Metric to a new embedding Y.

transform(Y, L=None)

Here only for scikit-learn consistency. Calls the fit() method.

topo.eval.rmetric.eigsorted(cov)
topo.eval.rmetric.get_eccentricity(emb, laplacian, H_emb=None)