mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-04-28 22:36:24 +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._std = np.ones((1,D))
|
||||||
self.Y = self.data
|
self.Y = self.data
|
||||||
|
|
||||||
# if self.D > self.N:
|
if D > self.N:
|
||||||
self.YYT = np.dot(self.Y,self.Y.T)
|
self.YYT = np.dot(self.Y,self.Y.T)
|
||||||
self.trYYT = np.trace(self.YYT)
|
self.trYYT = np.trace(self.YYT)
|
||||||
# else:
|
else:
|
||||||
# self.YYT = None
|
self.YYT = None
|
||||||
# self.trYYT = None
|
self.trYYT = None
|
||||||
|
|
||||||
self._set_params(np.asarray(variance))
|
self._set_params(np.asarray(variance))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,9 @@ class sparse_GP(GP):
|
||||||
self.has_uncertain_inputs=True
|
self.has_uncertain_inputs=True
|
||||||
self.X_uncertainty = X_uncertainty
|
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)
|
GP.__init__(self, X, likelihood, kernel=kernel, normalize_X=normalize_X, Xslices=Xslices)
|
||||||
|
|
||||||
#normalise X uncertainty also
|
#normalise X uncertainty also
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue