Skip to content

chisam0217/GUAP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Graph Universal Attack Through Adversarial Patching (GUAP)

Usage

  • PyTorch 0.4 or 0.5
  • Python 2.7 or 3.6
  • networkx, scipy, sklearn, numpy, pickle

Train the attack model

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

Evaluate the test ASR

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published