pyriemann.geometry.tangentspace.innerproduct

pyriemann.geometry.tangentspace.innerproduct(X, Y, Cref, metric='riemann')[source]

Inner product according to a specified metric.

It calculates the inner product between matrices in the tangent space \(\mathbf{X}\) and \(\mathbf{Y}\) at \(\mathbf{C}_\text{ref}\), according to a specified metric.

Parameters:
Xndarray, shape (…, n, n)

First matrices in tangent space at Cref.

Yndarray, shape (…, n, n) | None

Second matrices in tangent space at Cref. If None, Y is set to X, giving the squared norm of X.

Crefndarray, shape (n, n) | None

Reference matrix.

metricstring | callable, default=”riemann”

Metric used for inner product, can be: “euclid”, “logeuclid”, “riemann”, or a callable function.

Returns:
Gfloat or ndarray, shape (…,)

Inner product between X and Y.

Notes

Added in version 0.11.

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