mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-06-05 14:55:15 +02:00
SCG: printing corrected, dont return before end of method
This commit is contained in:
parent
df1e765507
commit
43c2f8af87
1 changed files with 4 additions and 2 deletions
|
|
@ -105,7 +105,8 @@ def SCG(f, gradf, x, optargs=(), maxiters=500, max_f_eval=500, display=True, xto
|
||||||
|
|
||||||
if function_eval >= max_f_eval:
|
if function_eval >= max_f_eval:
|
||||||
status = "Maximum number of function evaluations exceeded"
|
status = "Maximum number of function evaluations exceeded"
|
||||||
return x, flog, function_eval, status
|
break
|
||||||
|
# return x, flog, function_eval, status
|
||||||
|
|
||||||
Delta = 2.*(fnew - fold) / (alpha * mu)
|
Delta = 2.*(fnew - fold) / (alpha * mu)
|
||||||
if Delta >= 0.:
|
if Delta >= 0.:
|
||||||
|
|
@ -127,7 +128,8 @@ def SCG(f, gradf, x, optargs=(), maxiters=500, max_f_eval=500, display=True, xto
|
||||||
# Test for termination
|
# Test for termination
|
||||||
if (np.max(np.abs(alpha * d)) < xtol) or (np.abs(fnew - fold) < ftol):
|
if (np.max(np.abs(alpha * d)) < xtol) or (np.abs(fnew - fold) < ftol):
|
||||||
status = 'converged'
|
status = 'converged'
|
||||||
return x, flog, function_eval, status
|
break
|
||||||
|
# return x, flog, function_eval, status
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# Update variables for new position
|
# Update variables for new position
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue