Skip to main content

CADRE

Constraint-Aware Descent Routine Executor — JAX-native constrained optimization.

PyPI pre-commit License: MIT Docs: minimization

CADRE provides a unified interface to multiple JAX-compatible optimization backends, with first-class support for box-constrained problems via AdaTopK, 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 AdaTopK: active set + AdaBelief, 1 constraint released/step. Best for noisy landscapes.
ADABK{N} AdaTopK, 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

AdaTopK is an optimistix minimiser and can be used directly:

import optimistix as optx
from cadre import AdaTopK

solver = AdaTopK(rtol=0.0, atol=1e-10, lower=lower, upper=upper)
sol = optx.minimise(lambda p, t: loss(p, t), solver, jnp.zeros(3), target, max_steps=1000, throw=False)
print(sol.value, sol.stats["num_steps"])

License

MIT — see LICENSE.

Metadata

Release files for jax-cadre 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jax-cadre 0.2.0
File Size Uploaded Provenance Actions
jax_cadre-0.2.0.tar.gz 23.8 kB With provenance Details for jax_cadre-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jax-cadre 0.2.0
File Interpreter ABI Platform Actions
jax_cadre-0.2.0-py3-none-any.whl Python 3 none any Details for jax_cadre-0.2.0-py3-none-any.whl

Total release size: 46.5 kB

Release files / jax_cadre-0.2.0.tar.gz

Download URL jax_cadre-0.2.0.tar.gz
Size 23.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e26034dbbf6f8d58da9aa72a6fca6dfd76c45dd33214de40d60508539785e53a
BLAKE2b-256 checksum
How to use checksums
812c789f8b4062c648207f90c3599977e10b8cd86abecbd4dfbe90351a1bcc3e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Release files / jax_cadre-0.2.0-py3-none-any.whl

Download URL jax_cadre-0.2.0-py3-none-any.whl
Size 22.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1c74c86981af2799a2802551b5c858535766fadbb96eef2da819388174a83df9
BLAKE2b-256 checksum
How to use checksums
5008757a3255e227e2ec2f00a76380dd7a45afabf04c355fa02c0769fbf4bc1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Security for jax-cadre 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for jax_cadre-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page