Expand description
Library-backed constant refinement via scirs2-optimize.
phop’s default polish (crate::polish::polish_constants) is a small, panic-free, well-tested
Levenberg–Marquardt with named-constant snapping. This module offers two alternative
refinement backends drawn from the cool-japan scirs2-optimize crate so the constant fit can be
swapped without touching the discovery pipeline:
ScirsPolish::Lm—scirs2_optimize::least_squares(Levenberg–Marquardt), andScirsPolish::Lbfgs—scirs2_optimize::unconstrained::minimize_lbfgsminimizing the sum of squared residuals.
They are offered as opt-in backends rather than as a drop-in replacement: phop’s hand-rolled LM
makes no contiguity assumptions and never panics, whereas scirs2’s least-squares uses internal
expects on as_slice(). We feed it only contiguous Array1s built with from_vec, and treat
any solver error or non-finite step as a no-op (returning the starting constants), so this module
upholds phop’s no-panic / no-unwrap policy.
Enums§
- Scirs
Polish - Which
scirs2-optimizealgorithm to use for the polish.
Functions§
- polish_
constants_ scirs - Refine the constant leaves of
treeagainstdsusing ascirs2-optimizebackend.