spd_learn.functional.norm#
- spd_learn.functional.norm(X, Cref, metric='riemann')[source]#
Norm according to a specified metric.
It calculates the norm of the matrix \(\mathbf{X}\) in the tangent space at \(\mathbf{C}_\text{ref}\), according to a specified metric.
- Parameters:
X (ndarray, shape (..., n, n)) – Matrices in the tangent space at Cref.
Cref (ndarray, shape (n, n) | None) – Reference matrix.
metric (string | callable, default="riemann") – Metric used for norm, can be: “euclid”, “logeuclid”, “riemann”, or a callable function.
- Returns:
N – Norm of X.
- Return type:
float or ndarray, shape (…,)
Notes
Added in version 0.11.
Changed in version 0.12: Add support for NumPy and PyTorch.
See also