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 matrices.
Given masks defined as semi-orthogonal matrices, the masked Riemannian mean of SPD matrices is obtained with a gradient descent minimizing the sum of affine-invariant Riemannian distances between masked SPD matrices and the masked mean [1].
- Parameters
- covmatsndarray, shape (n_matrices, n_channels, n_channels)
Set of SPD matrices.
- maskslist of n_matrices ndarray of shape (n_channels, n_channels_i), with different n_channels_i, such that n_channels_i <= n_channels
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_channels, n_channels), default=None
A SPD 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_channels, n_channels)
Masked Riemannian mean.
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.