• Stars
    star
    525
  • Rank 81,515 (Top 2 %)
  • Language
    Python
  • Created almost 3 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Code and resources on scalable and efficient Graph Neural Networks

Knowledge Distillation for Resource-efficient Graph Neural Networks

This repository provides resources on Graph Neural Network efficiency and scalability, as well as implementations of knowledge distillation techniques for developing resource-efficient GNNs.

Knowledge distillation pipeline for GNNs

Check out the accompanying paper 'On Representation Knowledge Distillation for Graph Neural Networks', which introduces new GNN distillation techniques using contrastive learning to preserve the global topology of teacher and student embeddings.

Chaitanya K. Joshi, Fayao Liu, Xu Xun, Jie Lin, and Chuan Sheng Foo. On Representation Knowledge Distillation for Graph Neural Networks. IEEE Transactions on Neural Networks and Learning Systems (TNNLS), Special Issue on Deep Neural Networks for Graphs: Theory, Models, Algorithms and Applications.

PDF | Blog

❓New to GNN scalability: See awesome-efficient-gnns.md and the accompanying blogpost for a currated overview of papers on efficient and scalable Graph Representation Learning for real-world applications.

Distillation Techniques

Representation distillation techniques for GNNs

We benchmark the following knowledge distillation techniques for GNNs:

  • Local Structure Preserving loss, Yang et al., CVPR 2020: preserve pairwise relationships over graph edges, but may not preserve global topology due to latent interactions.
  • Global Structure Preserving loss, Joshi et al., TNNLS 2022: preserve all pairwise global relationships, but computationally more cumbersome.
  • 🌟 Graph Contrastive Representation Distillation, Joshi et al., TNNLS 2022: contrastive learning among positive/negative pairwise relations across the teacher and student embedding spaces.
  • πŸ”₯ Your new GNN distillation technique?

We also include baselines: Logit-based KD, Hinton et al., 2015; and feature mimicking baselines for computer vision: FitNet, Romero et al., 2014, Attention Transfer, Zagoruyko and Komodakis, 2016.

Datasets and Architectures

We conduct benchmarks on large-scale and real-world graph datasets, where the performance gap between expressive+cumbersome teacher and resource-efficient student GNNs is non-negligible:

  • Graph classification on MOLHIV from Open Graph Benchmark/MoleculeNet -- GIN-E/PNA teachers, GCN/GIN students.
  • Node classification on ARXIV and MAG from Open Graph Benchmark and Microsoft Academic Graph -- GAT/R-GCN teachers, GCN/GraphSage/SIGN students.
  • 3D point cloud segmentation on S3DIS -- not released publicly yet.
  • Node classification on PPI -- provided to reproduce results from Yang et al.

Installation and Usage

Our results are reported with Python 3.7, PyTorch, 1.7.1, and CUDA 11.0. We used the following GPUs: RTX3090 for ARXIV/MAG, V100 for MOLHIV/S3DIS.

Usage instructions for each dataset are provided within the corresponding directory.

# Create new conda environment
conda create -n ogb python=3.7
conda activate ogb

# Install PyTorch (Check CUDA version!)
conda install pytorch=1.7.1 cudatoolkit=11.0 -c pytorch

# Install DGL
conda install -c dglteam dgl-cuda11.0

# Install PyG
CUDA=cu110
pip3 install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.7.1+${CUDA}.html
pip3 install torch-sparse -f https://pytorch-geometric.com/whl/torch-1.7.1+${CUDA}.html
pip3 install torch-cluster -f https://pytorch-geometric.com/whl/torch-1.7.1+${CUDA}.html
pip3 install torch-spline-conv -f https://pytorch-geometric.com/whl/torch-1.7.1+${CUDA}.html
pip3 install torch-geometric

# Install other dependencies
conda install tqdm scikit-learn pandas urllib3 tensorboard
pip3 install ipdb, nvidia-ml-py3

# Install OGB
pip3 install -U ogb

Citation

@article{joshi2022representation,
  title={On Representation Knowledge Distillation for Graph Neural Networks},
  author={Chaitanya K. Joshi and Fayao Liu and Xu Xun and Jie Lin and Chuan-Sheng Foo},
  journal={IEEE Transactions on Neural Networks and Learning Systems},
  year={2022}
}

@article{joshi2022efficientgnns,
  author = {Joshi, Chaitanya K.},
  title = {Recent Advances in Efficient and Scalable Graph Neural Networks},
  year = {2022},
  howpublished = {\url{https://www.chaitjo.com/post/efficient-gnns/}},
}

More Repositories

1

geometric-gnn-dojo

Geometric GNN Dojo provides unified implementations and experiments to explore the design space of Geometric Graph Neural Networks.
Jupyter Notebook
415
star
2

graph-convnet-tsp

Code for the paper 'An Efficient Graph Convolutional Network Technique for the Travelling Salesman Problem' (INFORMS Annual Meeting Session 2019)
Python
278
star
3

learning-tsp

Code for the paper 'Learning TSP Requires Rethinking Generalization' (CP 2021)
Jupyter Notebook
188
star
4

personalized-dialog

Code for the paper 'Personalization in Goal-oriented Dialog' (NeurIPS 2017 Conversational AI Workshop)
Python
132
star
5

geometric-rna-design

gRNAde: Geometric Deep Learning for RNA Design
Jupyter Notebook
110
star
6

markowitz-portfolio-optimization

Markowitz portfolio optimization on synthetic and real stocks
Python
72
star
7

lstm-context-embeddings

Augmenting word embeddings with their surrounding context using bidirectional RNN
Python
60
star
8

regression-stock-prediction

Predicting Google’s stock price using regression
Python
58
star
9

gated-graph-transformers

Transformers are Graph Neural Networks!
Python
49
star
10

learning-paradigms-for-tsp

Code for the paper 'On Learning Paradigms for the Travelling Salesman Problem' (NeurIPS 2019 Graph Representation Learning Workshop)
Python
27
star
11

auto-mate-for-tinder

Use Artificial Intelligence to find promiscuous Tinder matches
CSS
23
star
12

knowledge-graphs

Building Knowledge Graphs from Unstructured Text
Jupyter Notebook
20
star
13

structured-self-attention

Keras implementation of the Structured Self-Attentive Sentence Embedding model
Python
19
star
14

flask-mongodb

A simple REST Api using Flask-Restful and MongoDB
Python
17
star
15

working-women

Code for the paper 'Working Women and Caste in India' (ICLR 2019 AI for Social Good Workshop)
Jupyter Notebook
14
star
16

music-library-ocd-fixer

Automatically fetch metadata for your music collection and rename files accordingly
Python
13
star
17

mnist-cnn-autoencoder

Using deep CNNs and stacked autoencoders to classify images of digits from the MNIST dataset
Python
7
star
18

Perceptron

Perceptron algorithm implemented from scratch
Python
5
star
19

nn-classification-and-regression

Using deep neural networks for classification and regression problems
Python
5
star
20

NTUOSS-MachineLearningWorkshop

Introductory Machine Learning workshop for NTU Open Source Society
Python
5
star
21

transformers-are-gnns

4
star
22

Velocity

A 2D lane-switching game made using the graphics.h C++ library
C++
1
star
23

PreparedForU

A simple tool for university aspirants and students in Singapore to estimate and visualize their spending based on publicly available data
Vue
1
star