optimizers#
Frontend adapter for the geometry-agnostic optimizers.
A thin wrapper over t3toolbox.backend.optimizers (where the algorithms live – check-free, so a
raw-.data user can call them directly). This layer (1) maps the frontend geometry singletons and the
sampling-kind name to the backend GeometryOps / SamplingKind, (2) calls the backend optimizer on the
raw cores, and (3) re-wraps the result. Design: dev/archive/optimizers_plan.md.
Two representations, inferred from x0 (the library-wide ragged/uniform dispatch; _setup):
a ragged
TuckerTensorTrainx0 with a ragged geometry (manifold.MANIFOLD/COREWISE) – the optimizer runs on the raw cores; the frame is re-orthogonalized internally each step.a uniform
UniformTuckerTensorTrainx0 with a uniform geometry (uniform_manifold.UNIFORM_MANIFOLD/UNIFORM_COREWISE) – the optimizer runs on the packed supercore pair (lax.scanover the mode axis; the speed path). The uniform path requires a minimal-rank frame; it callsuniform_minimal()transparently so a frontend user never meets that requirement.
The geometry must match x0’s representation (a uniform x0 with a ragged geometry, or vice versa, is a
structural error). The result is returned in the same representation as x0.
``use_jit=True`` (an explicit kwarg on mc_sgd / adam / newton_cg) opts into jax: the
optimizer auto-converts x0 / sample / data onto jax and jit-compiles, so the result comes
back jax-backed in jax’s default float32 (enable jax x64 for float64); it raises if jax is not
installed rather than silently running eager. See t3toolbox.backend.optimizers.newton_cg().
>>> # x_opt, stats = optimizers.gradient_descent(MANIFOLD, 'probe', ww, data, x0) # ragged
>>> # x_opt, stats = optimizers.newton_cg(UNIFORM_MANIFOLD, 'probe', ww, data, ux0) # uniform
Functions#
|
Fit |
|
Manifold Cauchy SGD -- minibatched, tuning-free Cauchy step. Ragged or uniform |
|
Adam over the cores -- the dependency-free first-order method for the corewise geometry. Ragged or |
|
Inexact Riemannian Newton-CG with an Armijo line search -- the manifold workhorse. Ragged or uniform |