fitting#

Sampling-kind primitives for the geometry-generic Gauss-Newton fitting model.

The Gauss-Newton model m(p) = c + gᵀp + ½ pᵀ(JᵀJ)p of a least-squares objective factors over two independent choices, and the fitting layer is generic in both:

  • the sampling kind (apply / entries / probe) – the bare single-sample Jacobian 𝒥 / its transpose 𝒥ᵀ (from t3toolbox.backend.probing), plus the kind-specific ‖·‖² reduction over the sample stack; and

  • the geometry (manifold / corewise) – the gauge projection Π (geometry.project), with the Riemannian forward J = 𝒥∘Π and gradient Jᵀr = Π∘𝒥ᵀr.

This module supplies the kind half: a SamplingKind descriptor bundling the bare probing primitives + the reduction per kind (APPLY / ENTRIES / PROBE). The geometry half lives in the geometry (t3toolbox.manifold.MANIFOLD / COREWISE); the frontend t3toolbox.fitting.GaussNewtonModel composes the two. The §6.3 corewise substitution (U,O,P,Q) -> (U,G,G,G) is now nothing but CorewiseGeometry.frame – there is no separate corewise backend.

probe is vector-valued (one free mode per probe), so its residual / forward output is a sequence of d arrays and its reduction sums the free mode too; apply / entries are the scalar all-modes special case. The objective constant c = ½‖r‖² is just ½ · sumsq(r) (the same reduction as the model’s quadratic term ½‖𝒥Πp‖²), so the kind needs no separate objective function.

Attributes#

Classes#

SamplingKind

A sampling kind's bare primitives, bundled so the GN model is generic over the kind.

Functions#

sumsq_over_samples(out, n_w)

The ‖·‖² reduction for the scalar-output (apply / entries) kinds: sum out**2 over the

sumsq_over_probes(zz, n_w)

The ‖·‖² reduction for the vector-output probe kind: sum over the leading n_w sample

block_sumsq_over_samples(out, n_w, has_order)

Per-(mode, order) sum-of-squares for the scalar-output apply/entries kinds -> a 2-D

block_sumsq_over_probes(zz, n_w, has_order)

Per-(mode, order) sum-of-squares for the vector-output probe kinds -> a 2-D (d, n_order)

probe_kind([weight])

The probe sampling kind (vector-valued: one free mode per probe), optionally per-mode

apply_derivatives_kind(order[, weight])

The apply-derivatives sampling kind (operator only): symmetric directional derivatives of the

entries_derivatives_kind(order[, weight])

The entries-derivatives sampling kind: like apply_derivatives_kind() but at integer

probe_derivatives_kind(order[, weight, chunk_size])

The probe-derivatives sampling kind: vector-valued (one free mode per probe), so the residual

Module Contents#

APPLY#
ENTRIES#
PROBE#