mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-02 16:22:39 +02:00
a cleaner test
This commit is contained in:
parent
d6a56a6f0b
commit
fc8705104b
2 changed files with 3 additions and 6 deletions
|
|
@ -408,11 +408,9 @@ class KernelTestsProductWithZeroValues(unittest.TestCase):
|
|||
lin = GPy.kern.Linear(2)
|
||||
bias = GPy.kern.Bias(2)
|
||||
k = lin * bias
|
||||
m = GPy.models.GPRegression(X, Y, kernel=k)
|
||||
try:
|
||||
m.optimize()
|
||||
except np.linalg.LinAlgError:
|
||||
self.fail("Zero-valued kernel raised exception!")
|
||||
k.update_gradients_full(1, X)
|
||||
self.assertFalse(np.isnan(k['linear.variances'].gradient),
|
||||
"Gradient resulted in NaN")
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue