Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to generate reduction_results/Mapping.mtx for a new dataset? #24

Open
williamweiwu opened this issue Oct 26, 2022 · 8 comments
Open

Comments

@williamweiwu
Copy link

williamweiwu commented Oct 26, 2022

Dear Dr. Zhang,

I am interested in your algorithm, and running the code in my experiment. For a new dataset, how can I generate new Mapping.mtx in the directory of reduction_results? graphzoom.py just calls for mapping_path = "{}Mapping.mtx".format(reduce_results), and I cannot find how to generate in graphzoom.py and utils.py. No Mapping.mtx, the code cannot run successfully.

I would appreciate it very much if you could help me.

Thanks
Wei

@Chenhui1016
Copy link
Collaborator

Hi Wei,

Thanks for your interest! The "Mapping.mtx" file will be automatically obtained after running "lamg" coarsening:

os.system('./run_coarsening.sh {} {} {} n {}'.format(args.mcr_dir, \
coarsen_input_path, args.reduce_ratio, reduce_results))
Please refer to this line about how we generate the mapping matrix:
writeMtx(X, nnz(X), strcat(SavePath,'/Mapping.mtx'));

For a new dataset, all you need to do is to convert the new dataset into the same format as "cora" dataset under GraphZoom/graphzoom/dataset/. Then you should be able to run embedding methods on the new dataset. Feel free to let me know if you have any questions.

Thanks,
Chenhui

@williamweiwu
Copy link
Author

Hi Wei,

Thanks for your interest! The "Mapping.mtx" file will be automatically obtained after running "lamg" coarsening:

os.system('./run_coarsening.sh {} {} {} n {}'.format(args.mcr_dir, \
coarsen_input_path, args.reduce_ratio, reduce_results))

Please refer to this line about how we generate the mapping matrix:

writeMtx(X, nnz(X), strcat(SavePath,'/Mapping.mtx'));

For a new dataset, all you need to do is to convert the new dataset into the same format as "cora" dataset under GraphZoom/graphzoom/dataset/. Then you should be able to run embedding methods on the new dataset. Feel free to let me know if you have any questions.

Thanks, Chenhui

谢谢你的回复。但是很奇怪,我的代码没有自动生成 Mapping.mtx,仍然使用默认的文件,它表示cora数据的相关信息;如果我删掉reduction_results/中的默认文件,代码也不会生成。我也不知道问题出在哪。

由于我采用 fusion 模式,因此代码本应该通过 Lines 23-24行来生成Mapping.mtx

请问能否提供一些宝贵建议?谢谢!

@Chenhui1016
Copy link
Collaborator

Chenhui1016 commented Oct 27, 2022

Hi Wei,

Are you using "lamg" coarsening? If so, have you successfully finished the lamg coarsening (there should be a table showing coarsening details printed out)? It would be more helpful if you can share with me the whole error message.

@williamweiwu
Copy link
Author

Hi Wei,

Are you using "lamg" coarsening? If so, have you successfully finished the lamg coarsening (there should be a table showing coarsening details printed out)? It would be more helpful if you can share with me the whole error message.

graphzoom

The code still employs the incorrect Mapping.mtx, and does not generate a new Mapping.mtx for a new dataset.

Thanks
Wei

@Chenhui1016
Copy link
Collaborator

Chenhui1016 commented Oct 27, 2022

Hi Wei,

The error message shows that the lamg coarsening is not successfully finished (reduction ratio is too small). Thus, the coarsening process is stopped and cannot generate the Mapping.mtx file. What reduction/coarsening ratio are you using? Can you try larger ratio?

@williamweiwu
Copy link
Author

Hi Wei,

The error message shows that the lamg coarsening is not successfully finished (reduction ratio is too small). Thus, the coarsening process is stopped and cannot generate the Mapping.mtx file. What reduction/coarsening ratio are you using? Can you try larger ratio?

Honestly, I have tried many values of reduce_ratio, e.g., 1000, and it till reports the same error.

Thanks
Wei

@Chenhui1016
Copy link
Collaborator

I see. We noticed that the "lamg" coarsening would crash on a few datasets. This is because the lamg solver (our matlab code) has some predefined hyperparameters that may be improper for those datasets and thus the coarsening will not be executed. Can you try "simple" coarsening instead? It would be appreciated if you can also provide your dataset with us so that we can help to check the lamg issue later.

@williamweiwu
Copy link
Author

Hi Wei,
The error message shows that the lamg coarsening is not successfully finished (reduction ratio is too small). Thus, the coarsening process is stopped and cannot generate the Mapping.mtx file. What reduction/coarsening ratio are you using? Can you try larger ratio?

Honestly, I have tried many values of reduce_ratio, e.g., 1000, and it till reports the same error.

Thanks Wei

I have attached one dataset. Please notice that, this is a complement graph of blog network, so it is a very dense network. The average degree is above 2500. I don't know whether failure is related to this factor, because I ran on the original sparse network successfully.

Thanks
Wei

blog.complement.mat.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants