ScipyMinimizer

class ScipyMinimizer(method='L-BFGS-B', use_grad=True, options=<factory>, show_progress=True)[source]

Bases: Module

A host-based minimizer utilizing scipy.optimize.minimize.

Acts as an adapter layer between highly nested JAX PyTrees and SciPy’s required flat 1D NumPy arrays. Safely handles automatic differentiation via jax.value_and_grad and un-packs PyTree boundaries into the exact sequence formatting SciPy demands.

Variables:
  • method (str) – The SciPy solver method (default: “L-BFGS-B” for bounded problems).

  • use_grad (bool) – Whether to calculate exact gradients via JAX to pass to the SciPy Jacobian hook.

  • options (dict) – Standard SciPy minimizer options (e.g., ‘maxiter’, ‘ftol’, ‘disp’).

  • show_progress (bool) – Whether to display a tqdm progress bar during optimization.

Parameters:
method: str = 'L-BFGS-B'
use_grad: bool = True
options: dict
show_progress: bool = True