spd_learn.functional.log_map_riemann#
- spd_learn.functional.log_map_riemann(X, Cref, *, C12=False)[source]#
Project matrices in tangent space by Riemannian logarithmic map.
The projection of a matrix \(\mathbf{X}\) from SPD/HPD manifold to tangent space by affine-invariant Riemannian logarithmic map according to a SPD/HPD reference matrix \(\mathbf{C}_\text{ref}\) is:
\[\mathbf{X}_\text{new} = \log ( \mathbf{C}_\text{ref}^{-1/2} \mathbf{X} \mathbf{C}_\text{ref}^{-1/2})\]When C12=True, it returns the full affine-invariant Riemannian logarithmic map as in Section 3.4 of [1]:
\[\mathbf{X}_\text{new} = \mathbf{C}_\text{ref}^{1/2} \log( \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 SPD/HPD manifold.
Cref (ndarray, shape (n, n)) – Reference SPD/HPD matrix.
C12 (bool, default=False) – If True, it returns the full Riemannian logarithmic map.
- Returns:
X_new – Matrices projected in tangent space.
- 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.