The official PyTorch implementation of ARIEL in Adversarial Graph Contrastive Learning with Information Regularization, WWW 2022, and its extended version ARIEL: Adversarial Graph Contrastive Learning accepted to TKDD. Our implementation is based on GRACE, GCA and GraphCL.
- Release the code and data for graph contrastive learning under the poisoning attack.
- Add two additional node classification datasets:
FacebookandLastFMAsia. - Release the code for the graph classification task.
- If you want to contact me for any question, please note the change of the email addrees, the new address is: shengyuf@andrew.cmu.edu
- Update the parameters on the lateset
torch-geometricversion, the performance may be a little different. Our results are in folderresults. Also add the scriptbatch_train.pyfor searching hyperparameters (could launch multiple processes in different terminals) in case new versions come out. - Simplify the model with less hyperparameters and searching range. We rescale the range of
alphaand change the constraints ofbeta, the searching area becomes smaller now. We currently remove the curriculum learning part withgamma=1. Information regularization is not always needed, keeplamb=0at first. In this version, information regularization could improve the performance onCoauthro-CS. - Highly recommend for a larger subgraph size (3000) on large graphs.
conda env create -f environment.yml
conda activate ARIEL
If you encounter any problem during installing torch-geometric, please refer to the installation manual on its official website.
Train and evaluate the model by executing
cd node_cls
python train.py --dataset Cora
The --dataset argument should be one of Cora, CiteSeer, AmazonC, AmazonP, CoauthorC, CoauthorP, Facebook, LastFMAsia.
The parameters in train.py are now fixed to be from config.yaml, change it to args.{} for customer inputs.
For the node classification under the poisoning attack, change the script from train.py to train_attack.py, the attacked graphs should be put in the folder node_cls/attack_data.
Train and evaluate the model by executing
cd graph_cls
bash go.sh $GPU_ID $DATASET_NAME $AUGMENTATION
$DATASET_NAME is the dataset name (please refer to https://chrsmrrs.github.io/datasets/docs/datasets/), $GPU_ID is the lanched GPU ID and $AUGMENTATION could be random2, random3, random4 that sampling from {NodeDrop, Subgraph}, {NodeDrop, Subgraph, EdgePert} and {NodeDrop, Subgraph, EdgePert, AttrMask}, seperately. By default, we use random4 as the augmentation in our paper.
If you find our work helpful, please cite our paper:
@inproceedings{feng2022adversarial,
author = {Feng, Shengyu and Jing, Baoyu and Zhu, Yada and Tong, Hanghang},
title = {Adversarial Graph Contrastive Learning with Information Regularization},
year = {2022},
isbn = {9781450390965},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/3485447.3512183},
doi = {10.1145/3485447.3512183},
location = {Virtual Event, Lyon, France},
series = {WWW '22}
}
@misc{feng2022ariel,
title={ARIEL: Adversarial Graph Contrastive Learning},
author={Shengyu Feng and Baoyu Jing and Yada Zhu and Hanghang Tong},
year={2022},
eprint={2208.06956},
archivePrefix={arXiv},
primaryClass={cs.LG}
}