Skip to main content

Partial Differential Equation Network Generator

Project description

PDE-NetGen : from symbolic PDE representations of physical processes to trainable neural network representations.


Contents


Introduction

Bridging physics and deep learning is a topical challenge. While deep learning frameworks open avenues in physical science, the design of physically-consistent deep neural network architectures is an open issue. In the spirit of physics-informed NNs, PDE-NetGen package provides new means to automatically translate physical equations, given as PDEs, into neural network architectures. PDE-NetGen combines symbolic calculus and a neural network generator. The later exploits NN-based implementations of PDE solvers using Keras. With some knowledge of a problem, PDE-NetGen is a plug-and-play tool to generate physics-informed NN architectures. They provide computationally-efficient yet compact representations to address a variety of issues, including among others adjoint derivation, model calibration, forecasting, data assimilation as well as uncertainty quantification. As an illustration, the workflow is first presented for the 2D diffusion equation, then applied to the data-driven and physics-informed identification of uncertainty dynamics for the Burgers equation.

  • O. Pannekoucke and R. Fablet, “PDE-NetGen 1.0: from symbolic partial differential equation (PDE) representations of physical processes to trainable neural network representations,” Geoscientific Model Development, vol. 13, no. 7, pp. 3373–3382, Jul. 2020, doi: 10.5194/gmd-13-3373-2020.
This work has been supported by the French INSU-LEFE, grant KAPA
logo lefe

Example

Implementation of a simple PDE: the 2D diffusion equation

A diffusion over a 2D domain can be implemented as

Implementation of a 2D diffusion equation

(see the notebook ./example/pdenetgen-diffusion2D.ipynb)

Estimation of an unknown physical term

As an example, we consider a situation that can be encountered in physics where the dynamics makes appear an unkown term to determine from a dataset. For the illustration, we consider the dynamics

pkf-system

where the term unknown term is unkown.

With PDE-NetGen, we can design a closure from the data. For the illustration we consider a candidate for the closure, given by

pkf-closure

where $(a,b,c)$ are unkowns.

Two implementations can be considered.

1. Implementation using TrainableScalar

This is implemented by using TrainableScalar as follows:

  1. the candidate for the closure is defined as a symbolic level
  2. a neural network that implement the full dynamics (including the closure) is then generated and ready for the training

Implementation of a closure

The use of TrainableScalar is the simplest way to try a closure designed from partial derivatives.

(see the notebook ./example/pdenetgen-NN-PKF_burgers_learn-TrainableScalar-closure.ipynb)

2. Implementation using an external neural network (the exogenous case)

Another implemention is possible that relies on the introduction of an external neural network, for instance a deep neural network of your choice that you have to build by yourself and that can be plugged to the neural network generated from Eq.(7) .

(see the notebook ./example/pdenetgen-NN-PKF_burgers_learn-exogenous-closure.ipynb where the closure is provided as the implementation of Eq.(8) -- you can try your own NN that can be different from the candidate Eq.(8))

Install

Using pip

PDE-NetGen is available from pip, and can be installed as pip install pdenetgen

From github

  1. Clone the repository git clone https://github.com/opannekoucke/pdenetgen.git
  2. Install the package make install (or python setup.py install)
  3. Examples are given as jupyter notebooks (see ./example/)

Remove pdenetgen

pip uninstall pdenetgen

Citation

Pannekoucke, O. and Fablet, R.: PDE-NetGen 1.0: from symbolic partial differential equation (PDE) representations of physical processes to trainable neural network representations, Geosci. Model Dev., 13, 3373–3382, https://doi.org/10.5194/gmd-13-3373-2020, 2020.

@Article{Pannekoucke2020GMD,
  author    = {Olivier Pannekoucke and Ronan Fablet},
  journal   = {Geoscientific Model Development},
  title     = {{PDE}-{NetGen} 1.0: from symbolic partial differential equation ({PDE}) representations of physical processes to trainable neural network representations},
  year      = {2020},
  month     = {jul},
  number    = {7},
  pages     = {3373--3382},
  volume    = {13},
  doi       = {10.5194/gmd-13-3373-2020},
  publisher = {Copernicus {GmbH}},  
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pdenetgen-1.0.2.tar.gz (41.9 kB view details)

Uploaded Source

Built Distributions

pdenetgen-1.0.2-py3.8.egg (94.6 kB view details)

Uploaded Source

pdenetgen-1.0.2-py3-none-any.whl (49.5 kB view details)

Uploaded Python 3

File details

Details for the file pdenetgen-1.0.2.tar.gz.

File metadata

  • Download URL: pdenetgen-1.0.2.tar.gz
  • Upload date:
  • Size: 41.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/3.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for pdenetgen-1.0.2.tar.gz
Algorithm Hash digest
SHA256 b64bee26436c504abb7fca3d8238b626288cf72e8cc4148538479a6248c6d5f4
MD5 2f76692d81a5996b2bd7562840c1d920
BLAKE2b-256 eaca3f90cac284c75ec52f868a9a7a925b0faff3fe08d6527130238649ec4bb3

See more details on using hashes here.

File details

Details for the file pdenetgen-1.0.2-py3.8.egg.

File metadata

  • Download URL: pdenetgen-1.0.2-py3.8.egg
  • Upload date:
  • Size: 94.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/3.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for pdenetgen-1.0.2-py3.8.egg
Algorithm Hash digest
SHA256 869d3d264f7a0e768dfe0ee56e0b151f10cd50cee9f28e0678f4d8e3e5cdc08a
MD5 25b95bba24b296a61ccadcf0a8672093
BLAKE2b-256 6c2e0b32e98e2bd0a54d5d8085d6e544fe06b72f863222ccffa4e28c4ca0c1cb

See more details on using hashes here.

File details

Details for the file pdenetgen-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: pdenetgen-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 49.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/3.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for pdenetgen-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 11929781c5b09771ee6be02a03ada4fcab1eb544747415697c5b7bd1c105638b
MD5 20aa0c084ec1a0f214ce23c14900642b
BLAKE2b-256 8518feba1f7943266aca56d630d2d8991b60e07b5e95f7c8e62c6df0048cb19f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page