Skip to content
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f426d2e
Copy IMPL from risam-v2
DanMcGann Oct 19, 2025
5f49b88
Reformat initial riSAM code.
DanMcGann Oct 19, 2025
1ed4be2
Format + Fix Compilation
DanMcGann Dec 22, 2025
f5574ab
Update docs for new formatting
DanMcGann Dec 24, 2025
b674f01
Cleanup Grad Factor+Kernel and Test
DanMcGann Jan 19, 2026
64227f8
Add riSAM test
DanMcGann Jan 31, 2026
8ba9cdc
Clean riSAM tests and Param constructor
DanMcGann Feb 5, 2026
fcec2c5
Update chi2 naming convention
DanMcGann Feb 14, 2026
ea4633f
Fix formating in risam additions
DanMcGann Feb 14, 2026
71bdf37
Updates for review changes to isam2 updates
DanMcGann Mar 3, 2026
7e7155d
Address co-pilot review
DanMcGann Mar 3, 2026
695168e
Fix shared_ptr compile issue
DanMcGann Mar 16, 2026
5a86d3b
Add RISAM notebook docs
DanMcGann Mar 16, 2026
86c9099
Update Doxygen Regions
DanMcGann Mar 25, 2026
64ce754
Add graduated weight/loss to robust lost functions
DanMcGann Mar 25, 2026
b9d8fff
Refactor GradKernel into Robust Loss + Scheduler
DanMcGann Mar 30, 2026
4630c19
Remove Graduated Kernel + Add Tests
DanMcGann Mar 30, 2026
8752f1e
Remove deprecated graduated kernel header
DanMcGann Apr 3, 2026
9558ca4
Add tests for complete Graduated Robust Loss
DanMcGann Apr 3, 2026
315424b
Add TLS Graduation Schemes, complete test coverage
DanMcGann Apr 5, 2026
21cf9f6
Fix Dependency Structure and TLS transition loss
DanMcGann Apr 5, 2026
3f24b23
Add GTSAM_EXPORT to approporiate RISAM classes
DanMcGann May 24, 2026
ca3279c
Refactor riSAM::updateRobust into helpers
DanMcGann May 24, 2026
6e2969f
Remove unneeded gtsam:: prefixes form RISAM code
DanMcGann May 24, 2026
863cae0
Cleanup+BugFix+Test RISAM robust update changes
DanMcGann May 24, 2026
1c0b56c
Document new RobustUpdate helpers
DanMcGann May 24, 2026
6744185
Refactor ConvexifyFctrs into helpers. Update Docs.
DanMcGann May 24, 2026
e2a2ed0
Refactor graduated MEst Tests to reduce copy/paste
DanMcGann May 25, 2026
76b65d2
Update the section order for RISAM notebook
DanMcGann May 25, 2026
386a97c
Docs. + Code Quality Improvements
DanMcGann May 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 127 additions & 0 deletions gtsam/nonlinear/doc/RISAM.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
{

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The notebook preamble order does not match our documented standard (title/introduction, then copyright remove-cell, then Colab badge, then Colab install remove-cell, then imports/setup code). Current order has badge before copyright and no dedicated imports/setup cell.

See copilot-instructions.md

"cells": [
{
"cell_type": "markdown",
"id": "c950beef",
"metadata": {},
"source": [
"# RISAM - Robust Incremental Smoothing and Mapping\n",
"\n",
"## Overview\n",
"\n",
"The `RISAM` class in GTSAM is designed to perform online robust optimization using an incrementalized version of [Graduated Non-Convexity](GNCOptimizer.ipynb) built on the [ISAM2](ISAM2.ipynb) algorithm. This method is intended for scenarios where the incremental optimization problem is affected by outliers. In cases where all measurements are known to be inliers `RISAM` functions identically to `ISAM2`, however, when potential outliers are incorporated `RISAM` applies an incremental GNC step to the effected problem improving robustness over standard ISAM2 but preventing sensitivity to initialization found in M-Estimation approaches.\n",
"\n",
"Like the `GNCOptimizer`, `RISAM` leverages a robust cost function $\\rho(e)$, where $e$ is the error term. The goal is to minimize the sum of these robust costs over all measurements:\n",
"\n",
"$$\n",
"\\min_x \\sum_i \\rho(e_i(x))\n",
"$$\n",
"\n",
"Unlike the batch setting that `GNCOptimzier` is used for, `RISAM` targets the incremental problem where we incrementally incorporate measurements online.\n",
"\n",
"$$\n",
"\\min_{x^t} \\sum_i \\rho(e_i(x^t))\n",
"$$\n",
"\n",
"Where we re-solve only a small subproblem at each step that is affected by the new measurements. `RISAM` solves this sub-problem robustly by solving a continuation of problems defined by graduated robust kernel $\\rho(e, \\mu)$ where the control parameter $\\mu$ smoothly transitions the kernel from quadratic ($x^2$) to a robust loss.\n",
"\n",
"$$\n",
"\\rho(e^t, \\mu)\n",
"$$\n",
"\n",
"By starting with non-robust error `RISAM` better handles poor-initialization, and by transitioning to the final robust loss `RISAM` removes the influence of outliers.\n",
"\n",
"Key features:\n",
"\n",
"- **Online Robust Optimization**: `RISAM` is designed to support incremental optimization problems with outliers, using a robust cost function that can mitigate their effects.\n",
"- **Incremental Graduated Non-Convexity**: This technique allows the optimizer to solve each incremental subproblem with a convex problem and gradually transform it into the original non-convex problem, which helps in avoiding local minima.\n",
"\n",
"## Key Methods + Classes\n",
"\n",
"`RISAM` is designed to be a drop-in replacement for ISAM2. To see details on its key methods see [ISAM2.ipynb](ISAM2.ipynb).\n",
"\n",
"Additional Key Methods:\n",
"* `getOutliers`: Returns the set of measurements currently classified as outliers.\n",
"\n",
"Additional Key Helpers + Classes\n",
"* `make_graduated`: Constructs any factor as a `GraduatedFactor` which identifies factors as possible outliers to `RISAM`. All other factors are treated as known inliers.\n",
"* `SIGKernel`: The suggested kernel to use with `GraduatedFactors` provides stable optimization performance.\n",
"\n",
"## Parameters\n",
"\n",
"The `RISAM::Parameters` class defines parameters specific to `RISAM`:\n",
"\n",
"| Parameter | Type | Default Value | Description |\n",
"|-----------|------|---------------|-------------|\n",
"| isam2_params | ISAM2Params | ISAM2Params() | The parameters for the encapsulated ISAM2 optimizer. It is recommended to use DogLegLineSearch for optimization. |\n",
"| increment_outlier_mu | bool | true | Whether to increment the initial value of $\\mu$ used for each incremental GNC update over time as certainty of their inlier/outlier status increases. |\n",
"| outlier_mu_chisq_upper_bound | double | 0.95 | The $\\chi^2$ threshold for factor residual to consider it an outlier for $\\mu_{init}$ updates.. |\n",
"| outlier_mu_chisq_lower_bound | double | 0.25| The $\\chi^2$ threshold for factor residual to consider it strong inlier for $\\mu_{init}$ updates. |\n",
"| outlier_mu_avg_var_convergence_thresh | double | 0.01 | The threshold average variable delta to initiate $\\mu_{init}$ updates. |\n",
"| number_extra_iters | size_t | 1 | The number of extra `ISAM2::updates` called internally at each iteration after converging to the fully robust problem. |\n",
"\n",
"## Usage Considerations\n",
"\n",
"- **Outlier Rejection**: `RISAM` is particularly effective in online scenarios with significant outlier presence, such as online SLAM.\n",
"- **Trust Region Optimization**: While `RISAM` can use any underlying optimization step methods supported by ISAM2 it is strongly recommended to use `DoglegLineSearch` as it accounts for the changes in problem structure (convexity changes) and prevents divergence through trust region steps.\n",
"\n",
"## Files\n",
"\n",
"- [RISAM.h](https://github.com/borglab/gtsam/blob/develop/gtsam/sam/RISAM.h)\n",
"- [RISAMGraduatedFactor.h](https://github.com/borglab/gtsam/blob/develop/gtsam/sam/RISAMGraduatedFactor.h)\n",
"- [RISAMGraduatedKernel.h](https://github.com/borglab/gtsam/blob/develop/gtsam/sam/RISAMGraduatedKernel.h)"
]
},
{
"cell_type": "markdown",
"id": "colab_button",
"metadata": {},
"source": [
"<a href=\"https://colab.research.google.com/github/borglab/gtsam/blob/develop/gtsam/nonlinear/doc/GncOptimizer.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "markdown",
"id": "license_cell",
"metadata": {
"tags": [
"remove-cell"
]
},
"source": [
"GTSAM Copyright 2010-2022, Georgia Tech Research Corporation,\n",
"Atlanta, Georgia 30332-0415\n",
"All Rights Reserved\n",
"\n",
"Authors: Frank Dellaert, et al. (see THANKS for the full author list)\n",
"\n",
"See LICENSE for the license information"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "colab_import",
"metadata": {
"tags": [
"remove-cell"
]
},
"outputs": [],
"source": [
"try:\n",
" import google.colab\n",
" %pip install --quiet gtsam-develop\n",
"except ImportError:\n",
" pass"
]
}
],
"metadata": {
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading