Git Product home page Git Product logo

pde-net's Introduction

PDE-Net

The code are for the paper

PDE-Net: Learning PDEs from Data(ICML 2018)
Long Zichao, Lu Yiping, Ma Xianzhong and Dong Bin

If you find the code useful in your research then please cite

@inproceedings{long2018pde,
  title={PDE-Net: Learning PDEs from Data},
  author={Long, Zichao and Lu, Yiping and Ma, Xianzhong and Dong, Bin},
  booktitle={International Conference on Machine Learning},
  pages={3214--3222},
  year={2018}
}

Setup

All code were developed and tested on CentOS 7 with Python 3.6, and were implemented by pytorch 0.3.1

The code are based on a submodule: aTEAM, a pyTorch Extension for Applied Mathematics. One can either download a proper version of aTEAM and extract it to some directory in your python path with name 'aTEAM', or use 'git submodule' to set up the dependency.

For example, you can create a conda environment and set up PDE-Net like this:

conda create -n PDE-Net python=3.6 scipy pyyaml jupyter matplotlib
source activate PDE-Net
conda install pytorch=0.3.1 torchvision cuda90 -c pytorch
git clone [email protected]:ZichaoLong/PDE-Net.git
cd PDE-Net
git checkout PDE-Net # switch your branch from 'master' to the 'PDE-Net'
git submodule init
git submodule update

Training, Testing and Plot

Model example of config file training testing plot
Convection-Diffusion Equations checkpoint/linpde.yaml learn_variantcoelinear2d.py linpdetest.py linpdeplot.py
Diffusion Equations with Nonlinear Source checkpoint/nonlinpde.yaml learn_singlenonlinear2d.py nonlinpdetest.py nonlinpdeplot.py

Training

  • Default options can be found in learn_variantcoelinear.py and learn_singlenonlinear2d.py. You can simply modify the default options in learn_variantcoelinear.py(learn_singlenonlinear2d.py), and simply run code like:
python learn_variantcoelinear2d.py
  • Configure training by command line options:
TASKDESCRIPTOR=linpde-test
python learn_variantcoelinear2d.py --taskdescriptor=$TASKDESCRIPTOR \
  --kernel_size=7 --max_order=4 --constraint=moment

Training information and learned parameters will be stored in checkpoint/${TASKDESCRIPTOR}.

Testing

python linpdetest.py $TASKDESCRIPTOR
# or python nonlinpdetest.py $TASKDESCRIPTOR

Then the testing results will be stored in checkpoint/$TASKDESCRIPTOR/errs.pkl.

Show Results

Set your TASKDESCRIPTOR in *test.py, *plot.py, errs_compare.py and run.

Pretrained Model

Download pretrained models and make your working directory like this:

PDE-Net/
  aTEAM/
  figures/
  learn_variantcoelinear2d.py
  linpdetest.py
  ...
  checkpoint/
      linpde5x5frozen4order0.015dt0.015noise-double/
      linpde5x5moment4order0.015dt0.015noise-double/
      linpde7x7frozen4order0.015dt0.015noise-double/
      linpde7x7moment4order0.015dt0.015noise-double/
      nonlinpde7x7frozen2order-double/
      nonlinpde7x7moment2order-double/

pde-net's People

Contributors

zichaolong avatar wangkai9608 avatar

Watchers

 avatar paper2code - bot 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.