mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-30 14:35:15 +02:00
Alans change to checkgrad
This commit is contained in:
parent
433b213165
commit
f50b121d4d
1 changed files with 5 additions and 6 deletions
|
|
@ -301,9 +301,8 @@ class Model(Parameterized):
|
||||||
|
|
||||||
denominator = (2 * np.dot(dx, gradient))
|
denominator = (2 * np.dot(dx, gradient))
|
||||||
global_ratio = (f1 - f2) / np.where(denominator==0., 1e-32, denominator)
|
global_ratio = (f1 - f2) / np.where(denominator==0., 1e-32, denominator)
|
||||||
gloabl_diff = (f1 - f2) - denominator
|
|
||||||
|
|
||||||
return (np.abs(1. - global_ratio) < tolerance) or (np.abs(gloabl_diff) == 0)
|
return np.abs(1. - global_ratio) < tolerance)
|
||||||
else:
|
else:
|
||||||
# check the gradient of each parameter individually, and do some pretty printing
|
# check the gradient of each parameter individually, and do some pretty printing
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue