Code Monkey home page Code Monkey logo

ign-convergence-code's Introduction

Invariant and Equivariant Graph Networks (PyTorch)

A PyTorch implementation of The ICLR 2019 paper "Invariant and Equivariant Graph Networks" by Haggai Maron, Heli Ben-Hamu, Nadav Shamir and Yaron Lipman https://openreview.net/forum?id=Syx72jC9tm. The official TensorFlow implementation is at https://github.com/Haggaim/InvariantGraphNetworks

Data

Data should be downloaded from: https://www.dropbox.com/s/vjd6wy5nemg2gh6/benchmark_graphs.zip?dl=0. Run the following commands in order to unzip the data and put its proper path.

mkdir data
unzip benchmark_graphs.zip -d data

Prerequisites

Python3

PyTorch 1.5.0

Additional modules: numpy, pandas, matplotlib, easydict, tqdm, pandas

TensorFlow is not neccessary except if you want to run the tests (comparisons) between the PyTorch and TensorFlow versions.

Running the tests

Run the tests comparing between PyTorch and TensorFlow versions' tensor contractions. All tensor contractions are implemented 1-to-1. The two versions have identical tensor contractions:

cd layers/
python3 test_tensorflow_pytorch_contractions.py

Run the (permutation) equivariance tests for the equivariant linear layers implemented in PyTorch (e.g. permute the input tensor and the output tensor must transform covariantly):

python3 test_pytorch_layers.py

Running the experiment

The folder main_scripts contains scripts that run different experiments:

  1. To run 10-fold cross-validation with our hyper parameters run the main_10fold_experiment.py script. You can choose the datase in 10fold_config.json.
  2. To run hyper-parameter search, run the main_parameter_search.py script with the corresponding config file
  3. To run training and evaluation on one of the data sets run the main.py script

example to run 10-fold cross-validation experiment:

cd main_scripts/
python3 -m main_10fold_experiment --config=../configs/10fold_config.json

Note

PyTorch implementation of tensor contractions and equivariant linear layers is in:

layers/equivariant_linear_pytorch.py

PyTorch implementation of invariant (basic) graph nets:

models/invariant_basic.py

ign-convergence-code's People

Contributors

chen-cai-osu avatar

Stargazers

 avatar

Watchers

 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.