Skip to main content

Neural Operators in JAX

Project description

neojax

neojax (Neural Operators in JAX) is an implementation of Neural Operators built on top of JAX and Equinox. It provides a clean, modular API inspired by the original neuraloperator library.

Currently, neojax is in its early stages. Only the Fourier Neural Operator (FNO) is available, with support for:

  • 1D, 2D, 3D, 4D, and 5D coordinate-based operator learning.
  • Grid-based positional embeddings (GridEmbeddingNd).
  • Symmetrical domain padding (DomainPadding).
  • Pointwise MLP (Channel-MLP) expansions for improved expressivity.
  • Various skip connections (Linear, Soft-Gating, Identity).
  • Normalization in FNO blocks.
  • $L^{p}$-loss functions and loss compositions.
  • Seamless integration with JAX's vmap, jit, and grad.

It is designed to be fully compatible with all JAX features such as vmap, jit, and grad.

Installation

Install the python package via pypi

pip3 install neojax-operators

Quickstart

neojax exposes a similar API to neuraloperators and equinox and should therefore be familiar to use:

import jax.numpy as jnp
from neojax.models import FNO

fno = FNO(n_modes=(64, 64),
        hidden_channels=64,
        in_channels=2,
        out_channels=1
    )

x = jnp.ones((2, 64, 64))

pred = fno(x)

For a more detailed introduction refer to the examples in the documentation.

Benchmarks

Coming soon (Please refer to benchmarks/BENCHMARKS.md for a performance comparison of neojax and neuraloperator.)

Motivation

Jax has become ubiquitous in Scientific Machine Learning (SciML) and Scientific Computing. This is largely due to its core design, which embraces mathematical and functional transformations (like jit, vmap, and grad) and seamlessly integrates with NumPy-like paradigms. However, despite Neural Operators fundamentally shaping the SciML landscape and being frequently used for solving PDEs, a comprehensive, native Jax implementation has been notably missing. neojax was created to bridge this gap, bringing the performance, predictability, and ecosystem of Jax to the Neural Operator community.

Design Choices

Although originally conceived as a direct port of the PyTorch neuraloperator library, neojax evolved into a ground-up, Jax-native re-implementation. This approach avoids the pitfalls of forcing PyTorch idioms into a functional framework and significantly reduces internal complexity. By building directly on equinox, neojax aligns perfectly with Jax's pure-functional design principles while maintaining a clean, accessible, and class-based API.

Roadplan

The first and currently only supported Neural Operator is a simple Fourier Neural Operator (FNO). In upcoming releases more models and components will be added in roughly the following order:

  1. Resampling of outputs to arbitrary domain sizes
  2. DeepONet
  3. Sobolev losses
    1. $H^1$-loss
    2. Higher order $W^{k,p}$ (thinking jax.jvp/jax.vjp, jax.experimental.jet and then Stochastic Sobolev Training for high order)
  4. Domain class to wrap regular grid and irregular mesh domains
  5. Irregular mesh domains (probably meshio integration)
  6. Domain utilities
    1. Dataset conversion to and from Domain instances
    2. Pre-computation of derivatives on meshes/grids (needed for Sobolev losses)
  7. Graph Neural Operators (need mesh support first)

and so on...

Contributions

If you'd like to contribute any features, models, or fix implementation errors, please do so. Any contributions are appreciated. Have a look at the CONTRIBUTING.md guide for details on how to do so. I am also open to advice on restructuring and any other design choices that could be improved.

Citation

If you use neojax in your research, please cite it using the following BibTeX entry:

@software{neojax,
  author = {Paul Gekeler},
  title = {neojax: Neural Operators in Jax},
  year = {2026},
  url = {https://github.com/paulgekeler/neojax}
}

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

neojax_operators-0.0.7.tar.gz (345.0 kB view details)

Uploaded Source

Built Distribution

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

neojax_operators-0.0.7-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

Details for the file neojax_operators-0.0.7.tar.gz.

File metadata

  • Download URL: neojax_operators-0.0.7.tar.gz
  • Upload date:
  • Size: 345.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for neojax_operators-0.0.7.tar.gz
Algorithm Hash digest
SHA256 e1a4ce55d30a58c5c9eef07be1872a486ccf2b5f11331308391e3cbdb9200675
MD5 bde31bb59f462b6467fa5575800b9f15
BLAKE2b-256 2f6bba58d6bc55c23843ab9e78fa0a5dfc18f0bb0943a6c784fd96aeb25d3fc3

See more details on using hashes here.

File details

Details for the file neojax_operators-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: neojax_operators-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 27.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for neojax_operators-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 d97b3df90dc698ffcf6825df4b35da709b6822c2106a8b0cdaf93bef0be67c5c
MD5 2325756a76d61fb4ba9cad3ff35a3ad3
BLAKE2b-256 da2bb88be9c46acb876ba3ac857fdbc037aba175952d6651168c84696a5760d3

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