Skip to main content

Nonlinear optimisation in JAX and Equinox.

Project description

Optimistix

Optimistix is a JAX library for nonlinear solvers: root finding, minimisation, fixed points, and least squares.

Features include:

  • interoperable solvers: e.g. autoconvert root find problems to least squares problems, then solve using a minimisation algorithm.
  • modular optimisers: e.g. use a BFGS quadratic bowl with a dogleg descent path with a trust region update.
  • using a PyTree as the state.
  • fast compilation and runtimes.
  • interoperability with Optax.
  • all the benefits of working with JAX: autodiff, autoparallism, GPU/TPU support etc.

Installation

pip install optimistix

Requires Python 3.9+ and JAX 0.4.14+ and Equinox 0.11.0+.

Quick example

import jax.numpy as jnp
import optimistix as optx

# Let's solve the ODE dy/dt=tanh(y(t)) with the implicit Euler method.
# We need to find y1 s.t. y1 = y0 + tanh(y1)dt.

y0 = jnp.array(1.)
dt = jnp.array(0.1)

def fn(y, args):
    return y0 + jnp.tanh(y) * dt

solver = optx.Newton(rtol=1e-5, atol=1e-5)
sol = optx.fixed_point(fn, solver, y0)
y1 = sol.value  # satisfies y1 == fn(y1)

Finally

JAX ecosystem

Equinox: neural networks.

Optax: first-order gradient (SGD, Adam, ...) optimisers.

Diffrax: numerical differential equation solvers.

Lineax: linear solvers.

jaxtyping: type annotations for shape/dtype of arrays.

Eqxvision: computer vision models.

sympy2jax: SymPy<->JAX conversion; train symbolic expressions via gradient descent.

Levanter: scalable+reliable training of foundation models (e.g. LLMs).

Disclaimer

This is not an official Google product.

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

optimistix-0.0.3.tar.gz (51.7 kB view details)

Uploaded Source

Built Distribution

optimistix-0.0.3-py3-none-any.whl (87.8 kB view details)

Uploaded Python 3

File details

Details for the file optimistix-0.0.3.tar.gz.

File metadata

  • Download URL: optimistix-0.0.3.tar.gz
  • Upload date:
  • Size: 51.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for optimistix-0.0.3.tar.gz
Algorithm Hash digest
SHA256 f283ef058fecc9016593283f5e3fb2ebaa3d8b88cac12add032ab24508ce282f
MD5 507b4261fc7602100c1488658924b454
BLAKE2b-256 eae2e8cd4832fdeca5466b0501ccdedbf43ab3be9d80a2c78d74ddc08349b723

See more details on using hashes here.

File details

Details for the file optimistix-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: optimistix-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 87.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for optimistix-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1cca82930ffa276f1f7714002486a0a593d73695aafced14ddbadbfec3c09067
MD5 617d4b1fe5f943bcb9b4ecc06772351f
BLAKE2b-256 febd8fa74ff44e9f17caa2e894889e48447754f20bc95d676e7a82da78d9c993

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page