NewtonInfo#
- class t3toolbox.backend.optimizers.NewtonInfo#
Per-iteration diagnostics passed to a
newton_cgcallback– everything one Newton step produces, so a custom callback (or the display int3toolbox.backend.optimizer_display) can report anything without the loop anticipating it.x_cores(the point before the step) andlm(itsLocalModel– residual / sample / frame) are carried so a callback can compute per-block errors or evaluate a validation forward. The step-related fields areNoneon the final converged line (no CG / line search ran). The scalar subset (all butx_cores/lm/timing) is what lands instats['history'].Five strings (2026.3.0):
newton_cgsets the first four on every row it emits, so a history consumer can filter by them, andstop_reasonon its last row. All default toNone, so a hand-built row (a display test) needs none of them:g0_reference– which Newton-stop referenceg0normis:'zero'(the gradient norm at the zero tensor of these ranks, at the canonical zero-point frame),'warm_start'(the initial‖g‖),'cone'(the gradient norm at the zero tensor on the aligned frame), or'override'(g0norm_newtonwas given).cg_reference– the CG forcing term’s reference:'override'iffg0norm_cgwas given, else equal tog0_reference(CG inherits the Newton reference).step_control– the step-acceptance mode:'line_search'(Armijo backtracking along the retraction) or'trust_region'(one trial atα = 1, accepted on the ratioρ; Steihaug CG).hessian– the row’s model:'gauss_newton'or'exact'(the model that solved the step; on the converged row, the model built there). The run’s mode on every row, except underhessian='switch'(below).stop_reason– set on the run’s last row only (Nonebefore it):'gradient'(the relative stop fired: the converged row),'max_newton'(the iteration cap),'line_search'(Armijo exhausted underon_line_search_failure='stop'),'objective_floor'(a rejected trust-region step whose predicted change is below the objective’s floating-point resolution – the attainable accuracy is reached; not a failure) or'trust_region_floor'(rejections drove the radius below1e-12of its initial value); the same value asstats['stop_reason'].
Mode-dependent fields. A line-search row has
ls_steps/ls_failedset andtr_*None; a trust-region row hastr_radius(the radius this trial was bounded by) andtr_acceptedset,ls_steps = ls_failed = Noneandalpha = 1.0. A rejected trust-region row keepsx_cores(the next row starts from the same point, with the same local model).pKp/lift_sigma_min/lift_epsare set only on a row whosehessianis'exact'(the last two only on a geometry whose curvature data carries them, i.e. the manifold one atd > 1). The CG outcome is exactly one ofcg_converged,cg_boundary,cg_truncatedor (none of them) the iteration cap.The switch (
newton_cg(hessian='switch')). A row’shessianis'gauss_newton'in the Gauss-Newton phase and'exact'from the switch on. On a Gauss-Newton-phase rowlmis the Gauss-Newton view of the point’s exact-mode build (the model that solved the step, the same object across a rejected trial; itsgradientrecomputes the misfit transpose), sopKpand the lift diagnostics areNonethere, as on a Gauss-Newton run’s rows. Five fields,Noneoutside switch mode and history fields only in switch mode (the display prints them as a Gauss-Newton-phase row’sswsegment:format_newton_iter()):switch_e_gn– every Gauss-Newton-phase row with a step:|Δf − m_GN(s)|,m_GN(s)the row’s predicted change (α·slope + ½α²·pHp;α = 1in the trust region).switch_pKp,switch_e_n– the tracked rows (the countable ones, or every Gauss-Newton-phase step row underswitch_track='all'): the curvature term⟨p, Lᵀ K_N L p⟩of the exact build (not inpHp) and|Δf − m_N(s)|withm_N(s) = m_GN(s) + ½α²·switch_pKp.switch_count– every Gauss-Newton-phase row: the count of consecutive hits after this row (0: a reset); the converged row’s is the count carried to it.switch_fired– every switch-mode row:Trueon the row whose count reachedswitch_k, elseFalse.
timingis aNewtonTimingwithnewton_cg(timing=True), elseNone; likex_coresandlmit is not a history field (stats['timing']['rows']holds the records as dicts). The display prints it as the row’stimeline (format_newton_iter()).- iteration: int#
- objective: float#
- gnorm: float#
- g0norm: float#
- converged: bool#
- x_cores: t3toolbox.backend.common.typ.Any = None#
- lm: t3toolbox.backend.common.typ.Any = None#
- misfit: t3toolbox.backend.common.typ.Optional[float] = None#
- regularization: t3toolbox.backend.common.typ.Optional[float] = None#
- forcing_eta: t3toolbox.backend.common.typ.Optional[float] = None#
- cg_tol: t3toolbox.backend.common.typ.Optional[float] = None#
- cg_iters: t3toolbox.backend.common.typ.Optional[int] = None#
- cg_maxiter: t3toolbox.backend.common.typ.Optional[int] = None#
- cg_resid: t3toolbox.backend.common.typ.Optional[float] = None#
- cg_converged: t3toolbox.backend.common.typ.Optional[bool] = None#
- cg_truncated: t3toolbox.backend.common.typ.Optional[bool] = None#
- ls_steps: t3toolbox.backend.common.typ.Optional[int] = None#
- ls_failed: t3toolbox.backend.common.typ.Optional[bool] = None#
- alpha: t3toolbox.backend.common.typ.Optional[float] = None#
- slope: t3toolbox.backend.common.typ.Optional[float] = None#
- pHp: t3toolbox.backend.common.typ.Optional[float] = None#
- delta_f: t3toolbox.backend.common.typ.Optional[float] = None#
- rho: t3toolbox.backend.common.typ.Optional[float] = None#
- step_rel: t3toolbox.backend.common.typ.Optional[float] = None#
- wall_time: t3toolbox.backend.common.typ.Optional[float] = None#
- g0_reference: t3toolbox.backend.common.typ.Optional[str] = None#
- cg_reference: t3toolbox.backend.common.typ.Optional[str] = None#
- step_control: t3toolbox.backend.common.typ.Optional[str] = None#
- stop_reason: t3toolbox.backend.common.typ.Optional[str] = None#
- hessian: t3toolbox.backend.common.typ.Optional[str] = None#
- tr_radius: t3toolbox.backend.common.typ.Optional[float] = None#
- tr_accepted: t3toolbox.backend.common.typ.Optional[bool] = None#
- cg_boundary: t3toolbox.backend.common.typ.Optional[bool] = None#
- pKp: t3toolbox.backend.common.typ.Optional[float] = None#
- lift_sigma_min: t3toolbox.backend.common.typ.Optional[float] = None#
- lift_eps: t3toolbox.backend.common.typ.Optional[float] = None#
- timing: t3toolbox.backend.common.typ.Optional[NewtonTiming] = None#
- switch_pKp: t3toolbox.backend.common.typ.Optional[float] = None#
- switch_e_gn: t3toolbox.backend.common.typ.Optional[float] = None#
- switch_e_n: t3toolbox.backend.common.typ.Optional[float] = None#
- switch_count: t3toolbox.backend.common.typ.Optional[int] = None#
- switch_fired: t3toolbox.backend.common.typ.Optional[bool] = None#