Skip to content

Commit 30277bf

Browse files
committed
First public release of Geometric GNN Dojo
0 parents  commit 30277bf

24 files changed

+3716
-0
lines changed

.gitignore

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
5+
# C extensions
6+
*.so
7+
8+
# Distribution / packaging
9+
.Python
10+
env/
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
*.egg-info/
23+
.installed.cfg
24+
*.egg
25+
26+
# PyInstaller
27+
# Usually these files are written by a python script from a template
28+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
29+
*.manifest
30+
*.spec
31+
32+
# Installer logs
33+
pip-log.txt
34+
pip-delete-this-directory.txt
35+
36+
# Unit test / coverage reports
37+
htmlcov/
38+
.tox/
39+
.coverage
40+
.coverage.*
41+
.cache
42+
nosetests.xml
43+
coverage.xml
44+
*.cover
45+
46+
# Translations
47+
*.mo
48+
*.pot
49+
50+
# Django stuff:
51+
*.log
52+
53+
# Sphinx documentation
54+
docs/_build/
55+
56+
# PyBuilder
57+
target/
58+
59+
# DotEnv configuration
60+
.env
61+
62+
# Database
63+
*.db
64+
*.rdb
65+
66+
# Pycharm
67+
.idea
68+
69+
# VS Code
70+
.vscode/
71+
72+
# Spyder
73+
.spyproject/
74+
75+
# Jupyter NB Checkpoints
76+
.ipynb_checkpoints/
77+
78+
# exclude data from source control by default
79+
io
80+
io/
81+
82+
# Mac OS-specific storage files
83+
.DS_Store
84+
85+
# vim
86+
*.swp
87+
*.swo
88+
89+
# Mypy cache
90+
.mypy_cache/
91+
92+
# Other
93+
.history
94+
.history/
95+
logs/
96+
venv*/
97+
venv_gpu/
98+
lightning_logs
99+
.DS_Store

README.md

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Geometric GNN Dojo
2+
3+
*The Geometric GNN Dojo* is a pedagogical resource for beginners and experts to explore the design space of **Graph Neural Networks for geometric graphs**.
4+
5+
<!-- ![Axes of geometric GNN expressivity](https://www.chaitjo.com/publication/joshi-2022-expressive/geometric-gnn-axes.png) -->
6+
7+
<figure><center><img src="https://www.chaitjo.com/publication/joshi-2022-expressive/geometric-gnn-axes.png" width="70%"></center></figure>
8+
9+
Check out the accompanying paper ['On the Expressive Power of Geometric Graph Neural Networks'](https://www.chaitjo.com/publication/joshi-2022-expressive/), which characterises the expressive power and theoretical limitations of geometric GNNs through the lens of geometric graph isomorphism.
10+
> Chaitanya K. Joshi*, Cristian Bodnar*, Simon V. Mathis, Taco Cohen, and Pietro Liò. On the Expressive Power of Geometric Graph Neural Networks. *NeurIPS 2022 Workshop on Symmetry and Geometry in Neural Representations.*
11+
>
12+
>[PDF]() | [Slides](https://www.chaitjo.com/publication/joshi-2022-expressive/Geometric_GNNs_Slides.pdf) | [Video](https://youtu.be/VKj5wzZsoK4)
13+
14+
15+
## Architectures
16+
17+
The `/src` directory provides unified implementations of several popular geometric GNN architectures:
18+
- Invariant GNNs: [SchNet](https://arxiv.org/abs/1706.08566), [DimeNet](https://arxiv.org/abs/2003.03123)
19+
- Equivariant GNNs using cartesian vectors: [E(n) Equivariant GNN](https://proceedings.mlr.press/v139/satorras21a.html), [GVP-GNN](https://arxiv.org/abs/2009.01411)
20+
- Equivariant GNNs using spherical tensors: [Tensor Field Network](https://arxiv.org/abs/1802.08219), [MACE](http://arxiv.org/abs/2206.07697)
21+
22+
## Experiments
23+
24+
The `/experiments` directory contains notebooks with synthetic experiments to highlight practical challenges in building powerful geometric GNNs:
25+
- `kchains.ipynb`: Distinguishing k-chains, which test a model's ability to propagate geometric information non-locally and demonstrate oversquashing with increased depth.
26+
- `rotsym.ipynb`: Rotationally symmetric structures, which test a layer's ability to identify neighbourhood orientation and highlight the utility of higher order tensors in equivariant GNNs.
27+
- `incompleteness.ipynb`: Counterexamples from [Pozdnyakov et al.](https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.125.166001), which test a layer's ability to create distinguishing fingerprints for local neighbourhoods and highlight the need for higher order scalarisation.
28+
29+
30+
31+
## Installation
32+
33+
```bash
34+
# Create new conda environment
35+
conda create -n pyg python=3.8
36+
37+
# Install PyTorch (Check CUDA version!)
38+
conda install pytorch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1 cudatoolkit=11.3 -c pytorch
39+
40+
# Install PyG
41+
conda install pyg -c pyg -c conda-forge
42+
43+
# Install other dependencies
44+
pip3 install e3nn==0.4.4
45+
conda install matplotlib pandas networkx
46+
pip3 install ipdb ase
47+
conda install jupyterlab -c conda-forge
48+
```
49+
50+
51+
52+
## Directory Structure and Usage
53+
54+
```
55+
.
56+
├── README.md
57+
|
58+
├── experiments # Synthetic experiments
59+
│ ├── incompleteness.ipynb # Experiment on counterexamples from Pozdnyakov et al.
60+
│ ├── kchains.ipynb # Experiment on k-chains
61+
│ └── rotsym.ipynb # Experiment on rotationally symmetric structures
62+
|
63+
└── src # Geometric GNN models library
64+
├── models.py # Models built using layers
65+
├── gvp_layers.py # Layers for GVP-GNN
66+
├── egnn_layers.py # Layers for E(n) Equivariant GNN
67+
├── tfn_layers.py # Layers for Tensor Field Networks
68+
├── modules # Layers for MACE
69+
└── utils # Helper functions for training, plotting, etc.
70+
```
71+
72+
73+
74+
## Citation
75+
76+
```
77+
@article{joshi2022expressive,
78+
title={On the Expressive Power of Geometric Graph Neural Networks},
79+
author={Joshi, Chaitanya K. and Bodnar, Cristian and Mathis, Simon V. and Cohen, Taco and Liò, Pietro},
80+
journal={NeurIPS Workshop on Symmetry and Geometry in Neural Representations},
81+
year={2022},
82+
}
83+
```

experiments/__init__.py

Whitespace-only changes.

experiments/fig/incompleteness.png

2.7 MB
Loading

experiments/fig/kchains.png

126 KB
Loading

experiments/fig/rotsym.png

197 KB
Loading

0 commit comments

Comments
 (0)