[minor] minor changes

This commit is contained in:
mzwiessele 2014-08-05 08:27:40 -07:00
parent ece85f02fe
commit 93b92111f8
3 changed files with 4 additions and 30 deletions

View file

@ -349,7 +349,7 @@ class Model(Parameterized):
numerical_gradient = (f1 - f2) / (2 * step)
if np.all(gradient[xind] == 0): ratio = (f1 - f2) == gradient[xind]
else: ratio = (f1 - f2) / (2 * step * gradient[xind])
difference = np.abs((f1 - f2) / 2 / step - gradient[xind])
difference = np.abs(numerical_gradient - gradient[xind])
if (np.abs(1. - ratio) < tolerance) or np.abs(difference) < tolerance:
formatted_name = "\033[92m {0} \033[0m".format(names[nind])