TNonet / lmdec_research

Large Matrix DECompositons (LMDEC)
MIT License
0 stars 0 forks source link

Document relationship between Eigen values, buffer size, and expected iterations #6

Open TNonet opened 4 years ago

TNonet commented 4 years ago

Let A be a matrix

m, n = 2000, 1000
A = np.random.rand(m, n) - 1.005*np.random.uniform(size=(m,n))
#A = np.random.rand(m,n)
U, S, V = np.linalg.svd(A)
S = np.array(S)
A = A.T.dot(A)
A = da.array(A)

Thus the singular values look like:

Screen Shot 2020-01-25 at 10 43 34 AM

We run the SVD as such:

 PM = PowerMethod(max_iter=200, k=k, buffer=b, scoring_tol=1e-9)
 _, _, _ = PM.svd(A)

Here we can see that even though we do a SVD Sub Start it takes 1 iteration to really become an accurate start.

Screen Shot 2020-01-25 at 10 34 19 AM

Increasing buffer size does increase the convergence rate, but calculating this from the first iteration is not accurate.

In addition, the increased buffer size is made up for the improved convergence rate. Here we can see the run time to get to 1e-9 tolerance

Screen Shot 2020-01-25 at 10 41 00 AM

.

TNonet commented 4 years ago

Taking this farther to a buffer size of 200!

Screen Shot 2020-01-25 at 10 51 35 AM

We can see the corresponding run time.

Screen Shot 2020-01-25 at 10 52 16 AM