mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-08 03:22:38 +02:00
Fixed gplvm unittest which was sampling an output matrix of size input_dim (and corresponding error in bcgplvm unittest which was based on it).
This commit is contained in:
parent
128ebbabc5
commit
bdc8ee45a7
4 changed files with 13 additions and 13 deletions
|
|
@ -1,7 +1,7 @@
|
|||
# Copyright (c) 2013, GPy authors (see AUTHORS.txt).
|
||||
# Licensed under the BSD 3-clause license (see LICENSE.txt)
|
||||
|
||||
#from kernel import Kernel
|
||||
from kernel import Kernel
|
||||
from linear import Linear
|
||||
from mlp import MLP
|
||||
#from rbf import RBF
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
import numpy as np
|
||||
from ..core.mapping import Mapping
|
||||
from ..kern.kern import kern
|
||||
import GPy
|
||||
|
||||
class Kernel(Mapping):
|
||||
"""
|
||||
|
|
@ -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 = kern.rbf(self.input_dim)
|
||||
kernel = GPy.kern.rbf(self.input_dim)
|
||||
self.kern = kernel
|
||||
self.X = X
|
||||
self.num_data = X.shape[0]
|
||||
|
|
|
|||
|
|
@ -89,6 +89,7 @@ class MLP(Mapping):
|
|||
|
||||
def df_dtheta(self, dL_df, X):
|
||||
self._df_computations(dL_df, X)
|
||||
g = np.array([])
|
||||
for gW, gbias in zip(self._dL_dW, self._dL_dbias):
|
||||
g = np.hstack((g, gW.flatten(), gbias))
|
||||
return g
|
||||
|
|
@ -117,7 +118,6 @@ class MLP(Mapping):
|
|||
self._dL_dW[0] = (dL_da[:, :, None]*X[:, None, :]).sum(0).T
|
||||
self._dL_dbias[0] = (dL_da.sum(0))
|
||||
self._dL_dX = (dL_da[:, None, :]*W[None, :, :]).sum(2)
|
||||
g = np.array([])
|
||||
|
||||
|
||||
def df_dX(self, dL_df, X):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue