mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-08 11:32:39 +02:00
Changed kernels in tests (lots still failing, but now mostly for good reason rather than silly naming problems)
This commit is contained in:
parent
ca40b9803a
commit
9888d768b5
7 changed files with 92 additions and 87 deletions
|
|
@ -17,7 +17,7 @@ class Kernel(Mapping):
|
|||
:type X: ndarray
|
||||
:param output_dim: dimension of output.
|
||||
:type output_dim: int
|
||||
:param kernel: a GPy kernel, defaults to GPy.kern.rbf
|
||||
:param kernel: a GPy kernel, defaults to GPy.kern.RBF
|
||||
:type kernel: GPy.kern.kern
|
||||
|
||||
"""
|
||||
|
|
@ -25,7 +25,7 @@ class Kernel(Mapping):
|
|||
def __init__(self, X, output_dim=1, kernel=None):
|
||||
Mapping.__init__(self, input_dim=X.shape[1], output_dim=output_dim)
|
||||
if kernel is None:
|
||||
kernel = GPy.kern.rbf(self.input_dim)
|
||||
kernel = GPy.kern.RBF(self.input_dim)
|
||||
self.kern = kernel
|
||||
self.X = X
|
||||
self.num_data = X.shape[0]
|
||||
|
|
@ -43,7 +43,7 @@ class Kernel(Mapping):
|
|||
def _set_params(self, x):
|
||||
self.A = x[:self.num_data * self.output_dim].reshape(self.num_data, self.output_dim).copy()
|
||||
self.bias = x[self.num_data*self.output_dim:].copy()
|
||||
|
||||
|
||||
def randomize(self):
|
||||
self.A = np.random.randn(self.num_data, self.output_dim)/np.sqrt(self.num_data+1)
|
||||
self.bias = np.random.randn(self.output_dim)/np.sqrt(self.num_data+1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue