mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-24 14:15:14 +02:00
gradients
This commit is contained in:
parent
3b82bc8f28
commit
f6228abd4c
2 changed files with 3 additions and 3 deletions
|
|
@ -70,7 +70,7 @@ class GP(Model):
|
|||
|
||||
def parameters_changed(self):
|
||||
self.posterior, self._log_marginal_likelihood, grad_dict = self.inference_method.inference(self.kern, self.X, self.likelihood, self.Y, Y_metadata=self.Y_metadata)
|
||||
self.kern.update_gradients_full(grad_dict['dL_dK'])
|
||||
self.kern.update_gradients_full(grad_dict['dL_dK'], self.X)
|
||||
|
||||
def log_likelihood(self):
|
||||
return self._log_marginal_likelihood
|
||||
|
|
|
|||
|
|
@ -61,8 +61,8 @@ class RBF(Stationary):
|
|||
|
||||
#from psi2
|
||||
S = variational_posterior.variance
|
||||
denom, Zdist, Zdist_sq, mudist, mudist_sq, psi2 = self._psi2computations(Z, variational_posterior)
|
||||
d_length = 2.*psi2[:, :, :, None] * (Zdist_sq[None, :,:,:] * denom + mudist_sq + S[:, None, None, :] / l2) / (self.lengthscale * denom)
|
||||
denom, _, Zdist_sq, _, mudist_sq, psi2 = self._psi2computations(Z, variational_posterior)
|
||||
d_length = 2.*psi2[:, :, :, None] * (Zdist_sq * denom + mudist_sq + S[:, None, None, :] / l2) / (self.lengthscale * denom)
|
||||
#TODO: combine denom and l2 as denom_l2??
|
||||
#TODO: tidy the above!
|
||||
#TODO: tensordot below?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue