pyriemann.geometry.tangentspace.innerproduct_riemann¶
- pyriemann.geometry.tangentspace.innerproduct_riemann(X, Y, Cref)[source]¶
Affine-invariant Riemannian inner product.
Affine-invariant Riemannian 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( (\mathbf{C}_\text{ref}^{-1/2} \mathbf{X} \mathbf{C}_\text{ref}^{-1/2})^* \mathbf{C}_\text{ref}^{-1/2} \mathbf{Y} \mathbf{C}_\text{ref}^{-1/2} \right)\]- Parameters:
- Xndarray, shape (…, n, n)
First symmetric/Hermitian matrices in tangent space at Cref.
- Yndarray, 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.
- Crefndarray, shape (n, n)
Reference SPD/HPD matrix.
- Returns:
- Gfloat or ndarray, shape (…,)
Affine-invariant Riemannian inner product between X and Y.
See also
Notes
Added in version 0.11.
Changed in version 0.12: Add support for NumPy and PyTorch.
References
[1]A metric for covariance matrices W. Förstner & B. Moonen. Geodesy-the Challenge of the 3rd Millennium, 2003