I run this SVD solver from scipyusing the code below:
import numpy as np
from scipy.sparse.linalg import svds
features = np.arange(9,dtype=np.float64).reshape((3,3))
for i in range(10):
_,_,V = svds(features,2)
print i,np.mean(V)
I expected the average print value to be the same every time, however it changes and apparently goes through several selected values. I am happy to accept this behavior as a result of low-level optimization / random seeding.
I don’t quite understand why it gives the same values in the same order every time I run this script. For me, this seems semi-deterministic and semi-deterministic.
This problem affects more complex processing, and it would be nice to understand it so that I can at least make a hacky workaround.
chris source
share