This repository contains the MATLAB implementation of GNC (Graduated Non-Convexity) on ADAPT (Adaptive Loss) by Barron described in the following paper:
- K. Jung, T. Hitchcox, and J. R. Forbes. "An Adaptive Graudated Nonconvexity Loss Function for Robust Nonlinear Least-Squares Solutions," 2024. arXiv:2305.06869
@misc{Jung2023Adaptive,
title={An Adaptive Graduated Nonconvexity Loss Function for Robust Nonlinear Least Squares Solutions},
author={Kyungmin Jung and Thomas Hitchcox and James Richard Forbes},
year={2024},
eprint={2305.06869},
archivePrefix={arXiv},
primaryClass={cs.RO}
}
Open MATLAB and run
example.m
The code below demonstrates how to use GNC-ADAPT to solve a nonlinear least-squares problem.
The example problem used here is a single rotation averaging problem.
A user can modify the fields in problem_params
to generate a problem with different parameters.
- N: number of measurements
- outlierRatio: the amount of outliers in the measurements
- noiseSigma: the standard deviation of the Gaussian noise in the measurements
A problem is then generated by executing
problem = SingleRotationAveragingProblem(problem_params);
The initial guess for the rotation matrix is generated by adding a random rotation to the ground truth rotation matrix.
initialNoise = 90; % degrees
rotAxis = normalize(randn(3, 1), 'norm');
rotAngle = deg2rad(initialNoise) * randn();
R_init = problem.R_gt * axang2rotm([rotAxis', rotAngle]);
Then, the problem is solved using the method of the user's choice (e.g., GNC-ADAPT).
results.gnc_adapt = problem.solve( ...
'lossFunction', @gnc_adapt, ...
'alphaStar', [], ...
'R_init', R_init ...
);
The problem can be solved by other loss functions such as
Method | Function Handle | alphaStar |
---|---|---|
Cauchy | @cauchy | - |
GM | @gm | - |
ADAPT | @adapt | - |
AMB | @amb | - |
GNC-Cauchy | @gnc_adapt | 0 |
GNC-GM | @gnc_adapt | -2 |
GNC-ADAPT | @gnc_adapt | - |
GNC-AMB | @gnc_amb | - |
GNC-TLS | @gnc_tls | - |
The solve
method has the following optional parameters:
R_init
: the initial guess for the rotation matrixlossFunction
: a function handle to the loss function to be usedinliers
: a logical vector indicating the inliersmaxIter
: the maximum number of iterationstau
: the noise bound parameter to estimate the optimal shape parametercostThreshold
: the cost threshold to stop the iterationsalphaStar
: the value of optimal shape parameter when it is knownverbose
: a flag to print the progress of the algorithm
This work was partially funded by:
- Voyis Imaging Inc.
- Natural Sciences and Engineering Research Council of Canada (NSERC)
- McGill Engineering Doctoral Award (MEDA)