Loading...
Searching...
No Matches
LevenbergMarquardtOptimizer.h
Go to the documentation of this file.
/* ----------------------------------------------------------------------------
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
* Atlanta, Georgia 30332-0415
* All Rights Reserved
* Authors: Frank Dellaert, et al. (see THANKS for the full author list)
* See LICENSE for the license information
* -------------------------------------------------------------------------- */
#pragma once
#include <gtsam/nonlinear/NonlinearOptimizer.h>
#include <gtsam/nonlinear/LevenbergMarquardtParams.h>
#include <gtsam/linear/VectorValues.h>
#include <boost/date_time/posix_time/posix_time.hpp>
class NonlinearOptimizerMoreOptimizationTest;
namespace gtsam {
class GTSAM_EXPORT LevenbergMarquardtOptimizer: public NonlinearOptimizer {
protected:
const LevenbergMarquardtParams params_;
boost::posix_time::ptime startTime_;
void initTime();
public:
typedef boost::shared_ptr<LevenbergMarquardtOptimizer> shared_ptr;
LevenbergMarquardtOptimizer(const NonlinearFactorGraph& graph, const Values& initialValues,
const LevenbergMarquardtParams& params = LevenbergMarquardtParams());
LevenbergMarquardtOptimizer(const NonlinearFactorGraph& graph, const Values& initialValues,
const Ordering& ordering,
const LevenbergMarquardtParams& params = LevenbergMarquardtParams());
~LevenbergMarquardtOptimizer() override {
}
double lambda() const;
int getInnerIterations() const;
void print(const std::string& str = "") const {
std::cout << str << "LevenbergMarquardtOptimizer" << std::endl;
this->params_.print(" parameters:\n");
}
GaussianFactorGraph::shared_ptr iterate() override;
const LevenbergMarquardtParams& params() const {
return params_;
}
void writeLogFile(double currentError);
virtual GaussianFactorGraph::shared_ptr linearize() const;
GaussianFactorGraph buildDampedSystem(const GaussianFactorGraph& linear,
const VectorValues& sqrtHessianDiagonal) const;
bool tryLambda(const GaussianFactorGraph& linear, const VectorValues& sqrtHessianDiagonal);
protected:
const NonlinearOptimizerParams& _params() const override {
return params_;
}
};
}
VectorValues.h
Factor Graph Values.
LevenbergMarquardtParams.h
Parameters for Levenberg-Marquardt trust-region scheme.
NonlinearOptimizer.h
Base class and parameters for nonlinear optimization algorithms.
gtsam
Global functions in a separate testing namespace.
Definition chartTesting.h:28
gtsam::Ordering
Definition Ordering.h:34
gtsam::GaussianFactorGraph
A Linear Factor Graph is a factor graph where all factors are Gaussian, i.e.
Definition GaussianFactorGraph.h:75
gtsam::GaussianFactorGraph::shared_ptr
boost::shared_ptr< This > shared_ptr
shared_ptr to this class
Definition GaussianFactorGraph.h:81
gtsam::VectorValues
VectorValues represents a collection of vector-valued variables associated each with a unique integer...
Definition VectorValues.h:74
gtsam::LevenbergMarquardtOptimizer::~LevenbergMarquardtOptimizer
~LevenbergMarquardtOptimizer() override
Virtual destructor.
Definition LevenbergMarquardtOptimizer.h:72
gtsam::LevenbergMarquardtOptimizer::params
const LevenbergMarquardtParams & params() const
Read-only access the parameters.
Definition LevenbergMarquardtOptimizer.h:104
gtsam::LevenbergMarquardtOptimizer::_params
const NonlinearOptimizerParams & _params() const override
Access the parameters (base class version).
Definition LevenbergMarquardtOptimizer.h:125
gtsam::LevenbergMarquardtOptimizer::params_
const LevenbergMarquardtParams params_
LM parameters.
Definition LevenbergMarquardtOptimizer.h:38
gtsam::LevenbergMarquardtOptimizer::print
void print(const std::string &str="") const
print
Definition LevenbergMarquardtOptimizer.h:87
gtsam::LevenbergMarquardtOptimizer::LevenbergMarquardtOptimizer
LevenbergMarquardtOptimizer(const NonlinearFactorGraph &graph, const Values &initialValues, const LevenbergMarquardtParams &params=LevenbergMarquardtParams())
Standard constructor, requires a nonlinear factor graph, initial variable assignments,...
Definition LevenbergMarquardtOptimizer.cpp:49
gtsam::LevenbergMarquardtParams
Parameters for Levenberg-Marquardt optimization.
Definition LevenbergMarquardtParams.h:35
gtsam::NonlinearFactorGraph
Definition NonlinearFactorGraph.h:55
gtsam::NonlinearOptimizer::graph
const NonlinearFactorGraph & graph() const
return the graph with nonlinear factors
Definition NonlinearOptimizer.h:118
gtsam::NonlinearOptimizer::NonlinearOptimizer
NonlinearOptimizer(const NonlinearFactorGraph &graph, std::unique_ptr< internal::NonlinearOptimizerState > state)
Constructor for initial construction of base classes.
Definition NonlinearOptimizer.cpp:44
gtsam::NonlinearOptimizerParams
The common parameters for Nonlinear optimizers.
Definition NonlinearOptimizerParams.h:34
gtsam::Values
A non-templated config holding any types of Manifold-group elements.
Definition Values.h:65