In minimize.least_squares, compute values at the solution at full verbosity.

PiperOrigin-RevId: 745301888
Change-Id: Ibd8e35e405bb2cebc7ac59a6dfc77118a6e6ba9f
This commit is contained in:
Yuval Tassa
2025-04-08 14:54:51 -07:00
committed by Copybara-Service
parent 699ad13a72
commit 5031f88158
2 changed files with 19 additions and 2 deletions
+2 -2
View File
@@ -127,8 +127,8 @@ class MinimizeTest(absltest.TestCase):
output=out,
verbose=minimize.Verbosity.FULLITER,
)
self.assertIn(' < tol', out.getvalue())
grad = trace[-2].jacobian.T @ trace[-2].residual
self.assertIn('norm(gradient) < tol', out.getvalue())
grad = trace[-1].grad
# If x_i is on the boundary, gradient points out, otherwise it is 0.
for i, xi in enumerate(x):
if xi == bounds[0][i]: