mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-02 08:12:39 +02:00
just general tidying
This commit is contained in:
parent
8cad49ce13
commit
f669d0124b
2 changed files with 8 additions and 4 deletions
|
|
@ -190,7 +190,7 @@ class GPBase(Model):
|
|||
upper = m + 2*np.sqrt(v)
|
||||
Y = self.Y
|
||||
else:
|
||||
m, v, lower, upper = self.predict(Xgrid, which_parts=which_parts) #Compute the exact mean
|
||||
m, v, lower, upper = self.predict(Xgrid, which_parts=which_parts)
|
||||
Y = self.Y
|
||||
for d in which_data_ycols:
|
||||
gpplot(Xnew, m[:, d], lower[:, d], upper[:, d], axes=ax, edgecol=linecol, fillcol=fillcol)
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ class Gaussian(Likelihood):
|
|||
|
||||
def _gradients(self, partial):
|
||||
"""
|
||||
Return the derivative of the log marginal likelihood wrt self.variance,
|
||||
Return the derivative of the log marginal likelihood wrt self.variance,
|
||||
given the appropriate partial derivative
|
||||
"""
|
||||
return np.sum(partial)
|
||||
|
|
@ -82,9 +82,13 @@ class Gaussian(Likelihood):
|
|||
|
||||
def predictive_values(self, mu, var, full_cov=False):
|
||||
if full_cov:
|
||||
low, up = mu - np.diag(var)[:,None], mu + np.diag(var)[:,None]
|
||||
var += np.eye(var.shape[0])*self.variance
|
||||
d = 2*np.sqrt(np.diag(var))
|
||||
low, up = mu - d, mu + d
|
||||
else:
|
||||
low, up = mu - var, mu + var
|
||||
var += self.variance
|
||||
d = 2*np.sqrt(var)
|
||||
low, up = mu - d, mu + d
|
||||
return mu, var, low, up
|
||||
|
||||
def predictive_mean(self, mu, sigma):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue