spd_learn.functional.innerproduct_logeuclid#
- spd_learn.functional.innerproduct_logeuclid(X, Y, Cref)[source]#
Log-Euclidean inner product.
Log-Euclidean inner product \(\mathbf{g}\) between symmetric/Hermitian matrices in tangent space \(\mathbf{X}\) and \(\mathbf{Y}\) at \(\mathbf{C}_\text{ref}\) is [1]:
\[\mathbf{g}_{\mathbf{C}_\text{ref}}(\mathbf{X}, \mathbf{Y}) = \text{tr} \left( [D_{\mathbf{C}_\text{ref}} \log](X)^* [D_{\mathbf{C}_\text{ref}} \log](Y) \right)\]- Parameters:
X (ndarray, shape (..., n, n)) – First symmetric/Hermitian matrices in tangent space at Cref.
Y (ndarray, shape (..., n, n) | None) – Second symmetric/Hermitian matrices in tangent space at Cref. If None, Y is set to X, giving the squared norm of X.
Cref (ndarray, shape (n, n)) – Reference SPD/HPD matrix.
- Returns:
G – Log-Euclidean inner product between X and Y.
- Return type:
float or ndarray, shape (…,)
Notes
Added in version 0.11.
Changed in version 0.12: Add support for NumPy and PyTorch.
See also
References
[1]Geometric means in a novel vector space structure on symmetric positive-definite matrices V. Arsigny, P. Fillard, X. Pennec, N. Ayache. SIAM J Matrix Anal Appl, 2007, 29 (1), pp. 328-347