mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-08 11:32:39 +02:00
some work on periodics
This commit is contained in:
parent
88c080eece
commit
efd262965e
9 changed files with 308 additions and 754 deletions
|
|
@ -205,6 +205,19 @@ class ExpQuad(Stationary):
|
|||
dist = self._scaled_dist(X, X2)
|
||||
return -dist*self.K(X, X2)
|
||||
|
||||
class Cosine(Stationary):
|
||||
def __init__(self, input_dim, variance=1., lengthscale=None, ARD=False, name='Cosine'):
|
||||
super(Cosine, self).__init__(input_dim, variance, lengthscale, ARD, name)
|
||||
|
||||
def K(self, X, X2=None):
|
||||
r = self._scaled_dist(X, X2)
|
||||
return self.variance * np.cos(r)
|
||||
|
||||
def dK_dr(self, X, X2):
|
||||
r = self._scaled_dist(X, X2)
|
||||
return -self.variance * np.sin(r)
|
||||
|
||||
|
||||
class RatQuad(Stationary):
|
||||
"""
|
||||
Rational Quadratic Kernel
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue