geometry#
Backend geometries on raw data – the where you optimize axis of a fit.
A geometry bundles the chart-level choices an optimizer needs and nothing else: the linearization
frame, the gauge projection project (Pi), the retract, the coordinate inner, and the
optional per-frame precompute companion. The frontend twins are
t3toolbox.manifold.ManifoldGeometry / CorewiseGeometry and their uniform counterparts;
these are the check-free versions a raw-.data user calls directly.
Parameters are fields, not closures. Each geometry is a frozen dataclass whose fields are its
defining data – the mode shape, the rank masks it is fixed at, and the sharing groups. This
matters for more than tidiness: a geometry rides as jax aux_data, so its __hash__/__eq__ are
part of the jit compilation cache key. With the parameters sealed in closure cells (the previous
GeometryOps record-of-lambdas) a rebuilt-but-identical geometry was always a new key, so every
rank-continuation level and every rebuilt model recompiled. Value-based hash/eq over the fields
(ValueHashedFields) makes the cache key reflect the geometry’s
actual identity. Mathematically it is also the more faithful encoding: a uniform manifold at a given
rank is a different manifold from one at another rank, so the rank belongs in the object’s data.
The math stays reachable. Per the backend rule, a method here only binds parameters and names a
role – every line of actual math is also a standalone function, either in the operation modules
(tv_operations, utv_operations,
sharing) or named in this module
(fv_base_point_tangent(), ufv_base_point_tangent(),
t3_left_orthogonal_norm_sq(), t3_alias_tied_tucker_factors()).
Sharing is a field, not a wrapper. groups=() is the ordinary geometry; a non-empty partition
restricts every projection to the TIED tangent subspace and keeps the retraction on the shared set
(SF-T3; docs/sharing.md). One class, one code path. Build the canonical partition with
validate_sharing(), or use the from_point /
with_sharing constructors here.
The exact Hessian’s members (hessian='exact' only; a Gauss-Newton fit never calls them).
curvature_precompute builds the per-frame curvature data once per local model – on the manifold the
lift factors, grad f as a doubled-rank T3 and its inner-product sweep
(ManifoldCurvatureData); lift / lift_transpose map coordinates to raw core variations
and back (tv_corewise_lift()); tangential_curvature is the
K_{grad f} term (t3_inner_product_corewise_hessian_from_sweep()).
The corewise geometries need neither a lift nor a tangential term. The lift’s damping is a solver option
(curvature_damping), not a geometry field: None resolves to DEFAULT_CURVATURE_DAMPING
here, and a value on a corewise geometry (which has no lift to damp) raises; on the manifold at d = 1 the
curvature data is None (the curvature term is exactly zero there), so a value is validated (>= 0) but
unused. The uniform geometries carry the same members on supercores
(ufv_lift_factors(),
utv_corewise_lift(),
ut3_inner_product_corewise_hessian_from_sweep()), masking with the frame’s
own masks – shared (groups) included, through the uniform tied lift
(ufv_tied_lift_factors()).
Attributes#
Classes#
The per-frame data of the exact Riemannian Hessian's curvature term on the manifold geometry, built |
|
The fixed-rank T3 manifold geometry on raw |
|
The core-parameter Euclidean geometry on raw |
|
The uniform manifold geometry at a fixed rank -- the raw-supercore twin of |
|
The uniform corewise geometry at a fixed rank -- the raw-supercore twin of |
Functions#
|
|
|
The attachment point |
|
The uniform twin of |
|
Collapse each sharing group's Tucker factors to a single array object. |
Module Contents#
- canonical_groups#
- DEFAULT_CURVATURE_DAMPING = 1e-06#