This is the code repository for our paper on Sublinear Time Eigenvalue Approximation via Random Sampling.
TODO:
- create a package for python using our methods and publish here.
We experimented in this version and do not expect this to fail in another version of python 3, but still do not guarantee stability in other versions of python packages.
- Python (3.8.5)
- Tqdm (4.50.2)
- Sklearn (0.23.2)
- Skimage (0.17.2)
- Numpy (1.19.5)
- Networkx (2.5)
- Matplotlib (3.3.2)
- Pickle (4.0)
- idx2numpy
- To run the approximation do
python main.py
for onlyrandom uniform sampling
. To compare across methods likerow norm sampling
,uniform random sampling
orratio of non zero elements per row sampling (nnz sampling)
usecompare_unified.py
. - To change dataset change lines 64 and 66 accordingly in
main.py
or line 20 incompare_unified.py
. - Display codes are in
display_codes.py
. - Matlab demo code for a single eigenvalue is in
matlab_code.m
. - Figures are in folder
figures
. Please go in to select dataset and then seeerrors
. All unified comparisons are stored in folders named:XXXX__norm_v_random_v_nnz/errors
where one can replaceXXXX
for dataset name.
The four hyperparameters for our code are:
- Number of trials (line 63 in code
main.py
) or (line 18 incompare_unified.py
). - Similarity measure (line 64 in code
main.py
or line 27 incompare_unified.py
), is only useful for datasets where a similarity measure is required. Otherwise set todefault
(can ignore in case ofcompare_unified.py
). - Search ranks (line 65 in
main.py
or line 19 ofcompare_unified.py
), is used to track the eigenvalues and errors of specified eigenvalues. - Dataset name (line 66 in
main.py
or line 20 incompare_unified.py
).
Please take a look at lines 61-67 in code main.py
for more details.
Most datasets in the paper are synthetic. There are however two real world graph datasets. These are taken from SNAP.
- Facebook -- data.
- ArXiv COND-MAT -- data.
Please copy these files in a folder named data
for our code to run without error. Otherwise modify the file get_dataset.py
to use the path to your dataset.
We hope this README has exhaustive literature to guide you in our projects. For any questions or queries feel free to reach out to us over email.
If you want to cite our paper please check google scholar.