I found that there're two versions of pinv()
function, which calculates the pseudo-inverse of a matrix in Scipy
and numpy
, the documents can be viewed at:
http://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.pinv.html
http://docs.scipy.org/doc/scipy/reference/generated/scipy.linalg.pinv.html
The problem is that I have a 50000*5000 matrix, when using scipy.linalg.pinv
, it costs me more than 20GB of memory. But when I use numpy.linalg.pinv
, only less than 1GB of memory is used..
I was wondering why numpy
and scipy
both have a pinv
under different implemention. And why their performances are so different.