Assuming that the symmetric matrix is nonsingular, summing the reciprocals of the eigenvalues nets you the trace of the inverse. If the matrix is positive definite as well, first perform a Cholesky decomposition. Then there are methods for generating the diagonal elements of the inverse.
GloVe source code from C to Python. In this post I’ll give an explanation by intuition of how the GloVe method works 5 and then provide a quick overview of the implementation in Python. You can find the complete Python code (just 187 SLOC, including command-line argument processing, IO, etc.) in the glove.py GitHub repo .
The Toeplitz matrix used to generate inequalities is just an upper-tridiagonal matrix with coefficients 1, 2, 3, all other coefficients being zero. This matrix is sparse but represented by (dense) NumPy arrays here.
python numpy scipy sparse-matrix linear-equation | this question edited May 12 '13 at 21:42 Saullo Castro 26.4k 8 71 135 asked Oct 14 '11 at 12:59 ajn 43 7 Without computing the inverse, you can't compute K. What you can do without computing the inverse is computing Kx for some vector x, which would