skoro v0.0.0

Rust · burn · second-order autodiff · manifolds

skoro

Write a probabilistic model once. Run any inference on it.

A pose graph on a closed circuit: the truth, the drifting dead-reckoned start, and the Levenberg–Marquardt estimate with its 90% ellipses A pose graph, estimated One of 100 datasets: 73 poses on SE(3) around a closed circuit, 24 landmarks, 278 sightings dead reckoning ends 1.49 m off 5 m Top view (x, y) Height along the circuit, which the top view hides side view: the height axis is stretched 0 m +1 m +2 m +3 m +4 m 0 10 20 30 40 50 60 70 tick Where the circuit closes: top view, at true scale 25 cm Truth (drawn from the model) Dead reckoning on the odometry: the start Estimated poses, with 90% ellipses Estimated landmarks, with 90% ellipses True landmarks 1.49 m → 34 cm largest error, height included dead reckoning → estimate 92.0% of true poses in their 90% ellipsoid over 100 datasets, ±5.0% allowed

A robot's poses and the landmarks it sights, written once as a model, drawn a hundred times and estimated together, with uncertainties that hold the truth as often as they claim to. Read the example →

Histograms of the normalized errors of the poses and the landmarks against the chi-squared densities they follow when the Laplace marginals are calibrated Are the uncertainties honest? The truth's distance from every estimate, in its own marginal's units, over 100 datasets Poses (6 dimensions) 0 4 8 12 16 20 24 28 normalized error |W (q* ⊖ q̂)|² χ²₆(0.9) = 10.64 the 90% ellipsoid’s edge 92.0% inside their 90% ellipsoid: 90.0% ± 5.0% expected 7,300 errors Landmarks (3 dimensions) 0 4 8 12 16 20 normalized error |W (q* ⊖ q̂)|² χ²₃(0.9) = 6.25 the 90% ellipsoid’s edge 92.3% inside their 90% ellipsoid: 90.0% ± 5.4% expected 2,400 errors How often each normalized error occurred The chi-squared density it follows when the marginals are calibrated
A sliding-window filter over an open path: its estimates against the truth, dead reckoning and the batch, and each tick’s position error A sliding window, retiring as it goes One of 100 datasets: 80 poses along an open path the window: last 5 poses 10 m Top view (x, y) Height along the path, which the top view hides side view: the height axis is stretched 0 m +1 m +2 m +3 m +4 m +5 m +6 m +7 m 0 10 20 30 40 50 60 70 tick dead reckoning Position error at each tick, in all three dimensions 1 cm 10 cm 1 m 0 10 20 30 40 50 60 70 tick dead reckoning window batch Truth Dead reckoning Window, filtering: each pose as it arrives Batch, every measurement Window’s 90% radius filtering coverage 92.8% against 90% · gap to the batch at the end 0.10 σ

Skoro is a Rust library for writing a probabilistic model once, generatively, and running different inference algorithms on the same model. A model is built forward, the way it is thought of: each uncertain quantity, and its conditional distribution given the quantities it depends on. The library records the structure as it is built, and an inference algorithm reads from that structure what it needs: it runs when the model meets its assumptions, and says what is missing when it does not.

It is built for the model that lives over time. In sequential estimation, for robots and other autonomous systems, a model grows as measurements arrive, retires old states as they stop mattering, is held under several hypotheses about what the measurements came from, and is estimated on other threads while all of that happens. Skoro’s quantities may live on manifolds such as rotations and poses, and its derivatives, of first and second order, are taken in their tangent spaces.

Start with what skoro is, and who it is for, or with the pose graph above. The rest is read along three tracks, each of which can be followed alone: the guide, top-down, from the code a user writes; the concepts, bottom-up, from the library’s spaces and operations; and the mathematics, the notes skoro rests on, in the order in which they build on each other. Reading these docs says how they fit together.

Three ways to read

The workspace

The crates in layers, foundations first: each is built on the crates it names, which lie in the layers above it, and leads to the order in which to read its modules.

  1. skoro-tensor The layer over burn: tensors at an explicit precision on a supported device skoro-elimination Elimination in square-root form: factored least squares on the host
  2. skoro-core Quantities, operations and their derivatives, models, terms and queries on skoro-tensor
  3. skoro-normal The normal distribution, on every space whose chart is global on skoro-coreskoro-spatial The rotations, rigid motions and extended poses, and their maps on skoro-coreskoro The umbrella: re-exports the core and the tensor layer on skoro-core
  4. skoro-uniform The uniform distribution, on every space whose measure has finite mass on skoro-normalskoro-linearize Linearization of a query, and a retirement's linearized replacement on skoro-normal, skoro-elimination