BigAndSweet / SUNNY-GNN

The official implementation of AAAI'24 paper: Self-Interpretable Graph Learning with Sufficient and Necessary Explanations.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SUNNY-GNN

Paper | Slides | Poster I Supplementary

Official code implementation of AAAI 2024 paper "Self-Interpretable Graph Learning with Sufficient and Necessary Explanations". This work proposes a self-interpretable graph learning framework named SUNNY-GNN. Empowered by the contrastive learning, SUNNY-GNN is able to generate both sufficient and necessary explanations that are beneficial to the training of GNNs. The end-to-end training flow of SUNNY-GNN is presented as follows:

Environment Setup

  • Python 3.7
  • torch~=1.10.1
  • dgl~=1.1.0
  • numpy~=1.21.5
  • PyYAML, scikit_learn, tqdm

Datasets

Datasets are provided in the dataset folder. Take Citeseer as example:

  • citeseer_graph.bin: graph data;
  • citeseer_index.bin: Training, validation, and test set split and label information;
  • citeseer_sg.bin:The cached computation graph for each node, which will be automatically generated when running the code for the first time.

Graph Data

The graph datasets we utilize include Citeseer, Cora, Pubmed, Amazon-Photo, Coauthor-CS, and Coauthor-Physics. These datasets are part of the standard dataset collection available in the dgl documentation.

Run our code and it will automatically download these datasets and their training and testing splits from dgl. Note that for Amazon-Photo, Coauthor-CS, and Coauthor-Physics, there is no standard split of training and testing set by dgl, we provide our split in SUNNY_GNN_pre_index_split.

Running the Code

python main.py --method sunny-gnn --encoder gat --dataset citeseer --gpu 0 --num_seeds 5
  • method: sunny-gnn, gat, gcn;
  • encoder: gat, gcn, simplehgn;
  • datasets: citeseer, cora, pubmed, amazon-photo, coauthor-physics, coauthor-cs;

Detailed training scripts can be found in train_baseline.sh.

About

The official implementation of AAAI'24 paper: Self-Interpretable Graph Learning with Sufficient and Necessary Explanations.

License:GNU Affero General Public License v3.0


Languages

Language:Python 96.5%Language:Shell 3.5%