
Instructions on how to use the code base.

Pre-requisites
1. Pytorch-geometric
2. Pytorch
3. DeepRobust - custom dataset loader for working on syn-cora datasets. (pip install deeprobust)



####
nodeli.py -- contains code to calculate adjusted homophily and node label informativeness. Its is taken from the paper - 
Characterizing Graph Datasets for Node Classification: Homophily-Heterophily Dichotomy and Beyond, Platonov et al.

####
datasets.py -- to use the syn-cora dataset, Beyond Homophily in Graph Neural Networks: Current Limitations and Effective Designs - Zhu, Jiong et al.


Folder structure
1. RealWorld - contains code to calculate memorization scores for real-world graphs.
2. SBM - contains code to calculate memorization scores for SBM graphs.
3. Rewiring - contains the feature similarity based rewiring + new main files.

RealWorld experiments
1. To run experiments you can simple use ```bash run_experiments.sh```, by default it runs for Cora. Feel free to change the datasets and hyperparameters. The results reported in the paper were obtained using the hyperparameters we have reported in the paper. So the memorization rate might be different depending on the hyperparameters you use.\

SBM
1. Run using python main_syncora.py. Inside you can set the dataset you want to run the analysis for. The folder syn-cora contains 5 synthetic graphs with different homophily levels.}

Rewiring
1. Contains onlysim2.py which is the rewiring method that can add/delete edges based on feature similarity maximization.
2. Contains mainsyncorarewiring.py that can be placed in SBM folder and run the rewiring scheme on synthetic graphs and then calculate memorization scores.
