Solvers#

Functions for interacting with the JAX-based optimizers used for parameter fitting.

Solver registry functions#

Helpers to look up or register solvers.

get_solver

Fetch the solver spec.

get_solver_documentation

Get the documentation of a specified solver, including accepted arguments and the docstring of its __init__.

list_available_solvers

List all available solvers.

list_available_algorithms

List the available algorithms that can be used for fitting models.

list_algo_backends

List the available backends for an algorithm.

register

Register a solver implementation in the registry.

set_default_backend

Set the default backend for a given algorithm.

SolverSpec

Solver specification representing an entry in the solver registry.

Wrapping existing solvers#

Adapter classes for existing solvers, especially those defined in the JAXopt, Optimistix, or Optax libraries.

_solver_adapter.SolverAdapter

Base class for adapters wrapping existing solvers.

_jaxopt_solvers.JaxoptAdapter

Base class for adapters wrapping JAXopt-style solvers.

_optimistix_solvers.OptimistixAdapter

Base class for adapters wrapping Optimistix minimizers.

_optax_optimistix_solvers.AbstractOptimistixOptaxSolver

Adapter for optimistix.OptaxMinimiser which is an adapter for Optax solvers.

Writing custom solvers#

Classes useful for creating completely custom solvers.

AbstractSolver

Base class defining the interface for solvers that can be used by BaseRegressor.

OptimizationInfo

Basic diagnostic information about finished optimization runs.

SolverProtocol

Protocol mirroring the interface of AbstractSolver.

validate_solver_class

Validate required methods against AbstractSolver and optionally run a quick ridge regression.

See also

The developer notes explain the solver contract and expected types in more detail.