The Mathematics section, read start to finish
The Mathematics section was a collection of notes, one idea to a note, linked by what each builds on, while most of the mathematics the pages relied on sat in the archive's frozen documents, argued in skoro's terms. This entry made the section the mathematical analogue of Concepts (bottom-up): it holds every piece of mathematics the site relies on that is true independently of skoro, in nineteen notes that stand in an explicit order, in three parts, each note resting only on the notes before it. The writeup argues the position.
The Mathematics section was a collection of notes, one idea to a note, linked by what each builds on, while most of the mathematics the pages relied on sat in the archive’s frozen documents, argued in skoro’s terms. This entry made the section the mathematical analogue of Concepts (bottom-up): it holds every piece of mathematics the site relies on that is true independently of skoro, in nineteen notes that stand in an explicit order, in three parts, each note resting only on the notes before it. The writeup argues the position.
Twelve notes are new, each restating in general terms what an approved document of the archive
already proves: quotients by a finite group, the rotations and unit quaternions, the rigid
motions, removable singularities in floating point, the normal distribution in a chart, importance
weights, the improper Gaussian factor, linearization and the Gauss–Newton step, the
Levenberg–Marquardt method, the Laplace approximation, Fisher scoring, and the calibration of
credible sets. Two of the seven that existed were revised: the note on models built forward no
longer speaks of skoro, and the note on densities in tangent charts reaches the quotient. The site
reads a note’s part and order, refuses a note that rests on anything but an earlier note, lists
the notes in order and gives each its previous and next. The pages now send their readers to the
notes for the mathematics, and to the archive for why skoro is the way it is.
It also changed how the archive is kept. A later entry may bring a finished entry’s references into
the notes up to date, on the record, and bin/wf learned to allow, require and record that. This
entry needed no such change: every equation, statement and heading that the archive cites is where
it was.
Where it stands
- Writeup
- Publish
Documents
What it changed
The pages that say what this entry made true:
- Reading these docs Three tracks to read, the guide top-down, the concepts bottom-up and the mathematics in order, beside a reference to look things up in and an archive of how skoro came to be.
- A first model Write a hierarchical normal with `sample`, generate from it and take its density and gradient given an observation, then see what the sugar is made of, from the tests of skoro itself.
- A pose graph The example pose_graph, read top-down: a robot's poses and landmarks on SE(3) built tick by tick, a hundred datasets drawn from the model, estimated together by Levenberg–Marquardt, and the Laplace marginals checked for calibration against the truth.
- Spaces and quantities Every value in a model lives in a space, which fixes how it is stored, how it moves, and the typed handle code holds it by.
- Terms and the probabilistic graph A model's density is a sum of terms, each a log-density that scores one quantity or none; the terms and quantities together make the probabilistic graph inference reads, and a retirement removes some quantities, replaces their terms, and frees what it leaves needed by nothing.
- Queries and programs A query names what to compute from a snapshot and what is observed; compiled for a device and a precision, it becomes a program whose passes give values, tangents, gradients and Hessian-vector products in tangent charts.
- The normal distribution skoro's normal is the law of a point moved by normal noise through its space's chart, on every space whose chart is global, with an exact density and sampler, a scale in four forms, roles that estimators read, its tangent among them, and the Gaussian and improper Gaussian replacements of a retirement.
- Rotations and rigid motions The crate skoro-spatial declares the rotations, the rigid motions and the extended poses as embedded types stored as quaternions up to sign, with the Cayley chart, global on each group, and declared volumes, so that they carry the normal in whatever sign their quaternions are given, and writes their maps as composites whose derivatives are the core's.
- Linearization and elimination A density query is linearized at a batch of points into factored least-squares problems over its free quantities, by its residuals or by its information roots, and each problem is eliminated in square-root form on the host into a step, marginals, an evidence, draws, or a retirement's replacement; the Levenberg–Marquardt method iterates the steps to the mode.
- How skoro is developed Every change is an entry that moves through fixed stages, mathematics first and the pages last, each approved by a person before the next begins.
The documents of finished entries whose references it brought up to date:
- The core: Implementation Three crates (skoro-tensor, skoro-core and skoro) in which a model is built inside a writer's scope from typed quantities and operations, read as two graphs, compiled per query for a device and a precision, and differentiated to second order in tangent charts.
- The core: Mathematics The mathematics the core rests on, from quantities, their charts and their products, through operations and their derivatives of first and second order composed over programs, to queries, terms, importance weights, random keys and retirement.
- Examples that run: Implementation Two examples of the umbrella crate, a pose graph estimated in a batch and a sliding window over an open path, sharing one model builder, with the pieces they need added to the library where a user would need them too; a Levenberg–Marquardt method in skoro-linearize, the inverse retraction of a layout and the observation of generated values in the core, and two maps of the rigid motions on the host.
- Examples that run: Mathematics The model the examples share, a trajectory of poses on SE(3) with landmarks, odometry and sightings, generated from its own joint law and queried for the rest; a Levenberg–Marquardt method on its linearization, with its damping, schedule and stopping rule; the calibration of a Laplace approximation that data drawn from the model lets an example check; and a sliding window that retires a pose and the landmarks it alone sees at every tick.
- Improper Gaussian replacements: Implementation The improper Gaussian factor as `Stacked::improper` in skoro-normal, a builder of its rows, right-hand side, linear part and constant over a stacked tangent, which gives a retirement's replacement or a likelihood factor with its residual and its linear part bound, and the core's support, through every pass, for the values of no entries that a factor of no rows needs.
- Improper Gaussian replacements: Mathematics The improper Gaussian factor, a sum of squared affine rows of any number, a linear term and a constant in the stacked tangent of a retirement's blanket at constant anchors, which keeps what retired terms say about blanket quantities they do not determine, adds across retirements, and is the normal's Stacked replacement when it is of full rank.
- Improper Gaussian replacements Done A retirement whose terms do not determine its whole blanket, as for a landmark seen by bearing from one retired pose, now has a replacement that keeps exactly what those terms said: the improper Gaussian factor in the blanket's stacked tangent at constant anchors, of any number of rows, none included, which no normalization need make a density. Stacked::improper builds it in skoro-normal, with its numbers shared or given row by row of a batch, as a retirement's Replacement or a likelihood factor. Where its rows have full rank it is the normal's Stacked replacement, and factors over a quantity accumulate as terms, which the model reads as their sum, until they determine it. It binds its residual, and its linear part under the log-volume role, whose description now says what every least-squares reader takes from it: the varying part of a term's remainder, not the volume of a chart. A factor of no rows has a residual of no components, which the core could not carry: burn's expand refuses a dimension of zero and its reshape reads one as the source's size, so the tensor layer gained a broadcast and a reshape that give the tensor of no entries there, and every pass of the core now runs on values of no entries, on the host and on wgpu. The sum of factors, and a reduction of their rows, were left to a later entry.
- Linearization and elimination: Implementation Two crates, `skoro-elimination`, which eliminates factored least-squares problems in square-root form on the host, and `skoro-linearize`, which linearizes a query at a batch of points into such problems, by its residuals or by its information roots, and computes a retirement's replacement as an improper Gaussian; with the few additions to the core and the normal that they need.
- Linearization and elimination: Mathematics How a query of a model is linearized at a point into factors of whitened rows and linear terms over its free quantities' tangent coordinates, and how eliminating those factors gives the step of a Gauss–Newton or Levenberg–Marquardt method, a Laplace approximation's marginals, and a retirement's replacement, an improper Gaussian that is the update and prediction of a Kalman filter when it determines the blanket; and how the roots of the expected information give a second assembly, for Fisher scoring of free scales.
- Linearization and elimination Done This entry brought back the two pieces every least-squares method rests on, as two crates. skoro-elimination is the note on elimination in square-root form as code: factored problems over blocks of variables, scheduled once by COLAMD and a junction tree, eliminated clique by clique by faer's unpivoted QR on the host in double precision, and answering minimizers, integrals, draws, marginals and the factor a replacement leaves. skoro-linearize linearizes a density query at a batch of points into such problems, one per row: by each term's whitened residual, with the curved types' log-volumes folded into the right-hand sides and the others in a linear term read off the log-volumes themselves, or, for a free scale, by the normal's information root and a scale residual that carries its score. It refuses by structure what it cannot linearize, seeds one tangent pass by a colouring of the factor structure, and gives Gauss–Newton and Levenberg–Marquardt steps, marginals that name their curved quantities, and the Laplace approximation's evidence and draws in the chart. A retirement's replacement is now computed rather than written: the linearized integral of the retired terms, built as the normal's improper factor, which is the Kalman filter on linear-Gaussian terms and an iterated extended Kalman filter's step at their mode. The core gained the accessors an algorithm in another crate needs, and the normal binds its tangent under a role of its own. The methods themselves, an optimizer's loop, a damping schedule and a filter, are left to later entries.
- Reference measures and chart volumes of spaces: Implementation Every continuous `Space` gets a log-volume composite and a chart domain, an embedded declaration takes its chart's volume with `with_volume`, the core refuses a density, a proposal or an integration over a type without one, and `testing::check_volume` holds a declaration to the area formula.
- Reference measures and chart volumes of spaces: Mathematics Every continuous type of the core gets a reference measure and the log-volume of its retraction's chart, Lebesgue measure with log-volumes and on the core's own types, the measure the retraction normalizes on an embedded type that declares its chart's domain and log-volume, and sums over products; a type that declares none has no densities.
- Reference measures and chart volumes of spaces: Plan Reference measures and chart volumes built in order, from the declaration and the spaces' log-volumes through the core's refusals to the volume check and the sphere's tests, each task a commit with its tests.
- Normal distributions: Implementation A crate `skoro-normal` whose `Normal` scores a quantity of any space with a global chart, with its term built from composites of the core's operations, an exact sampler that runs the space's retraction on the host, the four forms of the scale, the roles with the information root, a likelihood factor over data, and the stacked tangent of a retirement's replacement.
- Normal distributions: Mathematics skoro's one normal distribution, the law of a point moved by normal noise through its chart, defined on every space whose chart is global and whose volume is known, so that flat, positive and curved quantities alike, measurements among them, are drawn and scored exactly; with its scale, its sampler, its properties, its expected information, its roles, and its use as a likelihood factor.
- Normal distributions Done skoro's first distribution, the normal, returns as one distribution for every space whose chart is global and whose volume is known: the law of the mean moved by normal noise through its chart, so that a measurement of a rotation, a direction or a pose is held as what was measured, observed in one query and simulated in another. Its term is the Gaussian log-density of the tangent at the mean less the chart's log-volume, which makes it an exact density against the type's reference measure from the core's measures; on the real line and vectors it is the familiar normal, and on the positive orthant the log-normal. Its sampler draws exactly by the space's own retraction; its scale is given in four forms; it binds the roles a least-squares or Fisher-scoring reader needs, the root of its expected information among them, exact on the flat spaces and stated with its error on curved ones; and it refuses, with the core's own errors, a chart that is not global, where no closed form keeps density and sampler exact. A measurement on a type without a volume or a global chart is a likelihood factor over data, and the stacked tangent gives a retirement's Gaussian replacement its form. The new crate skoro-normal holds it, tested on the core's two test spheres.
- Observed quaternions of arbitrary sign on outside data: Implementation The core declares a type stored up to a finite group of linear maps and checks it; skoro-spatial's rotations, motions and extended poses become SO(3), SE(3) and SE₂(3) under the Cayley chart, stored up to the quaternion's sign; their maps that read the sign are replaced by those of the shorter turn; and a pose graph read from g2o text is estimated in whatever signs it is given.
- Observed quaternions of arbitrary sign on outside data: Mathematics A unit quaternion names a rotation twice, and the stereographic chart of the unit quaternions tells the two names apart, so that a measurement given with the wrong sign is misread; the rotations, the rigid motions and the extended poses become the groups themselves, stored as quaternions up to sign under the Cayley chart, which cannot tell the signs apart, and the core learns to declare a type stored up to a finite group.
- Observed quaternions of arbitrary sign on outside data Done The rotations, the rigid motions and the extended poses were declared as the unit quaternions and their products, with the stereographic chart, which tells from : an observed quaternion had to be given the sign of its prediction by its caller, and one given with the other sign was read as nearly a full turn away, and could wind a turn into a pose graph's estimate without notice. This entry makes them the groups themselves, , and , still stored as quaternions but up to their sign, under the Cayley chart, global on each group and blind to the sign, so that the normal on them is the law of the rotation and a measurement is observed in whatever sign it comes. The core learned to declare a type stored up to a finite group of signed permutations of its storage, and to check it, with none of its derivatives changed; every map of the rotations became a map of the group, the logarithm, its axis and angle and the interpolations those of the shorter turn; and the linearizer refuses a point at which a factor is not finite, which is how a value a half-turn from its mean, the Cayley chart's cut, is reported. The mathematics first worked out a sign-free mixture of two normals on the quaternions, and turned to the chart instead when the mixture would have needed a second law and a correction on every term. A reader of g2o's pose graphs, an example estimating one in arbitrary signs, and tests on a loop whose closure starts on the far side of its prediction show it on outside data.
- Rotations and rigid motions: Implementation A crate `skoro-spatial` declaring the unit quaternions, the rigid motions and the extended poses as embedded types with their volumes, and every map of the mathematics as a composite of the core's operations, typed by markers, reached through operators and extension traits, with host helpers for the values a model is given.
- Rotations and rigid motions: Mathematics The rotations as unit quaternions with the stereographic chart, global and full with a declared volume so that they carry the normal, the rigid motions SE(3) and SE₂(3) as their semidirect products with the left-translated chart, and the usual maps of all three, each a composite of the core's operations.
- Rotations and rigid motions Done skoro's first curved types of its own: the rotations , the rigid motions and the extended poses , a pose with a velocity, held as the unit quaternions and their semidirect products with one and two copies of , double covers of the three groups. The new crate skoro-spatial declares them as embedded types on the core's public interface, each with a global chart, stereographic in the rotation and moving the translations in the point's own frame, and a volume declared against Haar measure, so that an attitude, a pose or an extended pose is scored by the normal, observed and simulated like any other quantity. Every usual map is a composite of the core's operations, with no kernel and no derivative of its own: compositions and actions, matrices and adjoints, exponentials and logarithms, the Jacobians and their inverses with their removable singularities computed by series, interpolations and the angle between rotations, and the constructions from axes and angles, pairs of directions, matrices and Euler angles in all twelve conventions. The archive branch's matrix storage, exponential charts and fused kernels are not kept: the normal's need for a global chart decided the storage and the chart. The mathematics was reopened once, after the build, to treat the Euler angles at both of their singularities, the lock and the wrap at , which it proves cannot be removed; the residual of angles on the circle and a lock threshold set by its cost came of it, and the implementation was revised to say what each map gives within rounding of a row where it is undefined, rather than promise non-finite values there. No earth frame is assumed: frames are the user's to compose.
- Accuracy on the GPU: Mathematics How the absolute error of a GPU's sine and cosine reaches the closed forms of the removable singularities and their derivatives, measured on a wgpu adapter; the error the cutoffs are designed for and how a device is admitted to it; and the conditions a cutoff and its series must meet so that single precision on the GPU agrees with double precision as it does on the CPU.
History
- Started at writeup
- Approved writeup
9423959 - Approved publish
a7dd3d2