◆ FORGE Suite
GitHubMechanical Neuroimaging Lab · Univ. of Delaware
Skip to content

How to Choose an Optimizer

Sentinel ships three optimizers for the reconstruction loop. For their full signatures, keyword arguments, and return values see Optimization in the API reference; for the update-rule mathematics see the Mathematical Reference.

Start with conjugate gradient

conjugate_gradient! is the default and the right first choice: it is robust, its memory cost grows only linearly with the number of parameters, and it behaves predictably on large problems.

Move off it only when you have a reason from the list below.

When to switch

IfUseBecause
CG converges but too slowly, and memory is availablequasi_newton! (L-BFGS)curvature information from stored update pairs gives faster convergence
The problem is well conditionedgauss_newton!the diagonal Hessian preconditioner is cheap and effective when conditioning is good
Gauss-Newton is unstablegauss_newton! with MarquardtRegLevenberg-Marquardt damping stabilizes the step

Memory cost: CG and Gauss-Newton are O(n) in the parameter count. L-BFGS is O(mn), where m is the number of stored curvature pairs — the memory keyword, which defaults to 5. Raising memory improves the curvature estimate and costs proportionally more storage.

Every optimizer takes its step length from an Armijo backtracking line search: the trial step is reduced by a fixed factor until the objective decreases by enough. See line_search for the parameters that control it.

If an optimizer stalls with the objective barely moving, inspect the line search before changing optimizer — a step length that is always being rejected looks like slow convergence but is a different problem.

Next