gtsam
Loading...
Searching...
No Matches
gtsam::GraduationScheduler Class Reference

Detailed Description

Class for graduation scheduling for riSAM.

Custom Schedulers can be implemented by defining custom Mu update strats. All loss functions are convex when $\mu = 0$ and recover their nonconvex form for $\mu = 1.0$.

For riSAM we recommend using GemanMcClure loss with SCALE_INVARIANT graduation scheme and the MuUpdateStable strategy configured by default for this class. Advanced users can explore alternate loss and graduation schedules.

Public Member Functions

Public Interface
 GraduationScheduler (MuUpdateStrategy muUpdateStrategy=MuUpdateStable, double muInitIncrement=0.2, double muInit=0.0)
 Individual Parameter Constructor.
double muInit () const
 Returns the value of $\mu_{init}$ for this graduated.
double updateMu (const double &mu, const double &residual, const size_t &updateCount) const
 Returns the next value of $\mu$ for this graduated.
double updateMuInit (const double &muInit, const bool isInlier) const
 Returns the next value of $\mu_{init}$ for strong inliers/outliers.
bool isMuConverged (const double &mu) const
 Returns true iff the value of $\mu$ has converged.

Static Public Member Functions

Default $\mu$ Update Strategies
static double MuUpdateMcGann2023 (const double &mu, const double &residual, const size_t &updateCount)
 $\mu$ update sequence empirically discovered and presented in the orig riSAM paper
static double MuUpdateStable (const double &mu, const double &residual, const size_t &updateCount)
 More stable $\mu$ Update sequence developed empirically since algorithm was published.

Public Types

Types
typedef std::shared_ptr< GraduationSchedulershared_ptr
 Shortcut for shared pointer.
typedef std::function< double(double, double, size_t)> MuUpdateStrategy
 Function type for $\mu$ update sequence.

Protected Attributes

Fields
double muInit_
 The initial value for mu $\mu_{init}$.
double convergenceThreshold_
 The threshold at which to consider mu to be converged.
MuUpdateStrategy muUpdateStrategy_
 The update strategy for the sequence $\mu$ values.
double muInitIncrement_
 The amount to increment/decrement $\mu_{init}$ if the factor is a strong inlier/outlier when values converge.

Constructor & Destructor Documentation

◆ GraduationScheduler()

gtsam::GraduationScheduler::GraduationScheduler ( MuUpdateStrategy muUpdateStrategy = MuUpdateStable,
double muInitIncrement = 0.2,
double muInit = 0.0 )
inline

Individual Parameter Constructor.

Parameters
muUpdateStrategyThe update strategy to use for $\mu$ updates Recommend: MuUpdateStable, Alt: MuUpdateMcGann2023 Recs. to be used with GemanMcClure loss with SCALE_INVARIANT graduation
muInitIncrementThe amount to increment/decrement $\mu_{init}$
muInitThe starting value of $\mu$ for factors using this scheduler, in [0, 1]. 0 is the most convex start, and it also floors updateMuInit, so a nonzero value never graduates more convex than it.
Exceptions
std::invalid_argumentif muInit is outside [0, 1].

Member Function Documentation

◆ MuUpdateMcGann2023()

double gtsam::GraduationScheduler::MuUpdateMcGann2023 ( const double & mu,
const double & residual,
const size_t & updateCount )
static

$\mu$ update sequence empirically discovered and presented in the orig riSAM paper

Note
Adheres to MuUpdateStrategy interface

◆ MuUpdateStable()

double gtsam::GraduationScheduler::MuUpdateStable ( const double & mu,
const double & residual,
const size_t & updateCount )
static

More stable $\mu$ Update sequence developed empirically since algorithm was published.

Note
Adheres to MuUpdateStrategy interface

◆ updateMu()

double gtsam::GraduationScheduler::updateMu ( const double & mu,
const double & residual,
const size_t & updateCount ) const

Returns the next value of $\mu$ for this graduated.

Parameters
muThe current value of $\mu$
residualThe current residual of the factor
updateCountThe number of mu updates during this solve

◆ updateMuInit()

double gtsam::GraduationScheduler::updateMuInit ( const double & muInit,
const bool isInlier ) const

Returns the next value of $\mu_{init}$ for strong inliers/outliers.

  • Inliers are updated to have more convex $\mu_{init}$
  • Outliers are update to have less convex $\mu_{init}$
    Parameters
    muInitThe current value of $\mu_{init}$
    isInlierFlag indicating inlier update otherwise an outlier update

Member Data Documentation

◆ convergenceThreshold_

double gtsam::GraduationScheduler::convergenceThreshold_
protected

The threshold at which to consider mu to be converged.

Note
$\mu = 1$ is the target robust loss by GTSAM convention

The documentation for this class was generated from the following files:
  • /tmp/gtsam-4.3.0-doxygen.rsXPUS/source/gtsam/sam/RISAMGraduationScheduler.h
  • /tmp/gtsam-4.3.0-doxygen.rsXPUS/source/gtsam/sam/RISAMGraduationScheduler.cpp