Sparse Physics-based and Interpretable Neural Networks

Related tags

Deep LearningSPINN
Overview

Sparse Physics-based and Interpretable Neural Networks for PDEs

This repository contains the code and manuscript for research done on Sparse Physics-based and Interpretable Neural Networks for PDEs. More details are available in the following publication:

  • Amuthan A. Ramabathiran and Prabhu Ramachandran^, "SPINN: Sparse, Physics-based, and partially Interpretable Neural Networks for PDEs", Journal of Computational Physics, Volume 445, pages 110600, 2021 doi:10.1016/j.jcp.2021.110600. (^ Joint first author). arXiv:2102.13037.

Installation

Running the code in this repository requires a few pre-requisites to be set up. The Python packages required are in the requirements.txt. Here are some instructions to help you set these up:

  1. Setup a suitable Python distribution, using conda or a virtualenv.

  2. Clone this repository:

    $ git clone https://github.com/nn4pde/SPINN.git
    $ cd SPINN
  1. If you use conda, run the following from your Python environment:
    $ conda env create -f environment.yml
    $ conda activate spinn
  1. If you use a virtualenv or some other Python distribution and wish to use pip:
    $ pip install -r requirements.txt

Once you install the packages you should hopefully be able to run the examples. The examples all support live-plotting of the results. Matplotlib is required for the live plotting of any of the 1D problems and Mayavi is needed for any 2D/3D problems. These are already specified in the requirements.txt and environments.yml files.

Running the code

All the problems discussed in the paper are available in the code subdirectory. The supplementary text in the paper discusses the design of the code at a very high level. You can run any of the problems as follows:

  $ cd code
  $ python ode3.py -h

And this will provide a variety of help options that you can use. You can see the results live by doing:

  $ python ode3.py --plot

These require matlplotlib.

The 2D problems also feature live plotting with Mayavi if it is installed, for example:

  $ python advection1d.py --plot

You should see the solution as well as the computational nodes. Where applicable you can see an exact solution as a wireframe.

If you have a GPU and it is configured to work with PyTorch, you can use it like so:

  $ python poisson2d_irreg_dom.py --gpu

Generating the results

All the results shown in the paper are automated using the automan package which should already be installed as part of the above installation. This will perform all the required simulations (this can take a while) and also generate all the plots for the manuscript.

To learn how to use the automation, do this:

    $ python automate.py -h

By default the simulation outputs are in the outputs directory and the final plots for the paper are in manuscript/figures.

To generate all the figures in one go, run the following (this will take a while):

    $ python automate.py

If you wish to only run a particular set of problems and see those results you can do the following:

   $ python automate.py PROBLEM

where PROBLEM can be any of the demonstrated problems. For example:

  $ python automate.py ode1 heat cavity

Will only run those three problems. Please see the help output (-h) and look at the code for more details.

By default we do not need to use a GPU for the automation but if you have one, you can edit the automate.py and set USE_GPU = True to make use of your GPU where possible.

Building the paper

Once you have generated all the figures from the automation you can easily compile the manuscript. The manuscript is written with LaTeX and if you have that installed you may do the following:

$ cd manuscript
$ latexmk spinn_manuscript.tex -pdf
Understanding the Properties of Minimum Bayes Risk Decoding in Neural Machine Translation.

Understanding Minimum Bayes Risk Decoding This repo provides code and documentation for the following paper: Müller and Sennrich (2021): Understanding

ZurichNLP 13 May 01, 2022
Implementation of FSGNN

FSGNN Implementation of FSGNN. For more details, please refer to our paper Experiments were conducted with following setup: Pytorch: 1.6.0 Python: 3.8

19 Dec 05, 2022
PyTorch implementation of Histogram Layers from DeepHist: Differentiable Joint and Color Histogram Layers for Image-to-Image Translation

deep-hist PyTorch implementation of Histogram Layers from DeepHist: Differentiable Joint and Color Histogram Layers for Image-to-Image Translation PyT

Winfried Lötzsch 10 Dec 06, 2022
Qlib is an AI-oriented quantitative investment platform

Qlib is an AI-oriented quantitative investment platform, which aims to realize the potential, empower the research, and create the value of AI technologies in quantitative investment.

