Skip to main content

pinnrl

pinnrl

PyPI Checks Python 3.10+ License: MIT

Physics-informed neural networks for forward and inverse PDE problems, evaluated against numerical references.

A PINN represents the solution of a PDE as a neural network, trained to satisfy the equation, its boundary and initial conditions, and any measured data. pinnrl provides:

  • Your own equations: CustomPDE("u_t + u*u_x - nu*u_xx", domain={"x": (-1, 1), "t": (0, 1)}, parameters={"nu": 0.01}) turns a residual written as text (or a Python function) into a trainable problem: PDEs, ODEs, steady problems and systems in any number of dimensions, with identifiable parameters. A catalogue of 42 ready equations comes with it.
  • 10 shipped PDE configurations: heat (1-D, 2-D), wave, Burgers, convection, KdV, Allen–Cahn, Cahn–Hilliard, Black–Scholes and a damped pendulum. Each exact solution is checked by the test suite against its PDE, initial condition and boundary conditions.
  • 7 architectures: MLP, ResNet, Fourier features, SIREN, FNO-style, attention and autoencoder.
  • Collocation sampling: uniform, stratified, residual-based adaptive (RAD), and an experimental reinforcement-learning bandit.
  • Inverse problems: identify PDE parameters from noisy observations.
  • The Well: train on 11 high-fidelity simulation datasets.
  • A dashboard to launch, monitor and compare runs, and benchmarks with reference solutions and a multi-seed sampling study.

Install

pip install pinnrl              # Python 3.10–3.13; CPU, Apple GPU (mps) or CUDA
pip install 'pinnrl[well]'      # + The Well dataset loaders

Use

pinnrl-train --pde burgers --arch fourier --epochs 2000                          # results in ./runs/
pinnrl-train --pde heat --arch fourier --mode inverse --identify alpha --initial-guess alpha=0.5
pinnrl-dashboard                                                                 # http://127.0.0.1:8050/
pinnrl-benchmark sampling --seeds 10                                             # uniform, stratified, RAD, RL bandit
pinnrl-train --pde-file my_equation.yaml --arch fourier                           # your own equation, from YAML
from pinnrl import CustomPDE

pde = CustomPDE("u_t - alpha*u_xx", domain={"x": (0, 1), "t": (0, 1)}, parameters={"alpha": 0.1},
                initial_condition="sin(pi*x)", boundary_conditions={"dirichlet": {"value": 0.0}},
                exact_solution="exp(-alpha*pi^2*t)*sin(pi*x)")
trainer = pde.build_trainer("fourier", num_epochs=150, num_collocation_points=1024, batch_size=1024,
                            learning_rate=2e-3, early_stopping={"enabled": False})
trainer.train(progress=False)
print(pde.validate(trainer.model)["l2_error"])

The Python API is the same pieces the CLI uses: a PDE (CustomPDE, or a PDEConfig with a shipped class), a PINNModel and PDETrainer. See Custom equations and Getting started.

When a PINN is the right tool

For a well-posed forward problem in low dimension, classical solvers are faster and far more accurate; the docs show the numbers. PINNs pay off for inverse problems, for combining physics with sparse data, and for mesh-free or high-dimensional settings. The project's direction is the first of these applied to industry: digital twins that estimate unmeasured states of process equipment (first target: evaporators and spray dryers in food-powder plants). See Applications and the Research program.

Documentation

josegarciav.github.io/PINNs-RL-PDE: concepts, the equations, guides, benchmarks, the API reference and the roadmap. The tutorials are in notebooks/, and research studies in experiments/.

Contributing

See CONTRIBUTING.md. In short: uv sync --all-extras, uv run pytest, conventional commits, and physics changes must keep tests/unit_tests/test_physics_consistency.py green.

Citation

pinnrl started as the MSc thesis On Solving Partial Differential Equations (PDEs) Using Physics-Informed Neural Networks (PINNs) (University of the Basque Country UPV/EHU, 2025); the thesis is at docs/assets/thesis.pdf.

@software{garcia_pinnrl,
  author = {Garcia Ventura, Jose},
  title  = {pinnrl: physics-informed neural networks with adaptive collocation sampling},
  url    = {https://github.com/josegarciav/PINNs-RL-PDE}
}

MIT License © Jose Garcia Ventura

Metadata

Release files for pinnrl 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pinnrl 0.5.0
File Size Uploaded Provenance Actions
pinnrl-0.5.0.tar.gz 241.8 kB With provenance Details for pinnrl-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pinnrl 0.5.0
File Interpreter ABI Platform Actions
pinnrl-0.5.0-py3-none-any.whl Python 3 none any Details for pinnrl-0.5.0-py3-none-any.whl

Total release size: 414.8 kB

Release files / pinnrl-0.5.0.tar.gz

Download URL pinnrl-0.5.0.tar.gz
Size 241.8 kB
Tags Source
SHA-256 checksum
How to use checksums
649ca4748dc3b85e7564c667ee759ca713a2d0da3410d69fd696898a0d4169ef
BLAKE2b-256 checksum
How to use checksums
60ce6dc422d4d879b1fe6587c6fd3a09cc1e7c8014447e48dc2cb647d15285db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / pinnrl-0.5.0-py3-none-any.whl

Download URL pinnrl-0.5.0-py3-none-any.whl
Size 173.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
276d166a2cce8d925ab031821be895cf95d13cd4a1037f90e7ce25fa9e77e61b
BLAKE2b-256 checksum
How to use checksums
37eb1d8043191e8b284b07ad31c4c3a049164c103885b1dab56b76c6d54e538b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Security for pinnrl 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pinnrl-0.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page