gradient_descent#

t3toolbox.backend.optimizers.gradient_descent(problem, x0, n_iter=100, gtol_rel=1e-08, c_armijo=0.0001, on_line_search_failure='stop', g0_reference=None, *, cone_oversampling=None, cone_oversampled_passes=None, cone_max_passes=None, cone_tol=None, cone_alternate=None, cone_seed=None)#
def gradient_descent(
        problem:  Problem,    # the fixed-rank least-squares problem
        x0:       Tangent,    # initial cores (B, G)
        n_iter:   int   = 100,
        gtol_rel: float = 1e-8,   # stop when ‖g‖ <= gtol_rel * ‖g_0‖
        c_armijo: float = 1e-4,   # Armijo sufficient-decrease constant
        on_line_search_failure: str = 'stop',  # Armijo exhausted (50 halvings): 'stop' = reject + terminate; 'accept' = take the last trial and continue
        g0_reference: typ.Optional[str] = None,  # ‖g_0‖ for the stop: None = the geometry's own ('zero' on manifolds); 'zero' | 'warm_start' | 'cone'
        *,
        cone_oversampling:        typ.Optional[int]   = None,   # None = 5    (g0_reference='cone' only, else a structural error)
        cone_oversampled_passes:  typ.Optional[int]   = None,   # None = 2
        cone_max_passes:          typ.Optional[int]   = None,   # None = 10
        cone_tol:                 typ.Optional[float] = None,   # None = 0.05
        cone_alternate:           typ.Optional[bool]  = None,   # None = True
        cone_seed:                typ.Optional[int]   = None,   # None = ZERO_FRAME_SEED
) -> typ.Tuple[Tangent, dict]:    # (x_cores, stats)

Steepest descent with a Cauchy initial step and an Armijo backtracking line search. The step length starts at the Cauchy value α = ‖g‖² / ‖𝒥g‖² (the 1D minimizer of the local GN quadratic along −g) and backtracks (α ← α/2) until f(retract(−α g)) ≤ f − c·α‖g‖² – so it descends on any geometry, including the additive corewise chart where a bare Cauchy step overshoots the high-degree objective. Exercises the whole backend-first stack (gradient / gn_quadratic / objective / retract). Eager only, deliberately – the reference implementation of the backend-first stack; use_jit lives on mc_sgd / adam / newton_cg.

on_line_search_failure: as in newton_cg() – exhausting all 50 halvings means the objective’s floor; 'stop' (default) rejects the step and terminates, 'accept' takes the last trial and keeps going (the deliberate escape mode). stats['line_search_failed'] reports whether an exhaustion occurred.

g0_reference: the reference ‖g_0‖ of the relative stop, resolved exactly as in newton_cg() – by default the gradient norm at the zero tensor of x0’s ranks on a manifold geometry, the warm-start ‖g(x0)‖ on a corewise one; 'cone' and its cone_* options as in newton_cg() (the alignment runs eagerly here).

Parameters:
  • problem (Problem)

  • x0 (Tangent)

  • n_iter (int)

  • gtol_rel (float)

  • c_armijo (float)

  • on_line_search_failure (str)

  • g0_reference (t3toolbox.backend.common.typ.Optional[str])

  • cone_oversampling (t3toolbox.backend.common.typ.Optional[int])

  • cone_oversampled_passes (t3toolbox.backend.common.typ.Optional[int])

  • cone_max_passes (t3toolbox.backend.common.typ.Optional[int])

  • cone_tol (t3toolbox.backend.common.typ.Optional[float])

  • cone_alternate (t3toolbox.backend.common.typ.Optional[bool])

  • cone_seed (t3toolbox.backend.common.typ.Optional[int])

Return type:

t3toolbox.backend.common.typ.Tuple[Tangent, dict]