Fixed bernoulli likelihood divide by 0 and log of 0

This commit is contained in:
Alan Saul 2014-02-12 16:48:57 +00:00
parent c788c463d8
commit 46ce76dee8
5 changed files with 33 additions and 20 deletions

View file

@ -9,12 +9,12 @@ prior over a finite set of points f. This prior is
where K is the kernel matrix.
We also have a likelihood (see GPy.likelihoods) which defines how the data are
related to the latent function: p(y | f). If the likelihood is also a Gaussian,
the inference over f is tractable (see exact_gaussian_inference.py).
related to the latent function: p(y | f). If the likelihood is also a Gaussian,
the inference over f is tractable (see exact_gaussian_inference.py).
If the likelihood object is something other than Gaussian, then exact inference
is not tractable. We then resort to a Laplace approximation (laplace.py) or
expectation propagation (ep.py).
expectation propagation (ep.py).
The inference methods return a "Posterior" instance, which is a simple
structure which contains a summary of the posterior. The model classes can then
@ -24,7 +24,7 @@ etc.
"""
from exact_gaussian_inference import ExactGaussianInference
from laplace import LaplaceInference
from laplace import Laplace
expectation_propagation = 'foo' # TODO
from dtc import DTC
from fitc import FITC

View file

@ -17,7 +17,7 @@ from posterior import Posterior
import warnings
from scipy import optimize
class LaplaceInference(object):
class Laplace(object):
def __init__(self):
"""
@ -52,6 +52,7 @@ class LaplaceInference(object):
f_hat, Ki_fhat = self.rasm_mode(K, Y, likelihood, Ki_f_init, Y_metadata=Y_metadata)
self.f_hat = f_hat
#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)