spd_learn.functional.ajd_pham#

spd_learn.functional.ajd_pham(X, *, init=None, eps=1e-06, n_iter_max=20, sample_weight=None)[source]#

Approximate joint diagonalization based on Pham’s algorithm.

This is a direct implementation of the AJD algorithm [1], optimizing a log-likelihood criterion based on the Kullback-Leibler divergence.

Parameters:
  • X (ndarray, shape (n_matrices, n, n)) – Set of SPD/HPD matrices to diagonalize.

  • init (None | ndarray, shape (n, n), default=None) –

    Initialization for the diagonalizer.

    Added in version 0.4.

  • eps (float, default=1e-6) – Tolerance for stoping criterion.

  • n_iter_max (int, default=20) – The maximum number of iterations to reach convergence.

  • sample_weight (None | ndarray, shape (n_matrices,), default=None) –

    Weights for each matrix, strictly positive. If None, it uses equal weights.

    Added in version 0.2.7.

Returns:

  • V (ndarray, shape (n, n)) – The diagonalizer, an invertible matrix.

  • D (ndarray, shape (n_matrices, n, n)) – Set of quasi diagonal matrices, D = V X V^H.

Notes

Added in version 0.2.4.

Changed in version 0.7: Add support for HPD matrices.

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

See also

ajd

References

[1]

Joint approximate diagonalization of positive definite Hermitian matrices D.-T. Pham. SIAM Journal on Matrix Analysis and Applications, 22(4), pp. 1136-1152, 2000.