added jitter to fitc

This commit is contained in:
James Hensman 2014-03-14 14:28:34 +00:00
parent f88b4c92e8
commit a12bdafad7

View file

@ -3,6 +3,7 @@
from posterior import Posterior from posterior import Posterior
from ...util.linalg import jitchol, tdot, dtrtrs, dpotri, pdinv from ...util.linalg import jitchol, tdot, dtrtrs, dpotri, pdinv
from ...util import diag
import numpy as np import numpy as np
log_2_pi = np.log(2*np.pi) log_2_pi = np.log(2*np.pi)
@ -14,8 +15,7 @@ class FITC(object):
the posterior. the posterior.
""" """
def __init__(self): const_jitter = 1e-6
self.const_jitter = 1e-6
def inference(self, kern, X, Z, likelihood, Y): def inference(self, kern, X, Z, likelihood, Y):
@ -33,6 +33,7 @@ class FITC(object):
U = Knm U = Knm
#factor Kmm #factor Kmm
diag.add(Kmm, self.const_jitter)
Kmmi, L, Li, _ = pdinv(Kmm) Kmmi, L, Li, _ = pdinv(Kmm)
#compute beta_star, the effective noise precision #compute beta_star, the effective noise precision