Scipy linalg deterministic / non-deterministic code

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.

+4
source share
1 answer

( Python), , , , ARPACK eigensolver, svds .

Python svds, v0 ( ) _ArpackParams, info 0, v0 is None; v0 , info - 1. dragons Fortran, ( ) dsaupd, , cgetv0, . LAPACK RNG 1357.

, ARPACK (, , LAPACK-, , ), RNG , , ; , , , .

, , eigs .

+1

All Articles