pyriemann.utils.tangentspace.log_map_riemann

pyriemann.utils.tangentspace.log_map_riemann(X, Cref, C12=False)

Project SPD matrices in tangent space by Riemannian logarithmic map.

The projection of a SPD matrix X in the tangent space by Riemannian logarithmic map according to a 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 Riemannian logarithmic map:

\[\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
Xndarray, shape (…, n_channels, n_channels)

SPD matrices.

Crefndarray, shape (n_channels, n_channels)

The reference SPD matrix.

C12bool, default=False

If True, it returns the full Riemannian logarithmic map.

Returns
X_newndarray, shape (…, n_channels, n_channels)

SPD matrices projected in tangent space.

Notes

New in version 0.3.1.