A drop-in replacement for scipy.optimize functions with quality-of-life improvements, such as automatic gradient computation via JAX, progress bars, and early stopping. Current version is 0.4.1, released in 2025. The project is under active development with monthly releases.
pip install better-optimizeVerified import paths — ran on the pinned version, not inferred.
Minimize the Rosenbrock function using BFGS. Note: JAX arrays are used for automatic differentiation.
Upgrade Python to 3.12 or later.
Convert NumPy arrays to JAX arrays via jnp.array(your_array).
Use 'progress_callback' instead of 'callback'.
Run 'pip install better-optimize' and ensure you are using the correct import name 'better_optimize' (underscore).
Convert inputs to JAX arrays: x_jax = jnp.array(x_numpy).