简体   繁体   中英

python finding eigen values and eigen vectors

I have a graph laplacian, for which I need to find out the largest 'k' eigen values and eigen vectors. I am using something like this :-

#L= laplacian matrix.
eigVal,eigVectors = eigsh(L, k,  which='LA')

This is giving me approximately correct results, but something's going wrong and I am getting eig values slightly greater than 1 (say 1.05). In my case the eigen values are upper bounded by 1. when using MATLAB and other platforms I am getting desired results.

What am I doing wrong here?? Is there any way by which I can parallelize the computation of eigen vectors and values? (I am considering pyCuda.)

Are you sure that your Python implementation of the Laplacian is correct? Did you double-check eg that the input matrix is symmetric?

Without having your specific matrix at hand, it is difficult to say what exactly goes wrong. Can you save the matrix and put it somewhere on the internet?

EDIT : removed mention of eigs* previous behavior -- the routine did not have the eigsh name before that, so that's not the case here.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM