mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-04-28 14:26:23 +02:00
efficient handling of Y and YYT
This commit is contained in:
parent
cc158d64a9
commit
eddb677446
2 changed files with 9 additions and 6 deletions
|
|
@ -19,12 +19,12 @@ class Gaussian(likelihood):
|
|||
self._std = np.ones((1,D))
|
||||
self.Y = self.data
|
||||
|
||||
# if self.D > self.N:
|
||||
self.YYT = np.dot(self.Y,self.Y.T)
|
||||
self.trYYT = np.trace(self.YYT)
|
||||
# else:
|
||||
# self.YYT = None
|
||||
# self.trYYT = None
|
||||
if D > self.N:
|
||||
self.YYT = np.dot(self.Y,self.Y.T)
|
||||
self.trYYT = np.trace(self.YYT)
|
||||
else:
|
||||
self.YYT = None
|
||||
self.trYYT = None
|
||||
|
||||
self._set_params(np.asarray(variance))
|
||||
|
||||
|
|
|
|||
|
|
@ -49,6 +49,9 @@ class sparse_GP(GP):
|
|||
self.has_uncertain_inputs=True
|
||||
self.X_uncertainty = X_uncertainty
|
||||
|
||||
if not self.likelihood.is_heteroscedastic:
|
||||
self.likelihood.trYYT = np.trace(np.dot(self.likelihood.Y, self.likelihood.Y.T)) # TODO: something more elegant here?
|
||||
|
||||
GP.__init__(self, X, likelihood, kernel=kernel, normalize_X=normalize_X, Xslices=Xslices)
|
||||
|
||||
#normalise X uncertainty also
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue