skoro-core is everything that makes a model a model.
It holds the spaces quantities live in (the Euclidean and positive types, products, the discrete types, and the embedded types that later crates declare from a retraction and its inverse) and the typed handles code holds them by, and gives every continuous space a reference measure through the log-volume of its chart: Lebesgue measure on its own types, and on an embedded type that declares its chart’s volume, the measure its retraction normalizes.
An embedded type may be stored up to a group of signed permutations of its storage, as the rotations are stored as quaternions of either sign, and its charts and volume are then read on its points.
A space whose measure has finite mass has a uniform distribution: a categorical space by its count, an embedded type by the log-mass and the uniform draw it declares, and a product by its factors, and every other space answers NoMass.
A space without a measure has no densities, and the core refuses to score, propose or integrate out a quantity of it.
It holds operations: the trait every operation implements, the kernels they are lowered to with derivatives up to second order, the primitives, composites, and the registry that makes an operation again from its name and parameters.
It holds the model itself: the writer that builds it in scopes and publishes snapshots, branches and readers, addresses and namespaces, and the terms that make the probabilistic graph, with their samplers, proposals and roles; the Distribution trait, by which a distribution scores a quantity; and sample, which makes a quantity and scores it by a distribution in one call.
It compiles queries for a target into programs, whose passes give values, tangents, gradients and Hessian-vector products in tangent charts, for values of any number of entries, none included, as a Vector(0) or a Matrix(0, n), and it holds generation, which draws a model’s free quantities from explicit random keys and weighs the draw, and retirement, which removes the quantities at a collection of addresses, named one by one or as the namespaces they lie under, and keeps what they said about the rest as a likelihood factor over their Markov blanket, which the caller builds with the roles it binds, and whose handle the retirement gives back.
A retirement also frees every node it leaves needed by nothing, so that a model that retires as it grows stays bounded, and pin and unpin keep a node the user still needs, such as a constant made once for a whole run.
An algorithm in another crate reads what it needs through the same interface: a query’s terms and observations, and the union of two sets of observations; the quantities any node is reached from; whether a composite reads an input, and so whether a space’s chart volume depends on its point; a constant of a space known only at run time; observations of a value that differs from row to row, as generation draws it; and a layout’s inverse step, the tangent at one point that reaches another. The linearization is built on these alone.
Its testing module is public, so that a later crate checks its own operations and embedded types the way the core checks its primitives: against finite differences, at both precisions, with the precision_tests! macro, a declared chart volume against the area formula, a declared mass against its draw and its volume, and a type stored up to a group against each condition its group asks, with close_up_to to compare stored values as points.
Its wgpu target is admitted before any test uses it: Admission measures the adapter’s sine and cosine against double precision, and refuses an adapter whose absolute error exceeds what the removable singularities’ cutoffs are designed for, as Accuracy on the GPU works out.
Reading order
The modules in an order that uses as little as possible before it is read, computed
from the sources when the site was built. A dashed arc marks a module's use of one
that comes later, with what it uses named beside it.
uses an earlier moduleuses a later modulea cycle (21 modules)
Hover over or tap a module to see everything it uses and everything that uses it.
21 uses of a later module, naming 24 items: a cycle too large to order exactly was ordered greedily, so there may be fewer.