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
Built Distribution
File details
Details for the file optimistix-0.0.4.tar.gz
.
File metadata
- Download URL: optimistix-0.0.4.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a36b0f18ded18161c28db7599aa1ce6eec6ffc85eb339860dbb7e4d87400a25 |
|
MD5 | d00b9451daa5155ae1f68ee5676e4b2c |
|
BLAKE2b-256 | 7b65ca1dfcacac84cc51e51193fe9017a25653bdcd1461a6c6780d0f68c4e443 |
File details
Details for the file optimistix-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: optimistix-0.0.4-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd4c7d096eb5e10196e014669bcdef4212145f827ca905cedaba9a94628512e7 |
|
MD5 | c7f2357bafa0dc07fd1893dd697c5457 |
|
BLAKE2b-256 | 4dfa219c2cb9cf987a2b6df86f9b4d463755a0e676da0c51c6c0136df2119cec |