From 0070a73004a5458b8b616aaedf283db85d06e0c6 Mon Sep 17 00:00:00 2001 From: James Hensman Date: Thu, 12 Sep 2013 10:20:28 +0100 Subject: [PATCH] Fixed Alans checkgrad bug --- GPy/core/model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GPy/core/model.py b/GPy/core/model.py index c31ea209..2e70e7c2 100644 --- a/GPy/core/model.py +++ b/GPy/core/model.py @@ -458,7 +458,7 @@ class Model(Parameterized): numerical_gradient = (f1 - f2) / (2 * dx) global_ratio = (f1 - f2) / (2 * np.dot(dx, gradient)) - return (np.abs(1. - global_ratio) < tolerance) or (np.abs(gradient - numerical_gradient).mean() - 1) < tolerance + return (np.abs(1. - global_ratio) < tolerance) or (np.abs(gradient - numerical_gradient).mean() < tolerance) else: # check the gradient of each parameter individually, and do some pretty printing try: