Skip to content

Commit 1d56864

Browse files
Core Solver - Ceres LMDER - Update invalid steps
This may be a very useful feature in Ceres that allows the solver to make "bad" (or invalid) steps in minimisation that may lead to a better global minimum.
1 parent 89746c3 commit 1d56864

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/mmSolver/adjust/adjust_ceres_lmder.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,11 @@ bool solve_3d_ceres_lmder(SolverOptions& solverOptions,
225225

226226
// Allow solve to get worse before it gets better. The parameters
227227
// with the lowest error is always picked at the end of the solve.
228-
options.use_nonmonotonic_steps = false;
229-
options.max_num_consecutive_invalid_steps = 5; // Allow some invalid steps.
228+
//
229+
// NOTE: This only affects Trust Region algorithms.
230+
const uint8_t max_invalid_steps = 0; // or 5?
231+
options.use_nonmonotonic_steps = max_invalid_steps > 0;
232+
options.max_num_consecutive_invalid_steps = max_invalid_steps;
230233

231234
// TODO: Should we bound the solver time?
232235
options.max_solver_time_in_seconds = 1e9;

0 commit comments

Comments
 (0)