Fix description of exponentiated quadratic covariance function and add kernels. (#872)

* Fix description of ExpQuad covariance.

* Add sinc kernel.

* Add ExpQuadCosine covariance
This commit is contained in:
Neil Lawrence 2021-05-13 18:50:32 +01:00 committed by GitHub
parent e272c666c1
commit 46ce7c1680
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 86 additions and 7 deletions

View file

@ -426,6 +426,22 @@ class KernelGradientTestsContinuous(unittest.TestCase):
k.randomize()
self.assertTrue(check_kernel_gradient_functions(k, X=self.X, X2=self.X2, verbose=verbose))
def test_Cosine(self):
# Don't test Cosine directly as it fails positive definite test.
k = GPy.kern.RBF(self.D-1, ARD=False)*GPy.kern.Cosine(self.D-1, ARD=True)
k.randomize()
self.assertTrue(check_kernel_gradient_functions(k, X=self.X, X2=self.X2, verbose=verbose))
def test_ExpQuadCosine(self):
k = GPy.kern.ExpQuadCosine(self.D-1, ARD=True)
k.randomize()
self.assertTrue(check_kernel_gradient_functions(k, X=self.X, X2=self.X2, verbose=verbose))
def test_Sinc(self):
k = GPy.kern.Sinc(self.D-1, ARD=True)
k.randomize()
self.assertTrue(check_kernel_gradient_functions(k, X=self.X, X2=self.X2, verbose=verbose))
def test_RatQuad(self):
k = GPy.kern.RatQuad(self.D-1, ARD=True)
k.randomize()

View file

@ -722,9 +722,9 @@ class StateSpaceKernelsTests(np.testing.TestCase):
# plotting <-
# 2D measurement, 3 ts_no <-
def test_continuos_ss(self,plot=False):
def test_continuous_ss(self,plot=False):
"""
This function tests the continuos state-space model.
This function tests the continuous state-space model.
"""
# 1D measurements, 1 ts_no ->
@ -974,4 +974,4 @@ if __name__ == '__main__':
#res = tt.test_discrete_ss_2D(plot=False)
#res = tt.test_continuos_ss(plot=True)