diff --git a/GPy/inference/latent_function_inference/__init__.py b/GPy/inference/latent_function_inference/__init__.py new file mode 100644 index 00000000..b843e7ef --- /dev/null +++ b/GPy/inference/latent_function_inference/__init__.py @@ -0,0 +1,24 @@ +__doc__ = """ +Inference over Gaussian process latent functions + +In all our GP models, the consistency propery means that we have a Gaussian +prior over a finite set of points f. This prior is + + math:: N(f | 0, K) + +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). + +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). + +The inference methods return a "Posterior" instance, which is a simple +structure which contains a summary of the posterior. The model classes can then +use this posterior object for making predictions, optimizing hyper-parameters, +etc. + +""" diff --git a/GPy/inference/latent_function_inference/posterior.py b/GPy/inference/latent_function_inference/posterior.py new file mode 100644 index 00000000..ecaa3f2e --- /dev/null +++ b/GPy/inference/latent_function_inference/posterior.py @@ -0,0 +1,34 @@ +import numpy as np + +class Posterior(object): + """ + An object to represent a Gaussian posterior over latent function values. + """ + def __init__(self, log_marginal, dL_dmean=None, cov=None, prec=None): + self._log_marginal = log_marginal + + #TODO: accept the init arguments, make sure we've got enough information to compute everything. + + @property + def mean(self): + if self._mean is None: + self._mean = ?? + return self._mean + + @property + def covariance(self): + if self._covariance is None: + self._covariance = ?? + return self._covariance + + @property + def precision(self): + if self._precision is None: + self._precision = ?? + return self._precision + + @prop + + + +