fixing scg on this branch

This commit is contained in:
James Hensman 2014-01-25 16:07:41 +00:00
parent 8ea5c4279a
commit 482b9a3b68

View file

@ -154,9 +154,9 @@ def SCG(f, gradf, x, optargs=(), maxiters=500, max_f_eval=np.inf, display=True,
break
else:
# Update variables for new position
gradold = gradnew
gradnew = gradf(x, *optargs)
current_grad = np.dot(gradnew, gradnew)
gradold = gradnew
fold = fnew
# If the gradient is zero then we are done.
if current_grad <= gtol: