Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Robust Loss Functions

Outliers dominate the ordinary least-squares objective. Apex Solver ships 15 robust kernels — Huber, Cauchy, Tukey, Welsch, Fair, GemanMcClure, Andrews, Trimmed, L1, Lp, Barron variants and more — all in apex_solver::core::loss_functions.

Usage

#![allow(unused)]
fn main() {
use apex_solver::core::loss_functions::HuberLoss;

problem.add_residual_block(
    &[k_pose, k_landmark],
    Box::new(projection_factor),
    Some(Box::new(HuberLoss::new(1.345)?)),
);
}

What the solver actually computes

For a squared residual norm , the robust objective is

Minimizing is equivalent to an iteratively reweighted least-squares problem whose residual and Jacobian are

with from the Triggs correction. Apex Solver applies exactly this correction in-place during block evaluation, and reports the cost as — not as the norm of the corrected residual. The two are different functions; conflating them silently corrupts every reported cost and trust-region ratio on robust problems.