ChandlerBang/Pro-GNN

The code is running extremely slow

AndyJZhao opened this issue · 2 comments

Hi,

I've made sure that the GPU boosting is on, however, it takes about 150 minutes to train Pro-GNN on Tesla T4 (Yelp dataset with 3.9k nodes). In comparison, the vanilla GCN can be trained on the same dataset and device within 9 seconds (300 epochs).
I'm willing to follow your work and hope you kindly answer my following answers. : )

Q1: Is there any method (or anything that I've done wrong) to speed up the training process?
Q2: What are the most important parameters to grid search for Pro-GNN, if I focus on improving the classification performance on the original (not the perturbed/attacked) graph? Since it will take months to grid search all the parameters.

Hi,

  1. The most important hyper-parameter is beta which controls the contribution of nuclear norm. You can focus on tuning it. To further accelerate the algorithm, you can set the hyper-parameter of feature smoothness to be 0 in some datasets.

  2. If you find the nuclear proximal operator runs too slow, you can modify line 77 in to use prox_operators.prox_nuclear_cudainstead of prox_operators.prox_nuclear to perform the proximal on gpu. But the SVD operation in Pytorch is not very stable, you may need to try other random seeds to run it smoothly.

If you still feel it slow, you can try truncated SVD, see below. Truncated SVD requires you to tune the truncated hyper-parameter k. But I am not sure the performance will still be very strong.

Other proximal_operator choices like prox_nuclear_truncated doing truncated SVD can be found in https://github.com/DSE-MSU/DeepRobust/blob/master/deeprobust/graph/defense/pgd.py.


By the way, you need to reclone DeepRobust since I just made some small change on defense/pgd.py.

Thank you for your prompt and detailed reply, I will check out the changes and follow your advice!