Skip to content

SJTU-Quant/SUNNY-GNN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Releases

No releases published

Packages

No packages published