spd_learn.functional.upper#
- spd_learn.functional.upper(X)[source]#
Return the weighted upper triangular part of matrices.
This function computes the minimal representation of a matrix in tangent space [1]: it keeps the upper triangular part of the symmetric/Hermitian matrix and vectorizes it by applying unity weight for diagonal elements and \(\sqrt{2}\) weight for out-of-diagonal elements.
- Parameters:
X (ndarray, shape (..., n, n)) – Symmetric/Hermitian matrices.
- Returns:
T – Weighted upper triangular parts of symmetric/Hermitian matrices.
- Return type:
ndarray, shape (…, n * (n + 1) / 2)
Notes
Added in version 0.4.
Changed in version 0.12: Add support for NumPy and PyTorch.
References
[1]Pedestrian detection via classification on Riemannian manifolds O. Tuzel, F. Porikli, and P. Meer. IEEE Transactions on Pattern Analysis and Machine Intelligence, Volume 30, Issue 10, October 2008.