41 template<
class BaseOptimizerParameters>
56 : baseOptimizerParams(baseOptimizerParams) {
83 <<
"setMaxIterations: changing the max nr of iters might lead to less accurate solutions and is not recommended! " 85 maxIterations = maxIter;
95 relativeCostTol =
value;
115 for (
size_t i = 0;
i < knownIn.size();
i++)
116 knownInliers.push_back(knownIn[
i]);
129 std::cout << str <<
"\n";
132 std::cout <<
"lossType: Geman McClure" <<
"\n";
135 std::cout <<
"lossType: Truncated Least-squares" <<
"\n";
138 throw std::runtime_error(
"GncParams::print: unknown loss type.");
140 std::cout <<
"maxIterations: " << maxIterations <<
"\n";
141 std::cout <<
"muStep: " << muStep <<
"\n";
142 std::cout <<
"relativeCostTol: " << relativeCostTol <<
"\n";
143 std::cout <<
"weightsTol: " << weightsTol <<
"\n";
144 std::cout <<
"verbosity: " << verbosity <<
"\n";
145 for (
size_t i = 0;
i < knownInliers.size();
i++)
146 std::cout <<
"knownInliers: " << knownInliers[
i] <<
"\n";
147 baseOptimizerParams.print(str);
def step(data, isam, result, truth, currPoseIndex)
BaseOptimizerParameters::OptimizerType OptimizerType
For each parameter, specify the corresponding optimizer: e.g., GaussNewtonParams -> GaussNewtonOptimi...
void setWeightsTol(double value)
Set the maximum difference between the weights and their rounding in {0,1} to stop iterating...
Verbosity verbosity
Verbosity level.
GncLossType lossType
any other specific GNC parameters:
GncParams()
Default constructor.
double muStep
Multiplicative factor to reduce/increase the mu in gnc.
double relativeCostTol
If relative cost change is below this threshold, stop iterating.
BaseOptimizerParameters baseOptimizerParams
GNC parameters.
double weightsTol
If the weights are within weightsTol from being binary, stop iterating (only for TLS) ...
void setKnownInliers(const std::vector< size_t > &knownIn)
GncParams(const BaseOptimizerParameters &baseOptimizerParams)
Constructor.
size_t maxIterations
Maximum number of iterations.
void setLossType(const GncLossType type)
Set the robust loss function to be used in GNC (chosen among the ones in GncLossType).
void setMuStep(const double step)
Set the graduated non-convexity step: at each GNC iteration, mu is updated as mu <- mu * muStep...
void setVerbosityGNC(const Verbosity value)
Set the verbosity level.
A nonlinear optimizer that uses the Levenberg-Marquardt trust-region scheme.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
void setMaxIterations(const size_t maxIter)
Set the maximum number of iterations in GNC (changing the max nr of iters might lead to less accurate...
std::vector< size_t > knownInliers
Slots in the factor graph corresponding to measurements that we know are inliers. ...
GncLossType
Choice of robust loss function for GNC.
void setRelativeCostTol(double value)
Set the maximum relative difference in mu values to stop iterating.
void print(const std::string &str) const
Print.
bool equals(const GncParams &other, double tol=1e-9) const
Equals.
Verbosity
Verbosity levels.