mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-08 03:22:38 +02:00
Working with OU kernel
This commit is contained in:
parent
c8da9602ec
commit
0c2bae53f7
2 changed files with 22 additions and 1 deletions
|
|
@ -192,6 +192,27 @@ class Exponential(Stationary):
|
|||
def dK_dr(self, r):
|
||||
return -0.5*self.K_of_r(r)
|
||||
|
||||
|
||||
class OU(Stationary):
|
||||
"""
|
||||
OU kernel:
|
||||
|
||||
.. math::
|
||||
|
||||
k(r) = \\sigma^2 \exp(- r) \\ \\ \\ \\ \\text{ where } r = \sqrt{\sum_{i=1}^input_dim \\frac{(x_i-y_i)^2}{\ell_i^2} }
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, input_dim, variance=1., lengthscale=None, ARD=False, active_dims=None, name='OU'):
|
||||
super(OU, self).__init__(input_dim, variance, lengthscale, ARD, active_dims, name)
|
||||
|
||||
def K_of_r(self, r):
|
||||
return self.variance * np.exp(-r)
|
||||
|
||||
def dK_dr(self,r):
|
||||
return -1.*self.variance*np.exp(-r)
|
||||
|
||||
|
||||
class Matern32(Stationary):
|
||||
"""
|
||||
Matern 3/2 kernel:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue