diff --git a/GPy/inference/SCG.py b/GPy/inference/SCG.py index 4224cb3c..c38ef01b 100644 --- a/GPy/inference/SCG.py +++ b/GPy/inference/SCG.py @@ -130,7 +130,8 @@ def SCG(f, gradf, x, optargs=(), maxiters=500, max_f_eval=500, display=True, xto # If the gradient is zero then we are done. if current_grad <= gtol: status = 'converged' - return x, flog, function_eval, status + break + # return x, flog, function_eval, status # Adjust beta according to comparison ratio. if Delta < 0.25: @@ -147,9 +148,10 @@ def SCG(f, gradf, x, optargs=(), maxiters=500, max_f_eval=500, display=True, xto elif success: gamma = np.dot(gradold - gradnew, gradnew) / (mu) d = gamma * d - gradnew + else: + # If we get here, then we haven't terminated in the given number of + # iterations. + status = "maxiter exceeded" - # If we get here, then we haven't terminated in the given number of - # iterations. - status = "maxiter exceeded" - + print "" return x, flog, function_eval, status