- PyTorch 0.4 or 0.5
- Python 2.7 or 3.6
- networkx, scipy, sklearn, numpy, pickle
Example: python generate_perturbation.py --dataset cora --radius 10 --fake_rate 0.01 --step 10
dataset: the network dataset you are going to attack
radius: the radius of the l2 Norm Projection
fake_rate: the ratio of patch nodes to the original graph size
step: the learning step of updating the patch connection entries
After finishing the training of the GUAP, we then evaluate the test asr over the test nodes
Example: python eval_baseline.py --dataset cora --radius 10 --fake_rate 0.01 --evaluate_mode universal
dataset: the network dataset you are going to attack
radius: the radius of the l2 Norm Projection
evaluate_mode has five values:
- "universal": GUAP
- "rand_feat": GUAP with regenerated node features
- "no_connection": GUAP without patch connections
- "random_connection": GUAP with random patch connections
- "full_connection": GUAP with full patch connections
Some patch results trained by GUAP can be accessed from Dropbox:
Cora: radius = 10, step = 10, fake_rate=0.01
Citeseer: radius = 10, step = 10, fake_rate=0.01
Pol.Blogs: radius = 10, step = 10, fake_rate=0.05
You can directly use them for testing the attack performances.
The verision of jupyter notebook is also supported as: evaluate.ipynb