pyriemann.geometry.tangentspace.innerproduct_logeuclid

pyriemann.geometry.tangentspace.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:
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 (…,)

Log-Euclidean inner product between X and Y.

See also

innerproduct

Notes

Added in version 0.11.

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

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