diff --git a/python/paddle/incubate/optimizer/functional/bfgs.py b/python/paddle/incubate/optimizer/functional/bfgs.py index a62f70cccf38e3efd73d8d0479e35872a4344b36..52e1d6be790501c3207b3603ecff13a6a5ff0f28 100644 --- a/python/paddle/incubate/optimizer/functional/bfgs.py +++ b/python/paddle/incubate/optimizer/functional/bfgs.py @@ -141,6 +141,7 @@ def minimize_bfgs( f=objective_func, xk=xk, pk=pk, + max_iters=max_line_search_iters, initial_step_length=initial_step_length, dtype=dtype, ) diff --git a/python/paddle/incubate/optimizer/functional/lbfgs.py b/python/paddle/incubate/optimizer/functional/lbfgs.py index e3620c4ffc0ed5191acfeda6c1d949b1bb6d52af..fe27d123efee952c12098ea4b8cc07a1e5500067 100644 --- a/python/paddle/incubate/optimizer/functional/lbfgs.py +++ b/python/paddle/incubate/optimizer/functional/lbfgs.py @@ -212,6 +212,7 @@ def minimize_lbfgs( f=objective_func, xk=xk, pk=pk, + max_iters=max_line_search_iters, initial_step_length=initial_step_length, dtype=dtype, ) diff --git a/python/paddle/incubate/optimizer/functional/line_search.py b/python/paddle/incubate/optimizer/functional/line_search.py index aa40afc7010d2887c1fee249d35b37a4152360ca..9fb30855ff988fd4ffe5b0c9b3214df2ad3ab176 100644 --- a/python/paddle/incubate/optimizer/functional/line_search.py +++ b/python/paddle/incubate/optimizer/functional/line_search.py @@ -314,7 +314,7 @@ def strong_wolfe( paddle.assign(ls_func_calls + j, ls_func_calls) pred1 = ~done & ( - (phi_2 > phi_0 + c1 * a2 * derphi_0) | ((phi_2 >= phi_0) & (i > 1)) + (phi_2 > phi_0 + c1 * a2 * derphi_0) | ((phi_2 >= phi_1) & (i > 1)) ) paddle.assign(done | pred1, done) paddle.static.nn.cond(pred1, true_fn1, None)