Microsoft 10.1k Dec 30, 2022
MAVE: : A Product Dataset for Multi-source Attribute Value Extraction

MAVE: : A Product Dataset for Multi-source Attribute Value Extraction The dataset contains 3 million attribute-value annotations across 1257 unique ca

Google Research Datasets 89 Jan 08, 2023
Repo for "TableParser: Automatic Table Parsing with Weak Supervision from Spreadsheets" at [email protected]

TableParser Repo for "TableParser: Automatic Table Parsing with Weak Supervision from Spreadsheets" at DS3 Lab 11 Dec 13, 2022

Jittor 64*64 implementation of StyleGAN

StyleGanJittor (Tsinghua university computer graphics course) Overview Jittor 64

Song Shengyu 3 Jan 20, 2022
A general, feasible, and extensible framework for classification tasks.

Pytorch Classification A general, feasible and extensible framework for 2D image classification. Features Easy to configure (model, hyperparameters) T

Eugene 26 Nov 22, 2022
MVS2D: Efficient Multi-view Stereo via Attention-Driven 2D Convolutions

MVS2D: Efficient Multi-view Stereo via Attention-Driven 2D Convolutions Project Page | Paper If you find our work useful for your research, please con

96 Jan 04, 2023
Oriented Response Networks, in CVPR 2017

Oriented Response Networks [Home] [Project] [Paper] [Supp] [Poster] Torch Implementation The torch branch contains: the official torch implementation

ZhouYanzhao 217 Dec 12, 2022
SNIPS: Solving Noisy Inverse Problems Stochastically

SNIPS: Solving Noisy Inverse Problems Stochastically This repo contains the official implementation for the paper SNIPS: Solving Noisy Inverse Problem

Bahjat Kawar 35 Nov 09, 2022
Official implementation of the paper "AAVAE: Augmentation-AugmentedVariational Autoencoders"

AAVAE Official implementation of the paper "AAVAE: Augmentation-AugmentedVariational Autoencoders" Abstract Recent methods for self-supervised learnin

Grid AI Labs 48 Dec 12, 2022
A PyTorch implementation of NeRF (Neural Radiance Fields) that reproduces the results.

NeRF-pytorch NeRF (Neural Radiance Fields) is a method that achieves state-of-the-art results for synthesizing novel views of complex scenes. Here are

Yen-Chen Lin 3.2k Jan 08, 2023
Alternatives to Deep Neural Networks for Function Approximations in Finance

Alternatives to Deep Neural Networks for Function Approximations in Finance Code companion repo Overview This is a repository of Python code to go wit

15 Dec 17, 2022
Simple and understandable swin-transformer OCR project

swin-transformer-ocr ocr with swin-transformer Overview Simple and understandable swin-transformer OCR project. The model in this repository heavily r

Ha YongWook 67 Dec 31, 2022
A python script to dump all the challenges locally of a CTFd-based Capture the Flag.

A python script to dump all the challenges locally of a CTFd-based Capture the Flag. Features Connects and logins to a remote CTFd instance. Dumps all

Podalirius 77 Dec 07, 2022
High performance distributed framework for training deep learning recommendation models based on PyTorch.

High performance distributed framework for training deep learning recommendation models based on PyTorch.

340 Dec 30, 2022
KinectFusion implemented in Python with PyTorch

KinectFusion implemented in Python with PyTorch This is a lightweight Python implementation of KinectFusion. All the core functions (TSDF volume, fram

Jingwen Wang 80 Jan 03, 2023
Ray tracing of a Schwarzschild black hole written entirely in TensorFlow.

TensorGeodesic Ray tracing of a Schwarzschild black hole written entirely in TensorFlow. Dependencies: Python 3 TensorFlow 2.x numpy matplotlib About

5 Jan 15, 2022
【ACMMM 2021】DSANet: Dynamic Segment Aggregation Network for Video-Level Representation Learning

DSANet: Dynamic Segment Aggregation Network for Video-Level Representation Learning (ACMMM 2021) Overview We release the code of the DSANet (Dynamic S

Wenhao Wu 46 Dec 27, 2022