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: the bare J / J^T for one measurement operator, plus its reductions.

ScalarOutputKind

Kinds whose output is a scalar per measurement (apply / entries): every mode is contracted, so

ProbeOutputKind

Kinds whose output is a vector per measurement per mode (probe): one free mode each, so the

ApplyKind

The all-modes apply: one scalar per measurement. Unweighted (no mode or order axis).

EntriesKind

The all-modes entries: one scalar per multi-index. Unweighted.

ProbeKind

The vector-valued probe (one free mode per measurement), optionally per-mode weighted.

ApplyDerivativesKind

Symmetric directional derivatives of the all-modes apply, orders 0..order, in direction P.

EntriesDerivativesKind

ApplyDerivativesKind at integer grid points. sample = (index, pp). Order-only weight.

ProbeDerivativesKind

Vector-valued derivative probing: the residual is a list of d order-leading arrays.

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)

Module Contents#

APPLY#
ENTRIES#
PROBE#
probe_kind#
apply_derivatives_kind#
entries_derivatives_kind#
probe_derivatives_kind#