qndiag.qndiag

qndiag.qndiag(C, B0=None, weights=None, max_iter=1000, tol=1e-06, lambda_min=0.0001, max_ls_tries=10, diag_only=False, return_B_list=False, check_sympos=True, verbose=False, ortho=False)

Joint diagonalization of matrices using the quasi-Newton method

Parameters
Carray-like, shape (n_samples, n_features, n_features)

Set of matrices to be jointly diagonalized. C[0] is the first matrix, etc…

B0None | array-like, shape (n_features, n_features)

Initial point for the algorithm. If None, a whitener is used.

weightsNone | array-like, shape (n_samples,)

Weights for each matrix in the loss: L = sum(weights * KL(C, C’)) / sum(weights). No weighting (weights = 1) by default.

max_iterint, optional

Maximum number of iterations to perform.

tolfloat, optional

A positive scalar giving the tolerance at which the algorithm is considered to have converged. The algorithm stops when |gradient| < tol.

lambda_minfloat, optional

A positive regularization scalar. Each eigenvalue of the Hessian approximation below lambda_min is set to lambda_min.

max_ls_triesint, optional

Maximum number of line-search tries to perform.

diag_onlybool, optional

If true, the line search is done by computing only the diagonals of the dataset. The dataset is then computed after the line search. Taking diag_only = True might be faster than diag_only=False when the matrices are large (n_features > 200)

return_B_listbool, optional

Chooses whether or not to return the list of iterates.

check_symposbool, optional

Chooses whether to check that the provided dataset contains only symmetric positive definite matrices, as should be.

verbosebool, optional

Prints informations about the state of the algorithm if True.

orthobool, optional

If true, performs joint diagonlization under orthogonal constrains.

Returns
Darray-like, shape (n_samples, n_features, n_features)

Set of matrices jointly diagonalized

Barray, shape (n_features, n_features)

Estimated joint diagonalizer matrix.

infosdict

Dictionnary of monitoring informations, containing the times, gradient norms and objective values.

References

P. Ablin, J.F. Cardoso and A. Gramfort. Beyond Pham’s algorithm for joint diagonalization. Proc. ESANN 2019. https://www.elen.ucl.ac.be/Proceedings/esann/esannpdf/es2019-119.pdf https://hal.archives-ouvertes.fr/hal-01936887v1 https://arxiv.org/abs/1811.11433

Fork me on GitHub