Skip to main content

Neural operators in JAX

Project description

norax

Neural operators in JAX.

tests codecov lint docs

norax provides implementations of neural operators built on top of JAX and Equinox.

Neural operators learn mappings between function spaces.

Currently only Fourier neural operators (Li et al., 2020) are provided in this library.

Check out the documentation page for more details.

Installation

pip install norax

Or with uv:

uv add norax

Quick start

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

key = jax.random.key(0)

# Define a 1D Fourier neural operator
model = FNO(
    key,
    channels_in=2,   # 1D scalar field: [x-coordinate, field value]
    channels_out=1,
    n_modes=(16,),   # Fourier modes to retain per spatial axis
    width=64,
    depth=4,
)

# Forward pass over a batch using vmap
x = jnp.ones((10, 64, 2))  # (batch, *grid_shape, channels_in)
y = jax.vmap(model)(x)     # (batch, *grid_shape, channels_out)

The n_modes tuple determines the spatial dimensionality of the operator: a 1-tuple gives a 1D FNO, a 2-tuple gives a 2D FNO, and so on.

Contributing

See CONTRIBUTING.md for instructions on setting up a development environment, running tests, linting, and building the documentation locally.

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

norax-1.0.1.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

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

norax-1.0.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file norax-1.0.1.tar.gz.

File metadata

  • Download URL: norax-1.0.1.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for norax-1.0.1.tar.gz
Algorithm Hash digest
SHA256 3d3cbdca069b007c85fb6b3d0fc4ccfa39e3a4f86433bbab23ecff4af491d916
MD5 777d3df8530b61d377d7d742e96e37a6
BLAKE2b-256 de8b8ee724b3582c231e345a20d71015338c818d53c459c03567686085319f61

See more details on using hashes here.

File details

Details for the file norax-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: norax-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for norax-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f31d3540d09e99d1b61cc4017776b1f562344e85d9db6668ce4c8ebc398a61db
MD5 6d981cfbffaf2cb74f9137c48733d404
BLAKE2b-256 4b03f82aa1fb9798b0e5d88c0c9f20074ec8400d490e9828dc10bd57ddc5d1f1

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