-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added readme, requirements and license
- Loading branch information
Showing
5 changed files
with
73 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 Gabriele Corso, Luca Cavalleri | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Principal Neighbourhood Aggregation | ||
|
||
Principal Neighbourhood Aggregation for GNNs [https://arxiv.org/abs/XXX](https://arxiv.org/abs/XXX) | ||
|
||
## Overview | ||
|
||
We provide the implementation of the Principal Neighbourhood Aggregation (PNA) in PyTorch along with scripts to generate the multitask benchmarks, a flexible GNN framework and implementations of the other models used for comparison. The repository is organised as follows: | ||
- `datasets_generation/` contains the scripts for the generation of the benchmarks | ||
- `models/` contains: | ||
- the implementation of the aggregators, the scalers and the PNA layer (`/pna/`) | ||
- the flexible GNN framework that can be used with any type of graph convolutions (`gnn_framework.py`) | ||
- implementations of the other GNN models used for comparison in the paper, namely GCN, GAT, GIN and MPNN | ||
- `util/` contains | ||
- preprocessing subroutines and loss functions (`util.py`) | ||
- training and evaluation procedures (`train.py`) | ||
- general NN layers used by the various models (`layers.py`) | ||
|
||
## Dependencies | ||
Install PyTorch from the [official website](https://pytorch.org/). The code was tested over PyTorch 1.4. | ||
|
||
Then install the other dependencies: | ||
``` | ||
pip install -r requirements.txt | ||
``` | ||
|
||
## Test run | ||
|
||
Generate the benchmark dataset (add `--extrapolation` for multiple test sets of different sizes): | ||
``` | ||
python -m datasets_generation.multitask_dataset | ||
``` | ||
|
||
then run the training, for example: | ||
``` | ||
python -m models.pna.train --variable --fixed --gru --variable_conv_layers=N/2 --aggregators="mean max min std" --scalers="identity amplification attenuation" --data=data/multitask_dataset.pkl | ||
``` | ||
|
||
The model specified by the arguments above uses the same architecture (represented in the image below) and the same aggregators and scalers as used for the results in the paper. Note that the default hyper-parameters are not the best performing for every model, refer to the paper for details on how we set them. | ||
|
||
 | ||
|
||
|
||
## Reference | ||
... | ||
|
||
## License | ||
MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
numpy | ||
networkx | ||
matplotlib | ||
torch |