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
| If | Use | Because |
|---|---|---|
| CG converges but too slowly, and memory is available | quasi_newton! (L-BFGS) | curvature information from stored update pairs gives faster convergence |
| The problem is well conditioned | gauss_newton! | the diagonal Hessian preconditioner is cheap and effective when conditioning is good |
| Gauss-Newton is unstable | gauss_newton! with MarquardtReg | Levenberg-Marquardt damping stabilizes the step |
Memory cost: CG and Gauss-Newton are memory keyword, which defaults to 5. Raising memory improves the curvature estimate and costs proportionally more storage.
All three share a line search
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
Optimization — signatures and every keyword argument.
How to Choose and Configure Regularization — Marquardt and the other Hessian modifiers.
How to Tune Performance — where the time actually goes.