From f0d97f5b8404023e67ae06510dde5c31db4bb86b Mon Sep 17 00:00:00 2001 From: James Hensman Date: Thu, 13 Mar 2014 16:03:19 +0000 Subject: [PATCH] fixed the posterior prediction for laplace The mis-match between the woodbury vector and KIf is still a bit of a mystery --- GPy/inference/latent_function_inference/laplace.py | 4 +++- GPy/likelihoods/student_t.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/GPy/inference/latent_function_inference/laplace.py b/GPy/inference/latent_function_inference/laplace.py index e6ca720a..4f529d5e 100644 --- a/GPy/inference/latent_function_inference/laplace.py +++ b/GPy/inference/latent_function_inference/laplace.py @@ -53,11 +53,13 @@ class Laplace(object): f_hat, Ki_fhat = self.rasm_mode(K, Y, likelihood, Ki_f_init, Y_metadata=Y_metadata) self.f_hat = f_hat + self.Ki_fhat = Ki_fhat + self.K = K.copy() #Compute hessian and other variables at mode log_marginal, woodbury_vector, woodbury_inv, dL_dK, dL_dthetaL = self.mode_computations(f_hat, Ki_fhat, K, Y, likelihood, kern, Y_metadata) self._previous_Ki_fhat = Ki_fhat.copy() - return Posterior(woodbury_vector=woodbury_vector, woodbury_inv=woodbury_inv, K=K), log_marginal, {'dL_dK':dL_dK, 'dL_dthetaL':dL_dthetaL} + return Posterior(woodbury_vector=Ki_fhat, woodbury_inv=woodbury_inv, K=K), log_marginal, {'dL_dK':dL_dK, 'dL_dthetaL':dL_dthetaL} def rasm_mode(self, K, Y, likelihood, Ki_f_init, Y_metadata=None): """ diff --git a/GPy/likelihoods/student_t.py b/GPy/likelihoods/student_t.py index 12e0ae85..ce86d9d6 100644 --- a/GPy/likelihoods/student_t.py +++ b/GPy/likelihoods/student_t.py @@ -27,9 +27,9 @@ class StudentT(Likelihood): super(StudentT, self).__init__(gp_link, name='Student_T') - self.sigma2 = Param('t_noise', float(sigma2)) + self.sigma2 = Param('t_noise', float(sigma2), Logexp()) self.v = Param('deg_free', float(deg_free)) - self.add_parameter(self.sigma2, Logexp()) + self.add_parameter(self.sigma2) self.add_parameter(self.v) self.v.constrain_fixed()