uniform_fitting#

Uniform-layer fitting: the packed SamplingKind classes and the least-squares Problem.

The uniform twins of t3toolbox.backend.fitting’s kinds – subclasses that override the five layer-specific operations and, for the probe kinds, where omega’s axes sit in the PACKED output. Each carries the fixed rank it was built at (shape + the plain-UT3 masks) as FIELDS, so a rebuilt kind of the same rank is the same jax cache key (t3toolbox.backend.geometry follows the same rule; the reasoning is docs/contributor/parameters_not_closures.md).

uniform_least_squares_problem() packs the loop-invariant sample + data ONCE and returns the shared backend Problem, so the optimizers run fully packed – no per-matvec pack/unpack. The geometry half lives in t3toolbox.backend.geometry.

Protocol note (review H2-9, ruled keep + document): the kinds’ forward / transpose keep the ragged Kind protocol’s (v, sample, frame_data, sweep) signature even though the packed sweep already carries the sample and the frame – the extra arguments are deliberately unread. Protocol uniformity is the point: generic code (the shared LocalModel) calls every kind the same way, ragged or uniform.

Classes#

Functions#

uniform_sampling_kind(name, x0_data[, weight])

Build the uniform plain sampling kind by name, at x0's fixed rank. Only the vector-valued

uniform_derivatives_kind(name, x0_data, order[, ...])

Build the uniform derivative sampling kind by name, at x0's fixed rank.

pack_sample(name, sample, N)

Pack the loop-invariant mode-vectors of sample once (mirror-tolerant: packed input is kept).

pack_data(name, data, N)

Pack the observed data (or a residual of the same shape) once: probe kinds -> a packed

uniform_minimal(x0[, sharing])

Reduce x0 to its structurally-minimal ranks -- the SAME tensor, with any unrealizable nominal

uniform_least_squares_problem(geometry, kind_name, x0, ...)

Assemble a fully-packed uniform least-squares Problem.