Skip to main content

PINNx: Physics-Informed Neural Networks for Scientific Machine Learning in JAX

Header image of pinnx.

Build Status Documentation Status PyPI Version License

PINNx is a library for scientific machine learning and physics-informed learning in JAX. It is a rewrite of DeepXDE but is enhanced by our brain modeling ecosystem. For example, it leverages

  • brainstate for just-in-time compilation,
  • saiunit for dimensional analysis,
  • braintools for checkpointing, loss functions, and other utilities.

Quickstart

Define a PINN with explicit variables and physical units.

import braintools
import saiunit as u
import pinnx

# geometry
geometry = pinnx.geometry.GeometryXTime(
    geometry=pinnx.geometry.Interval(-1, 1.),
    timedomain=pinnx.geometry.TimeDomain(0, 0.99)
).to_dict_point(x=u.meter, t=u.second)

uy = u.meter / u.second
v = 0.01 / u.math.pi * u.meter ** 2 / u.second

# boundary conditions
bc = pinnx.icbc.DirichletBC(lambda x: {'y': 0. * uy})
ic = pinnx.icbc.IC(lambda x: {'y': -u.math.sin(u.math.pi * x['x'] / u.meter) * uy})

# PDE equation
def pde(x, y):
    jacobian = approximator.jacobian(x)
    hessian = approximator.hessian(x)
    dy_x = jacobian['y']['x']
    dy_t = jacobian['y']['t']
    dy_xx = hessian['y']['x']['x']
    residual = dy_t + y['y'] * dy_x - v * dy_xx
    return residual

# neural network
approximator = pinnx.nn.Model(
    pinnx.nn.DictToArray(x=u.meter, t=u.second),
    pinnx.nn.FNN(
        [geometry.dim] + [20] * 3 + [1],
        "tanh",
        braintools.init.KaimingUniform()
    ),
    pinnx.nn.ArrayToDict(y=uy)
)

# problem
problem = pinnx.problem.TimePDE(
    geometry,
    pde,
    [bc, ic],
    approximator,
    num_domain=2540,
    num_boundary=80,
    num_initial=160,
)

# training
trainer = pinnx.Trainer(problem)
trainer.compile(braintools.optim.Adam(1e-3)).train(iterations=15000)
trainer.compile(braintools.optim.LBFGS(1e-3)).train(2000, display_every=500)
trainer.saveplot(issave=True, isplot=True)

Installation

  • Install the stable version with pip:
pip install pinnx --upgrade
  • Install pinnx on CPU or GPU with JAX following the instructions on
pip install pinnx[cpu]  # for CPU

pip install pinnx[cuda12]  # for NVIDIA GPUs with CUDA 12

pip install pinnx[cuda13]  # for NVIDIA GPUs with CUDA 13

pip install pinnx[tpu]  # for Google TPUs

Documentation

The official documentation is hosted on Read the Docs: https://pinnx.readthedocs.io/

See also the ecosystem

pinnx is one part of our brain modeling ecosystem: https://brainmodeling.readthedocs.io/

Metadata

Release files for pinnx 0.0.4

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

Source distribution (sdist)

Source distribution for pinnx 0.0.4
File Size Uploaded Provenance
pinnx-0.0.4.tar.gz 94.9 kB With provenance Details

Built distribution (wheel)

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

Total release size: 206.8 kB

Release files / pinnx-0.0.4.tar.gz

Download URL pinnx-0.0.4.tar.gz
Size 94.9 kB
Tags Source
SHA-256 checksum
How to use checksums
95ca5ee85f9c4265cdc13b882408195cdf1229ca331fc7b6655d373a912fcfea
BLAKE2b-256 checksum
How to use checksums
fc303f9dbda0d08279958accd45d01c95a232073e006f0d4f3bf0650747e825c
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 21, 2026.

Transparency log

Release files / pinnx-0.0.4-py3-none-any.whl

Download URL pinnx-0.0.4-py3-none-any.whl
Size 111.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7056fde8559a7365851487cbcfd439573e4b7532f7fb8ce20f48d0aa74da24a0
BLAKE2b-256 checksum
How to use checksums
3a05128d49ea3bd6ff066fa0ba418bfc4a4a18477c507770f93c0dc9035053d7
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 21, 2026.

Transparency log

Security for pinnx 0.0.4

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 pinnx-0.0.4.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 21, 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