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.
A model holds a joint distribution and computes nothing by itself. Computation starts with a query: what to compute, and which quantities are observed. A query is compiled from a snapshot for a target (a device and a precision) into a program, whose passes compute values and derivatives. This page describes the three in turn.
A query#
crates/skoro-core/src/query.rs lines 105–136impl Query {
/// The values of `targets`, with nothing observed.
pub fn of(targets: impl IntoIterator<Item = QDyn>) -> Query {
Query {
targets: Targets::Nodes(targets.into_iter().map(|q| q.id()).collect()),
observations: Observations::new(),
}
}
/// The sum of every term's log-density: the program's one target, `NodeId::DENSITY`.
pub fn log_density() -> Query {
Query {
targets: Targets::Density,
observations: Observations::new(),
}
}
/// The sum of the log-densities of these terms, named by their log-density nodes.
pub fn log_density_of<T: Into<NodeId>>(terms: impl IntoIterator<Item = T>) -> Query {
Query {
targets: Targets::DensityOf(terms.into_iter().map(Into::into).collect()),
observations: Observations::new(),
}
}
/// The same targets, given `observations`.
pub fn given(self, observations: Observations) -> Query {
Query {
observations,
..self
}
}A query’s targets are some nodes of the model, or the log-density: the sum of every term, or of some. Its observations give values to some quantities. Every quantity a target is computed from and that is not observed is free: the program takes its value as an input, and differentiates with respect to it. So the same model, with the same terms, answers different questions: with the measurements observed, the log-density is a posterior of the states up to a constant; with nothing observed, it is the joint; and the query of a term’s own value needs no observations at all.
Observations are built up one quantity at a time, each extension a new set with an identity of its own.
A caller keeps one set and passes it to every compile, and the identity is what the compiled program is cached under.
A value that differs from row to row of a batch, such as one that generation drew, is observed whole, one value per row, by observe_value; a value that does not fit the quantity is refused when the set is used, as observe refuses one:
crates/skoro-core/src/query.rs lines 45–58/// This set with `quantity` observed at `value`, one value per row of a `Points` as `generate`
/// gives it: a new set. A discrete value, or one of another storage than the quantity's
/// space, is read when the set is used, as `observe` defers a bad value (`ValueShape`).
pub fn observe_value(self, quantity: impl Into<QDyn>, value: &Value) -> Observations {
let host = match value {
Value::Continuous(points) => HostValue::new(
Some(points.rows()),
points.storage(),
HostData::Continuous(points.to_host()),
),
Value::Discrete(_) => None,
};
self.insert(quantity.into().id(), host)
}A query gives back what it was made with, so that an algorithm handed one can compile programs of its own under the same observations, as the linearizer does with the nodes the terms bind:
crates/skoro-core/src/query.rs lines 138–152/// The observations the query is given.
pub fn observations(&self) -> &Observations {
&self.observations
}
/// The terms whose log-densities a density query sums, in the order they were added: every
/// term of `snapshot` for `log_density()`, the named ones for `log_density_of`; `None` for a
/// query of nodes.
pub fn terms(&self, snapshot: &Snapshot) -> Option<Vec<NodeId>> {
match &self.targets {
Targets::Nodes(_) => None,
Targets::Density => Some(snapshot.0.terms.keys().copied().collect()),
Targets::DensityOf(terms) => Some(terms.iter().copied().collect()),
}
}Two sets of observations join by Observations::union, which keeps the first set’s value of a quantity both observe, and is the first set itself when the second adds nothing.
A target#
A target is where a program computes and at what precision, checked once, when it is made:
crates/skoro-tensor/src/target.rs lines 36–79/// Where a program computes, and at what precision. Checked once, here.
#[derive(Clone, PartialEq, Eq, Debug)]
pub struct Target {
device: Device,
precision: Precision,
wide_integers: bool,
}
impl Target {
/// Refuses a device that is not Flex or wgpu (`UnsupportedDevice`), an autodiff device
/// (`AutodiffDevice`), and a precision the device does not compute in (`UnsupportedPrecision`).
pub fn new(device: Device, precision: Precision) -> Result<Target, TensorError> {
let name = format!("{device:?}");
// Checked first: an autodiff device wraps a device that may otherwise be supported.
if device.is_autodiff() {
return Err(TensorError::AutodiffDevice { device: name });
}
if !supported(&device) {
return Err(TensorError::UnsupportedDevice { device: name });
}
if !device.supports_dtype(precision.float_dtype()) {
return Err(TensorError::UnsupportedPrecision {
device: name,
precision,
});
}
let wide_integers = device.supports_dtype(DType::I64);
Ok(Target {
device,
precision,
wide_integers,
})
}
/// The Flex device at double precision: where the model folds constants.
pub fn host() -> Target {
// The Flex device computes at double precision with 64-bit integers, which
// `wide_integers_on_the_host` checks against `new`.
Target {
device: Device::flex(),
precision: Precision::Double,
wide_integers: true,
}
}skoro computes on burn’s Flex device (the CPU) and on wgpu devices, in single or double precision.
The model itself commits to neither: precision belongs to the query, and two programs compiled from one snapshot may run at different precisions side by side. Target::host() is the Flex device at double precision, where the model folds its constants.
A target’s elementary functions are not equally accurate everywhere. The CPU’s sine is accurate relative to its value, as a library’s is. A GPU’s is accurate only to an absolute error, about on the adapter skoro is tested on, whatever the argument. Near , where is small, that is a large relative error. A formula that cancels its numerator to a power of a small argument and divides by that power amplifies it, and so do the formula’s derivatives, more with each order, as the note on removable singularities in floating point works out. skoro’s own such formulas, the removable singularities of its rotations, switch to a series far enough from that they hold on a GPU whose sine and cosine err by up to on (see the rotations). A model that writes one of its own needs the same care.
Compiling#
A snapshot compiles a query for a target with Snapshot::compile(&self, query: &Query, target: &Target) -> Result<Arc<Program>, Error>.
Compiling walks back from the targets through the compilation graph, keeping only the operations they need, lowers each operation for the target, and folds what the observations fix: an operation all of whose inputs are observed or constant is computed once, when the program is made, and never again.
- Quantity
- Mapped value
- Free root: an input of the program
- Constant root
- Step
- Folded step: a constant root
- input of
crates/skoro-core/tests/queries.rs lines 327–355#[test]
fn observed_values_fold_once_per_program() {
let (operation, calls) = counted();
let mut writer = Writer::new();
let (o, f) = writer
.build(|| {
let o = quantity("o", Vector::<2>);
let x = quantity("x", Vector::<2>);
let c = apply(operation, &[o.untyped()]);
(o, (c * x.untyped()).sum())
})
.unwrap();
let observed = Observations::new().observe(o, [1.0, 2.0]);
let program = writer
.snapshot()
.compile(&Query::of([f]).given(observed), &Target::host())
.unwrap();
assert_eq!(
calls.load(Ordering::Relaxed),
1,
"once, when the program is compiled"
);
let x = program.free()[0].node;
for _ in 0..2 {
let at = Values::new().with(x, value(&[3.0, 4.0], &Target::host()));
assert_eq!(host(&program.forward(&at).unwrap(), f), [11.0]);
}
assert_eq!(calls.load(Ordering::Relaxed), 1, "and never again");
}Every step
countedis the identity, with a kernel that counts the times it runs.- A model in which is computed from the quantity alone, and .
- The observations give a value. They belong to the query: the model does not change.
- Compiling walks back from the target through the compilation graph, and reaches every node is computed from.
- Each quantity reached becomes a root of the program. is observed, so it is a constant, loaded on the target; is not, so it is free: the passes take a value of it, and differentiate with respect to it.
- Each operation reached is lowered to a kernel for the target, and becomes a step reading its inputs' slots.
- Every input of 's step is a constant, so the step folds: its kernel runs now, once, and its output becomes a constant root.
- No step reads 's value now, so the prune drops it: a program keeps what its targets need, and its free roots.
- Each evaluation runs the steps that are left, from the value of it is given and the folded constant.
- Two evaluations later, the counted kernel has still run once.
A selection by an observed index, shared by every row, keeps only the branch it selects. And a composite is lowered by expanding its body in place, so that the program differentiates through the primitives it is built from:
mix mix.call× sin + sin × × · exp + + Σ× sin +- Quantity
- Mapped value
- A call of a composite
- Free root: an input of the program
- Step
- input of
crates/skoro-core/tests/passes.rs lines 25–51
fn mix() -> Arc<Composite> {
let v = Space::Vector(2);
Composite::define(
"test.mix",
Vec::new(),
&[v.clone(), v, Space::Real],
|inputs| {
let (x, y, s) = (inputs[0], inputs[1], inputs[2]);
((x * y).exp() + s * x.sin() + x * x).sum()
},
)
.unwrap()
}
fn model(writer: &mut Writer) -> Model {
let mix = mix();
writer
.build(|| {
let x = quantity("x", Vector::<2>).untyped();
let y = quantity("y", Vector::<2>).untyped();
let s = quantity("s", Real).untyped();
let f = mix.call(&[x, y, s]);
let g = x * y + y.sin();
Model { x, y, s, f, g }
})
.unwrap()Every step
mixdefines a composite: a named subgraph, with three inputs and one output, built once by the code a model would use.- A model of three quantities.
- A call of
mixis one node of the model: the snapshot holds the call, and the composite holds its body. - is built of primitives, a node for each.
- The tests compile the query of , which walks back from both targets; each quantity it reaches is free.
- 's operation lowers to its composite, which is expanded in place: the body's operations become steps of the program, reading the slots of the call's arguments. Each step is attributed to , so that a pass which refuses one names the node that was written.
- 's operations lower to a kernel each. Its product is a step apart from the one in
mix: they are two nodes, and each node is emitted once. - In the program, fans out to four steps: three from the body of
mix, one from .
mix is . On the left, the compilation graph; on the right, the computation graph of the program for .A snapshot keeps its most recently used programs, so compiling the same query again, for the same target and the same set of observations, returns the same program:
- A set of observations
- A key
- A program
- keys
- is kept with
crates/skoro-core/tests/queries.rs lines 444–460#[test]
fn same_observations_reuse_the_program() {
let e = example();
let observed = Observations::new().observe(e.x0, [0.3, -0.2]);
let query = Query::log_density().given(observed.clone());
let (a, b) = (
e.compile(&query),
e.compile(&Query::log_density().given(observed)),
);
assert!(Arc::ptr_eq(&a, &b));
let separately = Observations::new().observe(e.x0, [0.3, -0.2]);
let c = e.compile(&Query::log_density().given(separately));
assert!(
!Arc::ptr_eq(&a, &c),
"an equal set built separately is another set"
);
}Every step
- The running example; its writer's snapshot keeps the programs compiled from it.
- Observing a quantity extends the empty set into a new set, with a fresh identity: .
- A clone is the same set, and shares its identity.
compilelooks up the key of the query's targets, its set's identity and the target. Nothing is kept under it, socompilecompiles the program and keeps it there.- The same targets, the same identity and the same target make the same key: the same program comes back, and becomes the most recently used.
- A set built apart from the first, with the same value, has an identity of its own: .
- So its key is another, and
compilecompiles a second program. The cache compares identities, never values, which is why a caller keeps one set and passes it to every compile. - When a 33rd program is kept, the least recently used one is dropped.
Passes#
A program runs a pass over a batch of rows, given a value of each free quantity. Here are the passes over the program compiled above:
- Free root: an input of the program
- Step
- input of
crates/skoro-core/src/program.rs lines 288–332/// The targets' values.
pub fn forward(&self, at: &Values) -> Result<Values, Error> {
Ok(self.run(at, Mode::Forward)?.values)
}
/// Tangent frames at free continuous quantities in, at the targets out. A free quantity given
/// no frame has a zero one.
pub fn tangent(&self, at: &Values, tangents: &Frames) -> Result<(Values, Frames), Error> {
let outcome = self.run(at, Mode::Tangent { tangents })?;
Ok((outcome.values, outcome.tangents))
}
/// Cotangent frames at the targets in, at every free continuous quantity out.
pub fn cotangent(&self, at: &Values, seeds: &Frames) -> Result<(Values, Frames), Error> {
let outcome = self.run(at, Mode::Cotangent { seeds })?;
Ok((outcome.values, outcome.alpha))
}
/// Velocities at some free continuous quantities, one cotangent column at the targets: `α`
/// and `β` at every free continuous quantity.
pub fn hessian(
&self,
at: &Values,
velocities: &Frames,
seeds: &Frames,
) -> Result<Second, Error> {
let outcome = self.run(at, Mode::Hessian { velocities, seeds })?;
Ok(Second {
values: outcome.values,
alpha: outcome.alpha,
beta: outcome.beta,
})
}
/// `cotangent` of a program's single `Real` target, seeded with one.
pub fn gradient(&self, at: &Values) -> Result<(Values, Frames), Error> {
let seeds = self.unit_seed(at)?;
self.cotangent(at, &seeds)
}
/// `hessian` of a program's single `Real` target, seeded with one.
pub fn hessian_products(&self, at: &Values, velocities: &Frames) -> Result<Second, Error> {
let seeds = self.unit_seed(at)?;
self.hessian(at, velocities, &seeds)
}Every step
forwardruns every step once, in order, from the free values it is given to the targets' values; a value is dropped after the last step that reads it, unless it is a target.tangentruns along the same edges, each step's kernel pushing its inputs' tangent frames forward to its output as well.- A cotangent pass is seeded with a cotangent frame at each target: here, at and .
- It runs the program forward, recording each step's pull-back, and then pulls the seeds back along every edge, against the forward order.
- Where a value fans out, the pull-backs along its edges add: 's cotangent is the sum of four. The pass gives a cotangent at every free continuous quantity, in its tangent chart.
- A program whose one target is a
Real, such as a log-density, also hasgradient: the cotangent pass seeded with one. This program has two targets, so its seeds are the caller's.
forward gives the targets’ values. tangent pushes tangent frames forward from the free quantities to the targets; cotangent pulls cotangent frames back from the targets to every free quantity; and hessian does the latter with velocities at the free quantities, giving the second-order products as well.
For a program whose single target is a Real, such as a log-density, gradient and hessian_products seed that target with one.
Every derivative is taken in tangent charts: with respect to a tangent vector at the point, through the retraction of each free quantity, so a gradient has the dimension of the quantity’s tangent space and an estimator’s step is retracted back onto it. The note on smooth maps and retractions says what such a derivative is, and the note on gradients and Hessians in tangent charts says where the Hessian in a chart differs from the Hessian of the pulled-back function.
A program’s layout lays its free continuous quantities out in one tangent vector, in ancestral order, for algorithms that work with the whole of it at once.
An estimator’s step is such a vector, and the layout moves the quantities along it by the retraction of the product of their spaces:
- A quantity's value
- A tangent vector
- A point of the product
- A retraction, as a composite
- Its program, compiled for a target
- input of
- calls
- is compiled into
crates/skoro-core/tests/queries.rs lines 664–693#[test]
fn flat_step_is_the_product_retraction() {
let mut writer = Writer::new();
let (x, p, y, f) = writer
.build(|| {
let x = quantity("x", Vector::<2>);
let p = quantity("p", Positive::<1>);
let y = quantity("y", Matrix::<2, 1>);
let real = p.as_real().sum();
(x, p, y, (x * x).sum() * real + (y * y).sum() * real * real)
})
.unwrap();
let target = Target::host();
let program = writer
.snapshot()
.compile(&Query::of([f.untyped()]), &target)
.unwrap();
let layout = program.layout();
let at = Values::new()
.with(x, value(&[0.5, -1.0], &target))
.with(p, value(&[2.0], &target))
.with(y, value(&[0.25, 3.0], &target));
let t = [0.1, 0.2, -0.3, 1.0, -2.0];
let step = layout
.retract(&at, &Points::from_host(&t, 1, 5, &target), &target)
.unwrap();
// The product's retraction, factor by factor.
assert_eq!(host(&step, x), [0.6, -0.8]);
assert_eq!(host(&step, p), [2.0 * (-0.3f64).exp()]);
assert_eq!(host(&step, y), [1.25, 1.0]);Every step
- A model of three free quantities, of three spaces, and a program of a function of them.
- The program's layout: its free continuous quantities, in ancestral order, as one point of the product of their spaces, of dimension 5.
- An estimator's step is a tangent vector of that dimension, the blocks of the quantities laid end to end.
retractstacks the quantities' values into one point of the product.- It needs the product's retraction.
Space::retractionkeeps one composite for each space and map, for the life of the process: the first time, it defines the product's, whose body slices each factor out and calls that factor's retraction, so those are defined and kept too. - The layout compiles the composite for the target, once, and keeps the program; the calls of the factors are expanded into it.
- The program moves the point along , and the result is sliced back into the quantities.
- Factor by factor: a Euclidean factor adds its block of , and the positive one is multiplied by the exponential of its block, .
- The next step, on the same target, finds the composite and its program both kept, and compiles nothing.
Layout::local inverts the step: the tangent coordinates at one point that reach another, by the product’s inverse retraction.
It measures how far an estimate is from a value, such as the truth, in the estimate’s own chart, where its covariance is:
crates/skoro-core/src/layout.rs lines 112–133/// `of ⊖ at`: the tangent coordinates at `at` that reach `of`, `[rows, dimension]` on `target`,
/// by the product's inverse retraction, compiled once per target. It inverts `retract` on the
/// chart's image: `local(retract(at, τ), at) = τ`. It refuses as `retract` does
/// (`MissingValue`, `NotContinuous`).
pub fn local(&self, of: &Values, at: &Values, target: &Target) -> Result<Points, Error> {
let (y, x) = (self.stack(of, target)?, self.stack(at, target)?);
let program = self.inverse(target)?;
let inputs = program.free();
let (Some(first), Some(second)) = (inputs.first(), inputs.get(1)) else {
unreachable!("an inverse retraction takes two points")
};
let values = Values::new()
.with(first.node, Value::Continuous(y))
.with(second.node, Value::Continuous(x));
let out = program.forward(&values)?;
let Some(Value::Continuous(tangent)) =
program.targets().first().and_then(|&id| out.get(id))
else {
unreachable!("an inverse retraction gives a tangent")
};
Ok(tangent.clone())
}What a pass may refuse#
Before running anything, a pass checks that it can be carried: every step on it must have a kernel of the order it needs. A step is on a pass when its output is continuous and reaches a target, and one of its continuous inputs is reached from a free quantity. It needs order one on a gradient pass, and order two on a Hessian pass when one of its inputs carries a velocity. A program that cannot carry a pass refuses it, naming the first step that falls short, the composites it was expanded from, and its node, rather than computing a wrong derivative. The tests of admissibility ask passes of a small model whose one operation they choose the order of:
- Free root: an input of the program
- Step
- Refused: its kernel falls short
- input of
crates/skoro-core/tests/order.rs lines 180–316/// `f = sum(S(y) + x ⊙ x)` and `g = sum(x)`, with `S` the square of the given variant.
struct Model {
writer: Writer,
x: QDyn,
y: QDyn,
f: QDyn,
g: QDyn,
}
fn model(operation: Arc<dyn Operation>) -> Model {
let mut writer = Writer::new();
let (x, y, f, g) = writer
.build(|| {
let x = quantity("x", Vector::<2>).untyped();
let y = quantity("y", Vector::<2>).untyped();
let f = (apply(operation, &[y]) + x * x).sum();
(x, y, f, x.sum())
})
.unwrap();
Model { writer, x, y, f, g }
}
impl Model {
fn program(&self, targets: &[QDyn]) -> Arc<Program> {
let query = Query::of(targets.iter().copied());
self.writer
.snapshot()
.compile(&query, &Target::host())
.unwrap()
}
fn at(&self) -> Values {
let target = Target::host();
Values::new()
.with(self.x, value(&[0.5, -1.5], &target))
.with(self.y, value(&[2.0, 0.25], &target))
}
fn velocity(&self, q: QDyn) -> Frames {
Frames::new().with(q, Frame::from_host(&[1.0, -2.0], 1, 2, 1, &Target::host()))
}
}
#[test]
fn first_order_step_off_the_pass_admits_a_hessian() {
// Fed only by an observed quantity: the step is folded before any pass.
let (operation, _) = square(1);
let m = model(operation);
let observed = Observations::new().observe_dyn(
m.y,
HostValue::new(None, 2, HostData::Continuous(vec![2.0, 0.25])).unwrap(),
);
let query = Query::of([m.f]).given(observed);
let program = m
.writer
.snapshot()
.compile(&query, &Target::host())
.unwrap();
let at = Values::new().with(m.x, value(&[0.5, -1.5], &Target::host()));
let velocities =
Frames::new().with(m.x, Frame::from_host(&[1.0, 0.0], 1, 2, 1, &Target::host()));
assert!(program.hessian_products(&at, &velocities).is_ok());
// Reaching no target the pass seeds: the step feeds `f`, and the pass seeds `g`.
let program = m.program(&[m.f, m.g]);
let (seeded, targets) = ([m.x.id(), m.y.id()], [m.g.id()]);
let pass = Pass::Hessian {
seeded: &seeded,
targets: &targets,
};
assert!(program.admits(&pass).is_ok());
let seeds = Frames::new().with(m.g, Frame::from_host(&[1.0], 1, 1, 1, &Target::host()));
let velocities = m.velocity(m.y);
assert!(program.hessian(&m.at(), &velocities, &seeds).is_ok());
}
#[test]
fn first_order_step_without_velocity_admits_a_hessian() {
let (one, _) = square(1);
let (two, _) = square(2);
let (first, second) = (model(one), model(two));
let pass = |m: &Model| {
m.program(&[m.f])
.hessian_products(&m.at(), &m.velocity(m.x))
.unwrap()
};
let (a, b) = (pass(&first), pass(&second));
for (qa, qb) in [(first.x, second.x), (first.y, second.y)] {
assert_eq!(
a.beta.get(qa).unwrap().to_host(),
b.beta.get(qb).unwrap().to_host()
);
assert_eq!(
a.alpha.get(qa).unwrap().to_host(),
b.alpha.get(qb).unwrap().to_host()
);
}
}
#[test]
fn first_order_step_with_velocity_refuses_a_hessian() {
let (operation, _) = square(1);
let m = model(operation);
let error = m
.program(&[m.f])
.hessian_products(&m.at(), &m.velocity(m.y))
.unwrap_err();
assert!(
matches!(
error,
Error::OrderTooLow {
operation: "test.square1",
..
}
),
"{error:?}"
);
}
#[test]
fn zero_order_step_on_the_pass_refuses_a_gradient() {
let (operation, _) = square(0);
let m = model(operation);
let program = m.program(&[m.f]);
assert!(
program.forward(&m.at()).is_ok(),
"the forward pass needs order zero alone"
);
let error = program.gradient(&m.at()).unwrap_err();
assert!(matches!(
error,
Error::OrderTooLow {
operation: "test.square0",
..
}
));
}Every step
- The first test compiles the program for , with of order one: five steps over two free quantities.
- A Hessian pass seeds velocities at and and a cotangent at alone. From the free quantities, every step is reached.
- Back from the target the pass seeds, only is reached, and through it.
- A step is on the pass when it is reached both ways: here 's sum alone. runs forward only, which asks order zero of it, so its kernel of order one holds nothing back and the pass is admitted.
- Another test compiles alone, with of order zero. A forward pass asks order zero of every step, and runs.
- A gradient seeds . Every step is reached from a free quantity and reaches , so every step is on the pass, and each needs order one.
- has order zero, so the pass is refused before any kernel runs, with
OrderTooLownaming its operation, the composites it was expanded from (none here) and its node. - With of order one, a Hessian pass with a velocity at asks order two of the steps fed from , and order one of , which is fed from alone: it is admitted.
- With the velocity at instead, is fed from it and needs order two, so the pass is refused, naming
test.square1.
In the same spirit, an algorithm that differentiates refuses a program with a free discrete quantity, which it could not condition on.
How this came to be
The development behind this page, newest first:
- Least squares, motivated from MAP estimation and trust regions Done This entry reordered the mathematics' part on least squares and Gaussian approximations so that it begins with the estimate sought and ends with the linear algebra that computes it. Five notes are…
- Smooth maps before retractions Done The Mathematics section used to define a retraction by its derivative at the origin before it said what a derivative on a manifold is. This entry reordered that foundation. The first note, now Smooth…
- The Mathematics section, read start to finish Done 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…
- Examples that run Done This entry gave skoro two examples that run, in the umbrella crate, each a cargo run --example target that CI runs and that fails when a check of its mathematics fails. pose_graph draws a hundred…
- 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…
- Accuracy on the GPU Done Three checks of single against double precision passed on the CPU and failed on a wgpu adapter, where CI cannot run them: two of the pose's left Jacobian in the rotations' tests, and one of the…
- The core Done The core of skoro, built to the charter: three crates in which a model can be built, queried and differentiated, but no distribution exists yet. skoro-tensor is the layer over burn, whose tensors are…
Built on by
- 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.