mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-18 13:55:14 +02:00
Assorted work on combining the EP and sparse methods
This commit is contained in:
parent
64280d7eb6
commit
5447d6fbfc
7 changed files with 95 additions and 44 deletions
|
|
@ -19,6 +19,7 @@ class EP(likelihood):
|
|||
self.data = data
|
||||
self.N = self.data.size
|
||||
self.is_heteroscedastic = True
|
||||
self.Nparams = 0
|
||||
|
||||
#Initial values - Likelihood approximation parameters:
|
||||
#p(y|f) = t(f|tau_tilde,v_tilde)
|
||||
|
|
@ -28,6 +29,7 @@ class EP(likelihood):
|
|||
#initial values for the GP variables
|
||||
self.Y = np.zeros((self.N,1))
|
||||
self.covariance_matrix = np.eye(self.N)
|
||||
self.precision = np.ones(self.N)
|
||||
self.Z = 0
|
||||
self.YYT = None
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ from likelihood import likelihood
|
|||
class Gaussian(likelihood):
|
||||
def __init__(self,data,variance=1.,normalize=False):
|
||||
self.is_heteroscedastic = False
|
||||
self.Nparams = 1
|
||||
self.data = data
|
||||
self.N,D = data.shape
|
||||
self.Z = 0. # a correction factor which accounts for the approximation made
|
||||
|
|
@ -18,7 +19,9 @@ class Gaussian(likelihood):
|
|||
self._std = np.ones((1,D))
|
||||
self.Y = self.data
|
||||
|
||||
#TODO: make this work efficiently (only compute YYT if D>>N)
|
||||
self.YYT = np.dot(self.Y,self.Y.T)
|
||||
self.trYYT = np.trace(self.YYT)
|
||||
self._set_params(np.asarray(variance))
|
||||
|
||||
|
||||
|
|
@ -50,4 +53,4 @@ class Gaussian(likelihood):
|
|||
pass
|
||||
|
||||
def _gradients(self,partial):
|
||||
return np.sum(np.diag(partial))
|
||||
return np.sum(partial)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue