spd_learn.functional.exp_map_riemann#

spd_learn.functional.exp_map_riemann(X, Cref, *, Cm12=False)[source]#

Project matrices back to manifold by Riemannian exponential map.

The projection of a matrix \(\mathbf{X}\) from tangent space to SPD/HPD manifold with affine-invariant Riemannian exponential map according to a reference SPD/HPD matrix \(\mathbf{C}_\text{ref}\) is:

\[\mathbf{X}_\text{original} = \mathbf{C}_\text{ref}^{1/2} \exp(\mathbf{X}) \mathbf{C}_\text{ref}^{1/2}\]

When Cm12=True, it returns the full affine-invariant Riemannian exponential map as in Section 3.4 of [1]:

\[\mathbf{X}_\text{original} = \mathbf{C}_\text{ref}^{1/2} \exp( \mathbf{C}_\text{ref}^{-1/2} \mathbf{X} \mathbf{C}_\text{ref}^{-1/2}) \mathbf{C}_\text{ref}^{1/2}\]
Parameters:
  • X (ndarray, shape (..., n, n)) – Matrices in tangent space.

  • Cref (ndarray, shape (n, n)) – Reference SPD/HPD matrix.

  • Cm12 (bool, default=False) – If True, it returns the full Riemannian exponential map.

Returns:

X_original – Matrices in SPD/HPD manifold.

Return type:

ndarray, shape (…, n, n)

Notes

Added in version 0.4.

Changed in version 0.12: Add support for NumPy and PyTorch.

References

[1]

A Riemannian Framework for Tensor Computing X. Pennec, P. Fillard, N. Ayache. IJCV, 2006, 66(1), pp. 41-66.