pyriemann.utils.kernel.kernel_logeuclid¶
- pyriemann.utils.kernel.kernel_logeuclid(X, Y=None, *, reg=1e-10, **kwargs)¶
Log-Euclidean kernel between two sets of SPD matrices.
Calculates the Log-Euclidean kernel matrix \(\mathbf{K}\) of inner products of two sets \(\mathbf{X}\) and \(\mathbf{Y}\) of SPD matrices in \(\mathbb{R}^{n \times n}\) by calculating pairwise products [1]:
\[\mathbf{K}_{i,j} = \text{tr}(\log(\mathbf{X}_i) \log(\mathbf{Y}_j))\]- Parameters:
- Xndarray, shape (n_matrices_X, n, n)
First set of SPD matrices.
- YNone | ndarray, shape (n_matrices_Y, n, n), default=None
Second set of SPD matrices. If None, Y is set to X.
- regfloat, default=1e-10
Regularization parameter to mitigate numerical errors in kernel matrix estimation.
- Returns:
- Kndarray, shape (n_matrices_X, n_matrices_Y)
The Log-Euclidean kernel matrix between X and Y.
See also
Notes
New in version 0.3.
References
[1]Classification of covariance matrices using a Riemannian-based kernel for BCI applications A. Barachant, S. Bonnet, M. Congedo and C. Jutten. Neurocomputing, Elsevier, 2013, 112, pp.172-178.