Skip to main content

Physics Informed Neural Network with JAX

Project description

jinns

status coverage

Physics Informed Neural Networks with JAX. jinns is a Python package for physics-informed neural networks (PINNs) in the JAX ecosystem. It provides an intuitive and flexible interface for

  • forward problem: learning a PDE solution.
  • inverse problem: learning the parameters of a PDE. See jinns.solve_alternate() for fine-grained and efficient inverse problems.
  • meta-modeling: learning a family of PDE indexed by its parameters.
  • New in jinns v1.9.2: Second order optimizers which greatly enhances the training of PINNs. We recommend testing them as default optimizers.

jinns specific points:

  • jinns uses JAX - It is directed to JAX users: forward and backward autodiff, vmapping, jitting and more! No reinventing the wheel: it relies on the JAX ecosystem whenever possible, such as equinox for neural networks or optax for optimization.

  • jinns is highly modular - It gives users maximum control for defining their problems, and extending the package. The maths and computations are visible and not hidden behind layers of code!

  • jinns is efficient - It compares favorably to other existing Python package for PINNs on the PINNacle benchmarks, as demonstrated in the table below. For more details on the benchmarks, checkout the PINN multi-library benchmark

  • Implemented PINN architectures

    • Vanilla Multi-Layer Perceptron popular accross the PINNs litterature.

    • Separable PINNs: allows to leverage forward-mode autodiff for computational speed.

    • Hyper PINNs: useful for meta-modeling

  • Other

    • Adaptative Loss Weights are now implemented. Some SoftAdapt, LRAnnealing and ReLoBRaLo are available and users can implement their own strategy. See the tutorial
  • Get started: check out our various notebooks on the documentation.

jinns DeepXDE - JAX DeepXDE - Pytorch PINA Nvidia Modulus
Burgers1D 445 723 671 1977 646
NS2d-C 265 278 441 1600 275
PInv 149 218 CC 1509 135
Diffusion-Reaction-Inv 284 NI 3424 4061 2541
Navier-Stokes-Inv 175 NI 1511 1403 498

Training time in seconds on an Nvidia T600 GPU. NI means problem cannot be implemented in the backend, CC means the code crashed.

A diagram of jinns workflow

Installation

Install the latest version with pip

pip install jinns

Documentation

The project's documentation is hosted on Gitlab page and available at https://mia_jinns.gitlab.io/jinns/index.html.

Found a bug / want a feature ?

Open an issue on the Gitlab repo.

Contributing

Here are the contributors guidelines:

  1. First fork the library on Gitlab.

  2. Then clone and install the library in development mode with

pip install -e .
  1. Install pre-commit and run it. Our pre-commit hooks consist in ruff format and ruff check. You can install ruff simply by pip install ruff. We highly recommend you to check the code type hints with pyright even though we currently have no rule concerning type checking in the pipeline.
pip install pre-commit
pre-commit install
  1. Open a merge request once you are done with your changes, the review will be done via Gitlab.

Contributors

Don't hesitate to contribute and get your name on the list here !

List of contributors: Hugo Gangloff, Nicolas Jouvin, Lucia Clarotto, Inass Soukarieh, Mohamed Badi

Cite us

Please consider citing our work if you found it useful to yours, using this ArXiV preprint

@article{gangloff_jouvin2024jinns,
  title={jinns: a JAX Library for Physics-Informed Neural Networks},
  author={Gangloff, Hugo and Jouvin, Nicolas},
  journal={arXiv preprint arXiv:2412.14132},
  year={2024}
}

Acknowledgement

The library benefited from discussions with other researchers and devs. Special thanks to the Scimba library team, go check out their work if you are interested in sciML and hybrid numerical methods !

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

jinns-1.9.4.tar.gz (20.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jinns-1.9.4-py3-none-any.whl (159.5 kB view details)

Uploaded Python 3

File details

Details for the file jinns-1.9.4.tar.gz.

File metadata

  • Download URL: jinns-1.9.4.tar.gz
  • Upload date:
  • Size: 20.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for jinns-1.9.4.tar.gz
Algorithm Hash digest
SHA256 d52d02f59a023feb37138e4a430a4dae42e6599f962d39821b1d6b91877914b4
MD5 ac2a4cb68e83a1678555be105ba2a67e
BLAKE2b-256 f835ee825fcc9e1c7c3a9979af7a6afb3eb86b0eef364dfe45e5238625d4cb96

See more details on using hashes here.

File details

Details for the file jinns-1.9.4-py3-none-any.whl.

File metadata

  • Download URL: jinns-1.9.4-py3-none-any.whl
  • Upload date:
  • Size: 159.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for jinns-1.9.4-py3-none-any.whl
Algorithm Hash digest
SHA256 055ef0a699fc26e0263702b59b60effdfde40213e5c00732256a19b033062bd3
MD5 c1a0101d7556c2583a24ea4a2d7a97a8
BLAKE2b-256 0b1ae04f9286c7b8b61ffeaa152d6c408657b4793c00b11f018de589f6a841bc

See more details on using hashes here.

Supported by

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