pyriemann.utils.mean.maskedmean_riemann¶
- pyriemann.utils.mean.maskedmean_riemann(covmats, masks, tol=1e-08, maxiter=100, init=None, sample_weight=None)¶
Masked Riemannian mean of SPD/HPD matrices.
Given masks defined as semi-orthogonal matrices, the masked Riemannian mean of SPD/HPD matrices is obtained with a gradient descent minimizing the sum of affine-invariant Riemannian distances between masked SPD/HPD matrices and the masked mean [1].
- Parameters:
- covmatsndarray, shape (n_matrices, n, n)
Set of SPD/HPD matrices.
- maskslist of n_matrices ndarray of shape (n, n_i), with different n_i, such that n_i <= n
Masks, defined as semi-orthogonal matrices. See [1].
- tolfloat, default=10e-9
The tolerance to stop the gradient descent.
- maxiterint, default=100
The maximum number of iteration.
- initNone | ndarray, shape (n, n), default=None
A SPD/HPD matrix used to initialize the gradient descent. If None, the Identity is used.
- sample_weightNone | ndarray, shape (n_matrices,), default=None
Weights for each matrix. If None, it uses equal weights.
- Returns:
- Cndarray, shape (n, n)
Masked Riemannian mean.
See also
Notes
New in version 0.3.
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.