Giter Site home page Giter Site logo

cheukwaylee / dropgnn Goto Github PK

View Code? Open in Web Editor NEW

This project forked from karolismart/dropgnn

0.0 0.0 0.0 22 KB

The official implementation of DropGNN: Random Dropouts Increase the Expressiveness of Graph Neural Networks (NeurIPS 2021)

License: MIT License

Python 100.00%

dropgnn's Introduction

DropGNN

This is the official implementation of DropGNN: Random Dropouts Increase the Expressiveness of Graph Neural Networks as described in the following NeurIPS 2021 paper:

@InProceedings{papp2021dropgnn,
  title={DropGNN: Random Dropouts Increase the Expressiveness of Graph Neural Networks}, 
  author={Papp, P{\'a}l Andr{\'a}s and Martinkus, Karolis and Faber, Lukas and Wattenhofer, Roger}, 
  booktitle={35th Conference on Neural Information Processing Systems (NeurIPS)},
  year={2021}
}

Dependencies

The implementation uses Python (3.8), PyTorch (1.9) and PyTorch Geometric (1.7). You can create a conda environment with all of the required packages:
conda env create -f environment.yml
conda activate DropGNN

Runing The Experiments

Each experiment and base model are in an individual Python file and can be run individaully from the command line.

Synthetic Benchmarks

Synthetic datasets and the GIN model with the corresponding augmentations is implemented in gin-synthetic.py You can run experiments on the dataset you whish ['skipcircles', 'triangles', 'lcc', 'limitsone', 'limitstwo', 'fourcycles'] using either of the augmentations ['none', 'ports', 'ids', 'random', 'dropout']:

python gin-synthetic.py --augmentation 'dropout' --use_aux_loss --dataset 'lcc'

DropGNN model version (dropout augmentation) should be run with --use_aux_loss flag, for other augmentations this option is ignored. For SkipCircles (skipcircles) dataset we use --num_layers 9 flag with all augmentations.

The number of runs and dropout probability ablations can be run using the following commands:

python gin-synthetic.py --augmentation 'dropout' --use_aux_loss --dataset 'limitsone' --num_runs_ablation

python gin-synthetic.py --augmentation 'dropout' --use_aux_loss --dataset 'limitsone' --prob_ablation

Graph Classification

Graph classification experiment code can be found in gin-graph_classification.py. You can run the DropGIN model on one of the datasets ['MUTAG', 'PTC', 'PROTEINS', 'IMDB-BINARY', 'IMDB-MULTI'] using the following command:

python gin-graph_classification.py --drop_gnn --use_aux_loss --dataset 'MUTAG'

To perform the grid search as done in the orginal GIN paper add --grid_search option. To run the grid search on SLURM cluster using GPUs use --slurm and --gpu_jobs options. The code is currently setup for grid search on the bio datasets. To run grid search on social IMDB datasets as described in the paper (with fixed number of hidden units) set tunable=False for the hidden_units option on line 323.

Graph Property Regression

Code for QM9 experiment with DropMPNN and Drop-1-GNN models can be respectively found in mpnn-qm9.py and 1-gnn-qm9.py files. You can run the DropGNN experiments using the following commands:

python mpnn-qm9.py --drop_gnn --aux_loss --target 0

python 1-gnn-qm9.py --drop_gnn --aux_loss --target 0

The --target flag specifies which of the 12 graph properties the model should fit.

Note that the code reports energy values in eV, while in the paper they are converted to Hartree.

dropgnn's People

Contributors

karolismart avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.