spd_learn.functional.distance_kullback_sym#

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

Symmetrized Kullback-Leibler divergence between SPD/HPD matrices.

The symmetrized Kullback-Leibler divergence between two SPD/HPD matrices \(\mathbf{A}\) and \(\mathbf{B}\) is the sum of left and right Kullback-Leibler divergences. It is also called Jeffreys divergence [1].

Parameters:
  • A (ndarray, shape (..., n, n)) – First SPD/HPD matrices.

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

  • squared (bool, default=False) –

    Return squared distance.

    Added in version 0.5.

Returns:

d – Symmetrized Kullback-Leibler divergence between A and B.

Return type:

float or ndarray, shape (…,)

Notes

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

See also

distance

References

[1]

An invariant form for the prior probability in estimation problems H. Jeffreys. Proceedings of the Royal Society of London A: mathematical, physical and engineering sciences, 1946, 186 (1007), pp. 453-461