![]() |
NDEVR
API Documentation
|
Implementation of the Levenberg-Marquardt optimization algorithm. More...
Public Member Functions | |
| OptimizationAlgorithmLevenberg () | |
| construct the Levenberg algorithm, which will use the given Solver for solving the linearized system. | |
| void | clear () |
| Resets all Levenberg-Marquardt state to initial values. | |
| g_type | currentLambda () const |
| return the currently used damping factor | |
| int | levenbergIteration () |
| return the number of levenberg iterations performed in the last round | |
| void | optimize (uint04 iterations, bool online, IndexScratch &scratch) |
| Runs Levenberg-Marquardt optimization for the given number of iterations. | |
| void | setUserLambdaInit (g_type lambda) |
| Sets a user-specified initial damping factor. | |
| OptimizationAlgorithm::SolverResult | solve (int iteration, bool online, IndexScratch &scratch) |
| Performs a single Levenberg-Marquardt iteration with adaptive damping. | |
| Public Member Functions inherited from OptimizationAlgorithmWithHessian< t_type > | |
| OptimizationAlgorithmWithHessian () | |
| Default constructor. | |
| void | addEdge (HyperGraph::HGEdge *e) |
| Adds an edge to the optimizer. | |
| void | addVertex (HyperGraph::HGVertex &v) |
| Adds a vertex to the optimizer. | |
| bool | buildLinearStructure (IndexScratch &scratch) |
| Builds the linear system structure. | |
| void | clear () |
| Clears the solver state. | |
| bool | init (bool online=false) |
| Initializes the solver, detecting whether Schur complement should be used. | |
| SparseOptimizer & | optimizer () |
| Returns a mutable reference to the underlying sparse optimizer. | |
| void | updateLinearSystem () |
| Rebuilds the linear system (Hessian and gradient) from the current graph state. | |
| bool | updateStructure (const Buffer< HyperGraph::HGVertex * > &vset, const Set< HyperGraph::HGVertex * > &edges) |
| Updates the linear system structure after graph topology changes. | |
Protected Member Functions | |
| g_type | computeLambdaInit () const |
| helper for Levenberg, this function computes the initial damping factor, if the user did not specify an own value, see setUserLambdaInit() | |
| g_type | computeScale () const |
| Computes the predicted reduction scale for the trust-region ratio. | |
Additional Inherited Members | |
| Public Types inherited from OptimizationAlgorithm | |
| enum | SolverResult { Terminate =2 , OK =1 , Fail =-1 } |
| Result codes returned by the solver after each iteration. More... | |
| Public Attributes inherited from OptimizationAlgorithmWithHessian< t_type > | |
| t_type | solver |
| The underlying solver instance. | |
Implementation of the Levenberg-Marquardt optimization algorithm.
| t_type | The block solver type. |
Definition at line 10 of file optimization_algorithm_levenberg.h.
|
inlineprotected |
Computes the predicted reduction scale for the trust-region ratio.
Definition at line 200 of file optimization_algorithm_levenberg.h.
References _currentLambda, and OptimizationAlgorithmWithHessian< t_solver >::solver.
Referenced by solve().
|
inline |
Runs Levenberg-Marquardt optimization for the given number of iterations.
| [in] | iterations | Maximum number of iterations. |
| [in] | online | Whether this is an online (incremental) optimization. |
| [in] | scratch | Scratch buffers for pose and landmark indices. |
Definition at line 138 of file optimization_algorithm_levenberg.h.
References OptimizationAlgorithmWithHessian< t_solver >::init(), OptimizationAlgorithm::OK, OptimizationAlgorithmWithHessian< t_solver >::optimizer(), and solve().
|
inline |
Sets a user-specified initial damping factor.
| [in] | lambda | The initial lambda value. If > 0, overrides the automatic computation. |
Definition at line 160 of file optimization_algorithm_levenberg.h.
References _lambdaInit.
|
inline |
Performs a single Levenberg-Marquardt iteration with adaptive damping.
| [in] | iteration | Current iteration index. |
| [in] | online | Whether this is an online step. |
| [in] | scratch | Scratch buffers for pose and landmark indices. |
Definition at line 46 of file optimization_algorithm_levenberg.h.
References _currentLambda, _goodStepLowerScale, _goodStepUpperScale, _levenbergIterations, _nBad, _ni, SparseOptimizer::activeRobustChi2(), SparseOptimizer::computeActiveErrors(), computeLambdaInit(), computeScale(), OptimizationAlgorithm::Fail, getMax(), getMin(), gs_epsilon, OptimizationAlgorithm::OK, OptimizationAlgorithmWithHessian< t_solver >::optimizer(), OptimizationAlgorithmWithHessian< t_solver >::solver, OptimizationAlgorithm::Terminate, and SparseOptimizer::update().
Referenced by optimize().