8000 A safety measure for the projected Newton step: · PythonOptimizers/NLP.py@17da30c · GitHub
[go: up one dir, main page]

Skip to content

Commit 17da30c

Browse files
Andrew Lambedpo
authored andcommitted
A safety measure for the projected Newton step:
- if the trust region solver made no progress, (because it thinks the problem is already solved,) exit immediately
1 parent dbc5c4d commit 17da30c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

nlp/optimize/tron.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,10 @@ def projected_newton_step(self, x, g, H, delta, l, u, s, cgtol, itermax):
217217
further progress: ‖pₖ‖ = Δ.
218218
219219
info = 3 Failure to converge within itermax iterations.
220+
221+
info = 4 The trust region solver could make no further progress
222+
on the problem, i.e. the computed step is zero.
223+
Return with the current point.
220224
"""
221225
self.log.debug("entering projected_newton_step")
222226
exitOptimal = False
@@ -264,6 +268,11 @@ def projected_newton_step(self, x, g, H, delta, l, u, s, cgtol, itermax):
264268
step = self.solver.step
265269
iters += self.solver.niter
266270

271+
# Exit if the solver took no additional steps
272+
if self.solver.niter == 0:
273+
exitOptimal = True
274+
info = 4
275+
267276
# Use a projected search to obtain the next iterate
268277
(xfree, proj_step) = self.projected_linesearch(x[free_vars],
269278
l[free_vars],

0 commit comments

Comments
 (0)
0