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.0.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.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: norax-1.0.0.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.0.tar.gz
Algorithm Hash digest
SHA256 377f6e72b8bf807027307709c3c19c3dda07a99c5af7b28710666575745c1eea
MD5 f4e1f58827cb2611c13fb5e1272e6546
BLAKE2b-256 43cd2d14deb282300956ad1ac7e7da648f9d143195efe8b96edbe15bcda087bd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: norax-1.0.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f39559d39afe2eac0001d31a4a011b5e25f8ace92639c90b8d9e67dade301d05
MD5 ac056b2024ce46d1cde15ab81445c7b3
BLAKE2b-256 1481ee7a11ae1893df87654c4033dffb3e499d60bb69bceba41400075b4c8993

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