spd_learn.functional.distance_poweuclid#

spd_learn.functional.distance_poweuclid(A, B, p, squared=False)[source]#

Power Euclidean distance between SPD/HPD matrices.

The power Euclidean distance of order \(p\) between two SPD/HPD matrices \(\mathbf{A}\) and \(\mathbf{B}\) is [1]:

\[d(\mathbf{A},\mathbf{B}) = \frac{1}{|p|} \Vert \mathbf{A}^p - \mathbf{B}^p \Vert_F\]
Parameters:
  • A (ndarray, shape (..., n, n)) – First SPD/HPD matrices.

  • B (ndarray, shape (..., n, n)) – Second SPD/HPD matrices, same dimensions as A.

  • p (float) – Exponent. For p=0, it returns pyriemann.geometry.distance.distance_logeuclid().

  • squared (bool, default=False) – Return squared distance.

Returns:

d – Power Euclidean distance between A and B.

Return type:

float or ndarray, shape (…,)

Notes

Added in version 0.7.

Changed in version 0.12: Add support for NumPy and PyTorch.

See also

distance

References