mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-04-29 06:46:22 +02:00
Cache some values
This commit is contained in:
parent
7f6c9ed216
commit
d3b53eabda
1 changed files with 5 additions and 4 deletions
|
|
@ -139,10 +139,6 @@ class Laplace(LatentFunctionInference):
|
|||
|
||||
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_inv, dL_dK, dL_dthetaL = self.mode_computations(f_hat, Ki_fhat, K, Y, likelihood, kern, Y_metadata)
|
||||
|
||||
|
|
@ -298,6 +294,11 @@ class Laplace(LatentFunctionInference):
|
|||
else:
|
||||
dL_dthetaL = np.zeros(likelihood.size)
|
||||
|
||||
#Cache some things for speedy LOO
|
||||
self.Ki_W_i = Ki_W_i
|
||||
self.K = K
|
||||
self.W = W
|
||||
self.f_hat = f_hat
|
||||
return log_marginal, K_Wi_i, dL_dK, dL_dthetaL
|
||||
|
||||
def _compute_B_statistics(self, K, W, log_concave, *args, **kwargs):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue