diff --git a/GPy/examples/laplace_approximations.py b/GPy/examples/laplace_approximations.py index 02b38a79..8be08a8f 100644 --- a/GPy/examples/laplace_approximations.py +++ b/GPy/examples/laplace_approximations.py @@ -632,7 +632,7 @@ def gaussian_f_check(): plt.subplot(212) m.optimize() m.plot() - print "final optimised student t" + print "final optimised gaussian" print m print "real GP" print mgp diff --git a/GPy/likelihoods/Laplace.py b/GPy/likelihoods/Laplace.py index aeda17da..58304c23 100644 --- a/GPy/likelihoods/Laplace.py +++ b/GPy/likelihoods/Laplace.py @@ -105,8 +105,15 @@ class Laplace(likelihood): dL_dthetaL = np.zeros(num_params) # make space for one derivative for each likelihood parameter for thetaL_i in range(num_params): #Explicit + #dL_dthetaL_exp = np.sum(dlik_dthetaL[thetaL_i]) - 0.5*np.dot(np.diag(self.Ki_W_i), dlik_hess_dthetaL[thetaL_i]) + #a = 0.5*np.dot(np.diag(self.Ki_W_i), dlik_hess_dthetaL[thetaL_i]) + #d = dlik_hess_dthetaL[thetaL_i] + #e = pdinv(pdinv(self.K)[0] + np.diagflat(self.W))[0] + #b = 0.5*np.dot(np.diag(e).T, d) + #g = 0.5*(np.diag(self.K) - np.sum(cho_solve((self.B_chol, True), np.dot(np.diagflat(self.W_12),self.K))**2, 1)) + #dL_dthetaL_exp = np.sum(dlik_dthetaL[thetaL_i]) - np.dot(g.T, dlik_hess_dthetaL[thetaL_i]) dL_dthetaL_exp = np.sum(dlik_dthetaL[thetaL_i]) - 0.5*np.dot(np.diag(self.Ki_W_i), dlik_hess_dthetaL[thetaL_i]) - #dL_dthetaL_exp = np.sum(dlik_dthetaL[thetaL_i]) - 0.5*np.trace(mdot(self.Bi, self.K, dlik_hess_dthetaL[thetaL_i])) + #Implicit df_hat_dthetaL = mdot(I_KW_i, self.K, dlik_grad_dthetaL[thetaL_i]) dL_dthetaL_imp = np.dot(dL_dfhat, df_hat_dthetaL)