spd_learn.functional.nanmean_riemann#
- spd_learn.functional.nanmean_riemann(X, tol=1e-08, maxiter=100, init=None, sample_weight=None)[source]#
Riemannian NaN-mean of SPD/HPD matrices.
The Riemannian NaN-mean is the masked Riemannian mean applied to SPD/HPD matrices potentially corrupted by symmetric NaN values [1].
- Parameters:
X (ndarray, shape (..., n_matrices, n, n)) – Set of SPD/HPD matrices, corrupted by symmetric NaN values [1].
tol (float, default=10e-9) – Tolerance to stop the gradient descent.
maxiter (int, default=100) – Maximum number of iterations.
init (None | ndarray, shape (n, n), default=None) – A SPD/HPD matrix used to initialize the gradient descent. If None, a regularized Euclidean NaN-mean is used.
sample_weight (None | ndarray, shape (n_matrices,), default=None) – Weights for each matrix. If None, it uses equal weights.
- Returns:
M – Riemannian NaN-mean.
- Return type:
ndarray, shape (…, n, n)
Notes
Added in version 0.3.
Changed in version 0.12: Add support for NumPy and PyTorch.
See also
References
[1] (1,2)Geodesically-convex optimization for averaging partially observed covariance matrices F. Yger, S. Chevallier, Q. Barthélemy, and S. Sra. Asian Conference on Machine Learning (ACML), Nov 2020, Bangkok, Thailand. pp.417 - 432.