Open guanfaqian opened 1 year ago
Hello, may I ask if you have solved this problem now?
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
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 = GUIDESR.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']) '''
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 = GUIDESR.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?
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 = GUIDESR.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.
Can you open source the code to run GUIDE under these datasets cora, citeseer? Much appreciated!