spd_learn.functional.mean_euclid#

spd_learn.functional.mean_euclid(X, sample_weight=None, **kwargs)[source]#

Mean of matrices according to the Euclidean metric.

Euclidean mean is also called arithmetic:

\[\mathbf{M} = \sum_i w_i \ \mathbf{X}_i\]

with \(w\) being the weights which sum to 1.

Parameters:
  • X (ndarray, shape (..., n_matrices, n, m)) – Set of matrices.

  • sample_weight (None | ndarray, shape (n_matrices,), default=None) – Weights for each matrix. If None, it uses equal weights.

Returns:

M – Euclidean mean.

Return type:

ndarray, shape (…, n, m)

Notes

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

See also

gmean