lingvo.core.matrix_functions module

Matrix functions contains iterative methods for M^p.

lingvo.core.matrix_functions.matrix_square_root(mat_a, mat_a_size, iter_count=100, ridge_epsilon=0.0001)[source]

Iterative method to get matrix square root.

Stable iterations for the matrix square root, Nicholas J. Higham

Page 231, Eq 2.6b http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.6.8799&rep=rep1&type=pdf

Parameters
  • mat_a – the symmetric PSD matrix whose matrix square root be computed

  • mat_a_size – size of mat_a.

  • iter_count – Maximum number of iterations.

  • ridge_epsilon – Ridge epsilon added to make the matrix positive definite.

Returns

mat_a^0.5

lingvo.core.matrix_functions.inlined_matrix_inverse_pth_root(mat_g, mat_g_size, alpha, iter_count=100, error_tolerance=1e-06, ridge_epsilon=1e-06)[source]

Computes mat_g^alpha, where alpha = -1/p, p is one of 2, 4, or 8.

We use an iterative Schur-Newton method from equation 3.2 on page 9 of:

A Schur-Newton Method for the Matrix p-th Root and its Inverse by Chun-Hua Guo and Nicholas J. Higham SIAM Journal on Matrix Analysis and Applications, 2006, Vol. 28, No. 3 : pp. 788-804 https://pdfs.semanticscholar.org/0abe/7f77433cf5908bfe2b79aa91af881da83858.pdf

Parameters
  • mat_g – the symmetric PSD matrix whose power it to be computed

  • mat_g_size – size of mat_g.

  • alpha – exponent, must be -1/p for p a positive integer.

  • iter_count – Maximum number of iterations.

  • error_tolerance – Error indicator, useful for early termination.

  • ridge_epsilon – Ridge epsilon added to make the matrix positive definite.

Returns

mat_g^alpha