Skip to content

JAXPIPhysics-informed neural networks at scale

A lean JAX library for physics-informed neural networks.

At a glance

Define your PDE residual, pick a config, and train:

python
from jaxpi.models import ForwardIVP, create_model
from jaxpi.samplers import UniformSampler
from jaxpi.training import train

class Burgers(ForwardIVP):
    def r_net(self, params, t, x):
        u = self.neural_net(params, t, x)
        u_t = grad(self.neural_net, argnums=1)(params, t, x)
        u_x = grad(self.neural_net, argnums=2)(params, t, x)
        u_xx = grad(grad(self.neural_net, argnums=2), argnums=2)(params, t, x)
        return u_t + u * u_x - 0.01 / jnp.pi * u_xx

model = create_model(config, Burgers, u0=u0, t_star=t_star, x_star=x_star)
train(config, model, UniformSampler(dom, config.training.batch_size))
Kolmogorov flow at Re 1e6Rayleigh-Taylor instabilityGray-Scott patternsKuramoto-Sivashinsky chaosTaylor-Green vortexLid-driven cavity

Browse all 16 examples →

Released under the Apache 2.0 License.