spd_learn.functional.mean_thompson#
- spd_learn.functional.mean_thompson(X, *, tol=1e-06, maxiter=50, init=None, sample_weight=None)[source]#
Mean of SPD/HPD matrices according to the Thompson metric.
The Thompson mean of SPD/HPD matrices is described in [1].
- Parameters:
X (ndarray, shape (..., n_matrices, n, n)) – Set of SPD/HPD matrices.
tol (float, default=1e-6) – Tolerance to stop the gradient descent.
maxiter (int, default=50) – Maximum number of iterations.
init (None | ndarray, shape (n, n), default=None) – A SPD/HPD matrix used to initialize the gradient descent. If None, the weighted Euclidean mean is used.
sample_weight (None) – Not used.
- Returns:
M – Thompson mean.
- Return type:
ndarray, shape (…, n, n)
Notes
Added in version 0.10.
Changed in version 0.12: Add support for NumPy and PyTorch.
See also
References
[1]Differential geometry with extreme eigenvalues in the positive semidefinite cone C. Mostajeran, N. Da Costa, G. Van Goffrier and R. Sepulchre. SIAM Journal on Matrix Analysis and Applications, 2024