Constraint-Aware Descent Routine Executor — JAX-native constrained optimization
Project description
CADRE
Constraint-Aware Descent Routine Executor — JAX-native constrained optimization.
CADRE provides a unified interface to multiple JAX-compatible optimization backends, with first-class support for box-constrained problems via an active-set method (ADABK family).
This is the minimizer used in Furax-CS package for CMB component separation.
Installation
pip install jax-cadre
With optional scipy solvers (scipy_tnc, scipy_cobyqa):
pip install jax-cadre[scipy]
Quick start
from cadre import minimize
import jax.numpy as jnp
def loss(params, target):
return jnp.sum((params - target) ** 2)
target = jnp.array([1.0, 2.0, 3.0])
lower = jnp.zeros(3)
upper = jnp.ones(3) * 5.0
params, state = minimize(
loss,
init_params=jnp.zeros(3),
solver_name="ADABK0", # or "optax_lbfgs"
lower_bound=lower,
upper_bound=upper,
target=target,
)
print(f"Optimal params: {params}")
Solvers
| Solver | Description |
|---|---|
ADABK0 |
Active-set + AdaBelief, 1 constraint released/step. Best for noisy landscapes. |
ADABK{N} |
Active-set + AdaBelief, up to N×10 % constraints released/step. |
optax_lbfgs |
L-BFGS with zoom linesearch. Best for smooth landscapes. |
adam, adabelief, adaw, sgd |
First-order optax solvers with optional projection. |
optimistix_bfgs/lbfgs/ncg_* |
Optimistix solvers. |
scipy_tnc, scipy_cobyqa |
Scipy solvers via jaxopt (requires cadre[scipy]). |
Full solver documentation and ADABK internals: docs
Advanced usage
from cadre import get_solver
import optimistix as optx
solver, _ = get_solver("ADABK0", rtol=1e-6, atol=1e-6)
state = solver.init(loss, init_params, target, {}, f_struct, None, frozenset())
# ... step manually
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jax_cadre-0.1.0.tar.gz.
File metadata
- Download URL: jax_cadre-0.1.0.tar.gz
- Upload date:
- Size: 23.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e353594f5eb933ce09f6db83da60e30ad2fa21cd37b5a02f3bec71957a76caf
|
|
| MD5 |
8a1e71c70acf7d1026b819df0964c9a6
|
|
| BLAKE2b-256 |
88a537b7c1bc58df0b3ce0a1ff6277006ceb1a6803fb0f5e1c1e873e32495629
|
Provenance
The following attestation bundles were made for jax_cadre-0.1.0.tar.gz:
Publisher:
python-publish.yml on CMBSciPol/CADRE
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jax_cadre-0.1.0.tar.gz -
Subject digest:
1e353594f5eb933ce09f6db83da60e30ad2fa21cd37b5a02f3bec71957a76caf - Sigstore transparency entry: 1248677720
- Sigstore integration time:
-
Permalink:
CMBSciPol/CADRE@09ad665f08e3c738fe45080b4f3fbab8b0f67a96 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/CMBSciPol
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@09ad665f08e3c738fe45080b4f3fbab8b0f67a96 -
Trigger Event:
release
-
Statement type:
File details
Details for the file jax_cadre-0.1.0-py3-none-any.whl.
File metadata
- Download URL: jax_cadre-0.1.0-py3-none-any.whl
- Upload date:
- Size: 21.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40e4fc9427960b7ef5551fc53d376e2a7369ac9062f7116c91f4c1c83d7fd510
|
|
| MD5 |
0fd19cc01fb5e5e787675890f31671a6
|
|
| BLAKE2b-256 |
e115edb4461ca40d90b814a99f0db0a470c8833b6823c1937e7e020e5736c1ed
|
Provenance
The following attestation bundles were made for jax_cadre-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on CMBSciPol/CADRE
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jax_cadre-0.1.0-py3-none-any.whl -
Subject digest:
40e4fc9427960b7ef5551fc53d376e2a7369ac9062f7116c91f4c1c83d7fd510 - Sigstore transparency entry: 1248677726
- Sigstore integration time:
-
Permalink:
CMBSciPol/CADRE@09ad665f08e3c738fe45080b4f3fbab8b0f67a96 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/CMBSciPol
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@09ad665f08e3c738fe45080b4f3fbab8b0f67a96 -
Trigger Event:
release
-
Statement type: