This repository contains the code for the paper "Joint Graph Rewiring and Feature Denoising via Spectral Alignment". The GNN code is based on the ICLR2021 paper Adaptive Universal Generalized PageRank Graph Neural Network [Paper] [Code].
Diffusion Improves Graph Learning (DIGL) [Paper] [Code]
First-order spectral rewiring (FoSR) [Paper] [Code]
Batch Ollivier-Ricci Flow (BORF) [Paper] [Code]
Approximate Message Passing - Belief Propagation (AMP-BP) [Paper] [Code]
DIGL, FoSR and BORF can be run directly from this repository. For AMP-BP, please refer to the original repository.
Tested with Python 3.10.14 and PyTorch 2.0.1 (Cuda 11.8).
pytorch
pytorch-geometric
numpy scipy matplotlib pyyaml
For FoSR and BORF baseline:
numba pandas networkx GraphRicciCurvature scikit-learn
Optional (if not used, use flag --no-wandb_log
when running the code):
wandb
In all cases go to folder src
python train_model.py --dataset Cora --net GCN --data_split sparse --denoise_default GCN
DIGL
python train_model.py --dataset Cora --net GCN --data_split sparse --rewire_default ppr
FoSR
python train_model.py --dataset Cora --net GCN --data_split sparse --rewire_default fosr
BORF
python train_model.py --dataset Cora --net GCN --data_split sparse --rewire_default borf
source run_csbm_exp.sh
source run_exp_table_1.sh
source run_exp_table_2.sh
The dataset can be downloaded from Snap.
To create a new dataset go to folder src
and run for example:
python cSBM_dataset.py --phi 0.6 --name cSBM_phi_0.6 --root ../data/ --num_nodes 5000 --num_features 2000 --avg_degree 5 --epsilon 3.25