pyriemann.geometry.geodesic.geodesic_euclid

pyriemann.geometry.geodesic.geodesic_euclid(A, B, alpha=0.5)[source]

Euclidean geodesic between matrices.

The matrix at position \(\alpha\) on the Euclidean geodesic between two matrices \(\mathbf{A}\) and \(\mathbf{B}\) is:

\[\mathbf{C} = (1-\alpha) \mathbf{A} + \alpha \mathbf{B}\]

\(\mathbf{C}\) is equal to \(\mathbf{A}\) if \(\alpha\) = 0, and \(\mathbf{B}\) if \(\alpha\) = 1.

Parameters:
Andarray, shape (…, n, m)

First matrices.

Bndarray, shape (…, n, m)

Second matrices.

alphafloat | ndarray, shape (…,), default=0.5

Position on the geodesic. If ndarray, one value per matrix pair.

Changed in version 0.12.

Returns:
Cndarray, shape (…, n, m)

Matrices on the Euclidean geodesic.

See also

geodesic

Notes

Changed in version 0.12: Add support for NumPy and PyTorch. Add support for array-valued alpha.