uniform_fitting#

Uniform-layer fitting seams: the GeometryOps factories (and, later, the SamplingKind builders) that let the geometry-generic optimizers (t3toolbox.backend.optimizers) run on uniform supercores. The uniform twin of t3toolbox.backend.fitting – optimizers-on-uniform slice U2.

The optimizers are written against three pluggable seams (GeometryOps, SamplingKind, corewise) and never mention a layer; supplying uniform implementations of the seams runs the SAME algorithm bodies on uniform data. This module supplies the geometry half.

The mask-holding recipe (docs/uniform_backend_jit_recipe.md). A uniform .data tuple carries host- numpy masks that cannot be jit-traced. So – unlike the stateless ragged MANIFOLD / COREWISE singletons – the uniform geometry is a factory that captures the loop-invariant masks (fixed at fixed rank) and closes over them; the optimizer traces only the supercores. The convention throughout:

  • the optimizer’s point x is a bare supercore pair (tucker_sc, tt_sc) (masks closed over);

  • a tangent is a bare variation supercore pair (tucker_var_sc, tt_var_sc);

  • a frame is the full frame .data (frame returns it, project / retract consume it).

Each closure re-attaches the held shape + masks at the boundary (building the full .data tuples the utv_operations primitives expect) and strips them back to a bare pair on output, so corewise.* and GeometryOps.inner see only supercores. Under jit the re-derived frame masks constant-fold to device constants (the “1 compile” behaviour of the recipe).

Functions#

uniform_manifold_ops(x0_data)

The uniform manifold GeometryOps at x0's fixed rank -- the raw-supercore twin of

uniform_corewise_ops(x0_data)

The uniform corewise GeometryOps at x0's fixed rank -- the raw-supercore twin of

uniform_geometry_ops(kind, x0_data)

Dispatch to uniform_manifold_ops() / uniform_corewise_ops() by name.

uniform_apply_kind(x0_data)

The uniform apply SamplingKind -- the twin of t3toolbox.backend.fitting.APPLY.

uniform_entries_kind(x0_data)

The uniform entries SamplingKind -- the twin of t3toolbox.backend.fitting.ENTRIES.

uniform_probe_kind(x0_data[, weight])

The uniform probe SamplingKind -- the twin of t3toolbox.backend.fitting.probe_kind().

uniform_sampling_kind(name, x0_data[, weight])

Dispatch to the uniform uniform_apply_kind() / entries / probe by name. Only the

uniform_apply_derivatives_kind(x0_data, order[, weight])

The uniform apply-derivatives SamplingKind -- the twin of

uniform_entries_derivatives_kind(x0_data, order[, weight])

The uniform entries-derivatives SamplingKind -- the twin of

uniform_probe_derivatives_kind(x0_data, order[, ...])

The uniform probe-derivatives SamplingKind -- the twin of

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

Dispatch to the uniform derivative sampling kind by name.

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)

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.