|
gtsam
|
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< GraduationScheduler > | shared_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. | |
|
inline |
Individual Parameter Constructor.
| muUpdateStrategy | The update strategy to use for $\mu$ updates Recommend: MuUpdateStable, Alt: MuUpdateMcGann2023 Recs. to be used with GemanMcClure loss with SCALE_INVARIANT graduation |
| muInitIncrement | The amount to increment/decrement $\mu_{init}$ |
| muInit | The 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. |
| std::invalid_argument | if muInit is outside [0, 1]. |
|
static |
$\mu$ update sequence empirically discovered and presented in the orig riSAM paper
|
static |
More stable $\mu$ Update sequence developed empirically since algorithm was published.
| double gtsam::GraduationScheduler::updateMu | ( | const double & | mu, |
| const double & | residual, | ||
| const size_t & | updateCount ) const |
Returns the next value of $\mu$ for this graduated.
| mu | The current value of $\mu$ |
| residual | The current residual of the factor |
| updateCount | The number of mu updates during this solve |
| double gtsam::GraduationScheduler::updateMuInit | ( | const double & | muInit, |
| const bool | isInlier ) const |
Returns the next value of $\mu_{init}$ for strong inliers/outliers.
| muInit | The current value of $\mu_{init}$ |
| isInlier | Flag indicating inlier update otherwise an outlier update |
|
protected |
The threshold at which to consider mu to be converged.