|
|
| GncOptimizer (const NonlinearFactorGraph &graph, const Values &initialValues, const GncParameters ¶ms=GncParameters()) |
| | Constructor.
|
| void | setInlierCostThresholds (const double inth) |
| | Set the maximum weighted residual error for an inlier (same for all factors).
|
| void | setInlierCostThresholds (const Vector &inthVec) |
| | Set the maximum weighted residual error for an inlier (one for each factor).
|
|
void | setInlierCostThresholdsAtProbability (const double alpha) |
| | Set the maximum weighted residual error threshold by specifying the probability alpha that the inlier residuals are smaller than that threshold.
|
| void | setWeights (const Vector w) |
| | Set weights for each factor.
|
|
const NonlinearFactorGraph & | getFactors () const |
| | Access a copy of the internal factor graph.
|
|
const Values & | getState () const |
| | Access a copy of the internal values.
|
|
const GncParameters & | getParams () const |
| | Access a copy of the parameters.
|
|
const Vector & | getWeights () const |
| | Access a copy of the GNC weights.
|
|
const Vector & | getInlierCostThresholds () const |
| | Get the inlier threshold.
|
|
const GncTiming & | getTiming () const |
| | Get the timing of the last optimize() call.
|
|
bool | equals (const GncOptimizer &other, double tol=1e-9) const |
| | Equals.
|
|
Vector | initializeWeightsFromKnownInliersAndOutliers () const |
|
Values | optimize () |
| | Compute optimal solution using graduated non-convexity.
|
|
void | validateLossSchedulerCombination () const |
|
double | initializeLambda () const |
| | Initialize the gnc parameter lambda such that loss is approximately convex (remark 5 in GNC paper).
|
|
double | updateLambda (const double lambda) const |
| | Update the gnc parameter lambda to gradually increase nonconvexity.
|
|
bool | checkLambdaConvergence (const double lambda) const |
| | Check if we have reached the value of lambda for which the surrogate loss matches the original loss.
|
|
bool | checkCostConvergence (const double cost, const double prev_cost) const |
| | Check convergence of relative cost differences.
|
|
bool | checkWeightsConvergence (const Vector &weights) const |
| | Check convergence of weights to binary values.
|
|
bool | checkConvergence (const double lambda, const Vector &weights, const double cost, const double prev_cost) const |
| | Check for convergence between consecutive GNC iterations.
|
|
NonlinearFactorGraph | makeWeightedGraph (const Vector &weights) const |
| | Create a graph where each factor is weighted by the gnc weights.
|
|
Vector | calculateWeights (const Values ¤tEstimate, const double lambda) |
| | Calculate gnc weights.
|
template<class GncParameters>
Map this optimizer's historical graduation parameter to the normalized \mu in [0,1] expected by the robust loss interface.
\lambda is this class' name for the unbounded control parameter of the schedule, for every loss, which is why the parameters that drive it are named lambdaStep and lambdaMax. It is internal scheduling state, and the quantity it corresponds to in the publications differs per loss:
- GM: \lambda decreases from a large value to 1; \mu = 1 / \lambda.
- TLS: \lambda increases from ~0 to infinity; \mu = \lambda/(1 + \lambda). This is the same quantity LossFunctions.h calls \theta for TLS. Both maps are exact inverses of the ones documented in LossFunctions.h.
template<class GncParameters>
Set the maximum weighted residual error for an inlier (same for all factors).
For a factor in the form f(x) = 0.5 * || r(x) ||^2_Omega, the inlier threshold is the largest value of f(x) for the corresponding measurement to be considered an inlier. In other words, an inlier at x is such that 0.5 * || r(x) ||^2_Omega <= barcSq. Assuming an isotropic measurement covariance sigma^2 * Identity, the cost becomes: 0.5 * 1/sigma^2 || r(x) ||^2 <= barcSq. Hence || r(x) ||^2 <= 2 * barcSq * sigma^2.
template<class GncParameters>
Set the maximum weighted residual error for an inlier (one for each factor).
For a factor in the form f(x) = 0.5 * || r(x) ||^2_Omega, the inlier threshold is the largest value of f(x) for the corresponding measurement to be considered an inlier. In other words, an inlier at x is such that 0.5 * || r(x) ||^2_Omega <= barcSq.