项目作者: zetayue

项目描述 :
Source code for our paper "Improving Attention Mechanism in Graph Neural Networks via Cardinality Preservation" (IJCAI 2020)
高级语言: Python
项目地址: git://github.com/zetayue/CPA.git
创建时间: 2020-04-23T06:53:30Z
项目社区:https://github.com/zetayue/CPA

开源协议:MIT License

下载


Improving Attention Mechanism in Graph Neural Networks via Cardinality Preservation (IJCAI-2020)



Code for the Cardinality Preserved Attention (CPA) model proposed in our paper.

Requirements

  • CUDA 10.2
  • Python 3.6.9
  • Pytorch 1.6.0
  • Pytorch Geometric 1.6.1
  • Pytorch Scatter 2.0.5
  • Pytorch Sparse 0.6.7
  • NumPy
  • scikit-learn

When you have an environment with Python 3.6.9 and CUDA 10.2, the other dependencies can be installed with:

  1. pip install -r requirements.txt

How to run

Unzip the data file:

  1. unzip data.zip

Train and test our model:

  1. python main.py

Optional arguments:

  1. --dataset name of dataset
  2. --mod model to be used: origin, additive, scaled, f-additive, f-scaled
  3. --seed random seed
  4. --epochs number of epochs to train
  5. --lr initial learning rate
  6. --wd weight decay value
  7. --n_layer number of hidden layers
  8. --hid size of input hidden units
  9. --heads number of attention heads
  10. --dropout dropout rate
  11. --alpha alpha for the leaky_relu
  12. --kfold number of kfold
  13. --batch_size batch size
  14. --readout readout function: add, mean

In our paper, the MUTAG, PROTEINS, ENZYMES, NCI1, REDDIT-BINARY and REDDIT-MULTI-5K datasets on https://chrsmrrs.github.io/datasets/docs/datasets/ are used. The other datasets listed on the website can also be used by directly changing the name of the dataset in ‘—dataset’. When you run the code, the needed dataset will be automatically downloaded and processed.

Cite

If you found this model and code are useful, please cite our paper:

  1. @inproceedings{ijcai2020-194,
  2. title = {Improving Attention Mechanism in Graph Neural Networks via Cardinality Preservation},
  3. author = {Zhang, Shuo and Xie, Lei},
  4. booktitle = {Proceedings of the Twenty-Ninth International Joint Conference on
  5. Artificial Intelligence, {IJCAI-20}},
  6. publisher = {International Joint Conferences on Artificial Intelligence Organization},
  7. editor = {Christian Bessiere},
  8. pages = {1395--1402},
  9. year = {2020},
  10. month = {7},
  11. note = {Main track}
  12. doi = {10.24963/ijcai.2020/194},
  13. url = {https://doi.org/10.24963/ijcai.2020/194},
  14. }