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

Can you tell me how to run GUIDE under these datasets of cora, citeseer? #2

Open
guanfaqian opened this issue Sep 10, 2023 · 5 comments

Comments

@guanfaqian
Copy link

Can you open source the code to run GUIDE under these datasets cora, citeseer? Much appreciated!

@Alchemistqqqq
Copy link

Hello, may I ask if you have solved this problem now?

@Happy2Git
Copy link
Owner

You can easily modify the BTC_notebook to run GUIDE for Cora/Citeseer. BTC has multiple graphs, but Cora/Citeseer are single-graph datasets. @guanfaqian @Alchemistqqqq

@Happy2Git
Copy link
Owner

For BTC graphs, the data is not in the native PyTorch data format. Therefore, I added the necessary procedure to process it into the PyTorch data format. However, for Cora/Citeseer, you can load the graph using PyG directly, making it simple to just replace the graph edge index in the following code:
'''
GUIDE_SR = GUIDE(edge_indexs=dataset_train[gi].edge_index, labels=dataset_train[gi].y, k=args['shards_number'])
p1 = GUIDE_SR.fit(method='SR', alpha_=1e-3, beta_=1e-2)
p1_saved = GUIDE_SR.subgraph_repair(x = dataset_train[gi].x, REPAIR_METHOD='MixUp', PATH='checkpoints/',DATA_NAME='{}'.format(args['dataname']), MULTI_GRAPH = args['gi'])
'''

@Alchemistqqqq
Copy link

For BTC graphs, the data is not in the native PyTorch data format. Therefore, I added the necessary procedure to process it into the PyTorch data format. However, for Cora/Citeseer, you can load the graph using PyG directly, making it simple to just replace the graph edge index in the following code: ''' GUIDE_SR = GUIDE(edge_indexs=dataset_train[gi].edge_index, labels=dataset_train[gi].y, k=args['shards_number']) p1 = GUIDE_SR.fit(method='SR', alpha_=1e-3, beta_=1e-2) p1_saved = GUIDE_SR.subgraph_repair(x = dataset_train[gi].x, REPAIR_METHOD='MixUp', PATH='checkpoints/',DATA_NAME='{}'.format(args['dataname']), MULTI_GRAPH = args['gi']) '''

I am new to this field, but I am very interested in your work, thank you for your reply, and I will try it next. There is another question for you, is the requirement for GPU in the experiment very strict? How long is the training? I am currently using 4070s on this machine. Can I duplicate your work well?

@Happy2Git
Copy link
Owner

For BTC graphs, the data is not in the native PyTorch data format. Therefore, I added the necessary procedure to process it into the PyTorch data format. However, for Cora/Citeseer, you can load the graph using PyG directly, making it simple to just replace the graph edge index in the following code: ''' GUIDE_SR = GUIDE(edge_indexs=dataset_train[gi].edge_index, labels=dataset_train[gi].y, k=args['shards_number']) p1 = GUIDE_SR.fit(method='SR', alpha_=1e-3, beta_=1e-2) p1_saved = GUIDE_SR.subgraph_repair(x = dataset_train[gi].x, REPAIR_METHOD='MixUp', PATH='checkpoints/',DATA_NAME='{}'.format(args['dataname']), MULTI_GRAPH = args['gi']) '''

I am new to this field, but I am very interested in your work, thank you for your reply, and I will try it next. There is another question for you, is the requirement for GPU in the experiment very strict? How long is the training? I am currently using 4070s on this machine. Can I duplicate your work well?

I believe it's sufficient to just run GUIDE followed by the GNN training. The partition time of GUIDE is reported in Table 1 of our paper, with GUIDE_SR taking less than 5 minutes even on the BTC graph, and GUIDE_Fast being faster(<30s). I ran it on a machine with a 3090 GPU. However, if you want to run all the baselines, including multiple train/test splits and other graph unlearning methods, you may need more time.

GUIDE_Fast and GUIDE_SR only require CPU memory as they need to calculate the eigenvector of the graph. When the graph is larger, their calculations will be slower. If you want to extend it to Reddit or other large graphs, you may need to implement some approximate methods to reduce the memory and time costs of the eigen-decomposition computation.

A GPU is only needed when you train the GNN model or if you want to maintain the data in your GPU to accelerate the calculation and avoid frequent data transfer between the CPU and GPU.

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

3 participants