Add the Newton decrement as a termination criterion of the Newton solver.

After an accepted line-search step, the solver has already rebuilt the gradient
and Hessian and solved for the next search direction, so the Newton decrement
0.5*g'*H^-1*g -- the quadratic model's predicted cost improvement of the next
iteration -- costs one dot product. Terminating when it falls below tolerance
avoids running one more iteration only to observe a correspondingly small
actual improvement.

This is a C port of Alain's proposal in MJWarp:
https://github.com/google-deepmind/mujoco_warp/pull/1520

PiperOrigin-RevId: 947768034
Change-Id: I94e5c71a4e2b4a7775611edd1dad254bba2633b4
This commit is contained in:
Yuval Tassa
2026-07-14 10:29:30 -07:00
committed by Copybara-Service
parent 2444defc63
commit 1e66efd114
6 changed files with 115 additions and 3 deletions
+2 -1
View File
@@ -427,7 +427,8 @@ adjust it properly through the XML.
:at:`tolerance`: :at-val:`real, "1e-8"`
Tolerance threshold used for early termination of the iterative solver. For PGS, the threshold is applied to the cost
improvement between two iterations. For CG and Newton, it is applied to the smaller of the cost improvement and the
gradient norm. Set the tolerance to 0 to disable early termination.
gradient norm. For Newton, it is additionally applied to the Newton decrement :math:`\tfrac{1}{2} g^T H^{-1} g`, the
predicted cost improvement of the next iteration. Set the tolerance to 0 to disable early termination.
.. _option-ls_iterations: