Skip to content

Instantly share code, notes, and snippets.

@dellaert
Created September 20, 2026 23:33
Show Gist options
  • Select an option

  • Save dellaert/ed9c8ed6bbfa22a4f027474b9c3e32b5 to your computer and use it in GitHub Desktop.

Select an option

Save dellaert/ed9c8ed6bbfa22a4f027474b9c3e32b5 to your computer and use it in GitHub Desktop.
Jev + GTSAM: minimal standalone reproduction of CPT generation, evidence updates, and Bayesian-network structure recovery
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jashshah999

Copy link
Copy Markdown

Thanks for posting this. I tried the same idea on the hybrid side of GTSAM, where Jev supplies discrete evidence on the modes instead of CPTs.

The setup is a robot whose odometry steps are either normal or slippery. Each step has a short log note ("Sprinklers ran on the lawn crossing at dawn", "Carpeted corridor B, quiet"). Jev turns each note into a unary DecisionTreeFactor on that step's mode, and the rest is ordinary hybrid smoothing. The notes are synthetic, and the pools are frozen before any results are seen.

mode evidence accuracy (DCSAM, 100 routes x 40 steps) RMSE accuracy (exact, 60 x 16) RMSE
geometry only 0.56 0.465 m 0.77 0.374 m
keyword list 0.65 0.446 m 0.68 0.352 m
Jev 0.90 0.324 m 0.93 0.240 m

It is now a GTSAM example notebook: borglab/gtsam#2832. Writing it also turned up an exponential slowdown in TableFactor::toDecisionTreeFactor that made HybridSmoother crawl after about 40 steps; the fix is borglab/gtsam#2830.

Three things mattered:

  • Floor the answers. Jev often answers exactly 0 or 1, and a zero factor can never be overruled by the measurements. A floor of 0.2 to 0.3 let the geometry recover most slippery steps whose notes said nothing.
  • Compare, don't estimate rates. When I asked for frequencies (slip rates, transition probabilities), the answers came back near 0.5, and a hand-set constant did better. Choosing between described options is where Jev was strong.
  • Wording. With "is it true that the patient has lung cancer?" given a smoker, the answer was 0.00. Your phrasing ("which truth value best describes...", plus an interpretation line asking for a distribution) gives graded CPTs. Re-running your Asia net with it, my rows are within 0.09 of your recording.

I packaged both uses, per-variable mode factors and Bayes nets from descriptions, with record/replay so results reproduce without a key: https://github.com/jashshah999/gtsam-jev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment