mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-15 06:52:39 +02:00
made initial lengthscale!=1 to ensure we're properly testing gradients
This commit is contained in:
parent
97f5ca6b84
commit
ad2779bdf3
1 changed files with 1 additions and 0 deletions
|
|
@ -421,6 +421,7 @@ class MiscTests(unittest.TestCase):
|
||||||
Y = np.vstack([Y,Y])
|
Y = np.vstack([Y,Y])
|
||||||
|
|
||||||
m = GPy.models.GPOffsetRegression(X,Y)
|
m = GPy.models.GPOffsetRegression(X,Y)
|
||||||
|
m.rbf.lengthscale=5.0 #make it something other than one to check our gradients properly!
|
||||||
assert m.checkgrad(), "Gradients of offset parameters don't match numerical approximations."
|
assert m.checkgrad(), "Gradients of offset parameters don't match numerical approximations."
|
||||||
m.optimize()
|
m.optimize()
|
||||||
assert np.abs(m.offset[0]-offset)<0.1, ("GPOffsetRegression model failing to estimate correct offset (value estimated = %0.2f instead of %0.2f)" % (m.offset[0], offset))
|
assert np.abs(m.offset[0]-offset)<0.1, ("GPOffsetRegression model failing to estimate correct offset (value estimated = %0.2f instead of %0.2f)" % (m.offset[0], offset))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue