28 class LevenbergMarquardtOptimizer;
40 SILENT = 0, SUMMARY, TERMINATION, LAMBDA,
TRYLAMBDA, TRYCONFIG, DAMPED, TRYDELTA
43 static VerbosityLM verbosityLMTranslator(
const std::string &
s);
62 : verbosityLM(SILENT),
63 diagonalDamping(false),
66 SetLegacyDefaults(
this);
102 SetLegacyDefaults(&p);
108 SetCeresDefaults(&p);
126 void print(
const std::string&
str =
"")
const override;
152 std::shared_ptr<NonlinearOptimizerParams>
clone()
const {
void print(const Matrix &A, const string &s, ostream &stream)
bool getUseFixedLambdaFactor()
double getlambdaFactor() const
~LevenbergMarquardtParams() override
static Ordering Create(OrderingType orderingType, const FACTOR_GRAPH &graph)
Factor Graph consisting of non-linear factors.
bool getDiagonalDamping() const
double lambdaFactor
The amount by which to multiply or divide lambda when adjusting lambda (default: 10.0)
std::shared_ptr< NonlinearOptimizerParams > clone() const
LevenbergMarquardtParams()
double maxDiagonal
when using diagonal damping saturates the maximum diagonal entries (default: 1e32) ...
double minModelFidelity
Lower bound for the modelFidelity to accept the result of an LM iteration.
static LevenbergMarquardtParams CeresDefaults()
NonlinearFactorGraph graph
static LevenbergMarquardtParams ReplaceOrdering(LevenbergMarquardtParams params, const Ordering &ord)
double absoluteErrorTol
The maximum absolute error decrease to stop iterating (default 1e-5)
static const SmartProjectionParams params
double relativeErrorTol
The maximum relative error decrease to stop iterating (default 1e-5)
void setlambdaInitial(double value)
void setlambdaFactor(double value)
std::string logFile
an optional CSV log file, with [iteration, time, error, lambda]
void setUseFixedLambdaFactor(bool flag)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
void setLogFile(const std::string &s)
bool useFixedLambdaFactor
if true applies constant increase (or decrease) to lambda according to lambdaFactor ...
void setDiagonalDamping(bool flag)
void setlambdaUpperBound(double value)
void setlambdaLowerBound(double value)
static void SetCeresDefaults(LevenbergMarquardtParams *p)
double getlambdaUpperBound() const
std::string getVerbosityLM() const
double lambdaLowerBound
The minimum lambda used in LM (default: 0)
bool diagonalDamping
if true, use diagonal of Hessian
double minDiagonal
when using diagonal damping saturates the minimum diagonal entries (default: 1e-6) ...
void setVerbosityLM(const std::string &s)
static LevenbergMarquardtParams LegacyDefaults()
double getlambdaLowerBound() const
static LevenbergMarquardtParams EnsureHasOrdering(LevenbergMarquardtParams params, const NonlinearFactorGraph &graph)
double lambdaUpperBound
The maximum lambda to try before assuming the optimization has failed (default: 1e5) ...
Parameters for nonlinear optimization.
Ordering::OrderingType orderingType
The method of ordering use during variable elimination (default COLAMD)
VerbosityLM verbosityLM
The verbosity level for Levenberg-Marquardt (default: SILENT), see also NonlinearOptimizerParams::ver...
std::optional< Ordering > ordering
The optional variable elimination ordering, or empty to use COLAMD (default: empty) ...
std::string getLogFile() const
static void SetLegacyDefaults(LevenbergMarquardtParams *p)
size_t maxIterations
The maximum iterations to stop iterating (default 100)
double getlambdaInitial() const
double lambdaInitial
The initial Levenberg-Marquardt damping term (default: 1e-5)