Skip to content

trust_region⚓︎

Trust-region deterministic optimization methods.

This module implements a trust-region optimizer with optional BFGS Hessian approximation and restart support.

TrustRegion ⚓︎

Bases: OptimizerBase

Trust-region Optimizer.

The class supports exact Hessian trust-region subproblems (iterative or CG-Steihaug) and optional BFGS Hessian approximation via hess='BFGS'.

__init__(x0, fun, jac, hess, method='iterative', args=(), bounds=None, callback=None, **options) ⚓︎

Initialize a trust-region optimizer instance.

Parameters:

Name Type Description Default
x0 ndarray

Initial parameter vector.

required
fun callable

Objective function.

required
jac callable

Gradient function.

required
hess callable or {BFGS}

Hessian function, or 'BFGS' to use a quasi-Newton Hessian approximation.

required
method (iterative, CG - Steihaug)

Trust-region subproblem solver.

'iterative'
args tuple

Extra positional arguments passed to the wrapped callables.

()
bounds sequence

Lower and upper bounds for each state variable.

None
callback callable

Callback invoked after successful updates.

None
**options

Trust-region configuration, plus everything :class:OptimizerBase takes. - trust_radius: Initial trust-region radius (default: 1.0). - trust_radius_max: Maximum trust-region radius (default: 100 * trust_radius). - trust_radius_min: Minimum trust-region radius before termination (default: trust_radius / 1000). - trust_radius_cuts: Maximum number of radius reductions before rejecting a step (default: 4). - rho_tol: Minimum ratio between actual and predicted reduction for step acceptance (default: 1e-6). - eta1: Threshold for rejecting a step (default: 0.05). - eta2: Threshold for increasing the trust-region radius (default: 0.5). - gam1: Factor used to decrease the trust-region radius (default: 0.5). - gam2: Factor used to increase the trust-region radius when the boundary is hit (default: 1.5). - resample: Whether to recompute gradient and Hessian after rejected steps (default: False). - convergence_criteria: Optional callable for custom convergence checks.

{}

check_convergence() ⚓︎

The projected gradient, the trust-region radius, and any custom criterion.

log_columns() ⚓︎

The row of the iteration log: iteration, objective, trust radius, reduction ratio, whether the step hit the boundary.

update_step() ⚓︎

Perform one trust-region step with optional radius reductions.