From f1a08fbfdbebc8281450d2add991fbccb0d75f78 Mon Sep 17 00:00:00 2001 From: James Hensman Date: Wed, 11 Dec 2013 15:42:25 -0800 Subject: [PATCH] mostly docstring noodling --- GPy/likelihoods/bernoulli.py | 5 ++++- GPy/likelihoods/likelihood.py | 19 +++++++++++++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/GPy/likelihoods/bernoulli.py b/GPy/likelihoods/bernoulli.py index 9fe96b9a..028e23ba 100644 --- a/GPy/likelihoods/bernoulli.py +++ b/GPy/likelihoods/bernoulli.py @@ -18,6 +18,9 @@ class Bernoulli(Likelihood): .. Note:: Y is expected to take values in {-1, 1} Probit likelihood usually used + + .. See also:: + likelihood.py, for the parent class """ def __init__(self, gp_link=None, analytical_mean=False, analytical_variance=False): super(Bernoulli, self).__init__(gp_link, analytical_mean, analytical_variance) @@ -38,7 +41,7 @@ class Bernoulli(Likelihood): Y_prep[Y.flatten() == 0] = -1 return Y_prep - def _moments_match_analytical(self, data_i, tau_i, v_i): + def moments_match_ep(self, data_i, tau_i, v_i): """ Moments match of the marginal approximation in EP algorithm diff --git a/GPy/likelihoods/likelihood.py b/GPy/likelihoods/likelihood.py index 0c3bc037..c1c02f3f 100644 --- a/GPy/likelihoods/likelihood.py +++ b/GPy/likelihoods/likelihood.py @@ -15,15 +15,26 @@ from ..core.parameterized import Parameterized class Likelihood(Parameterized): """ - Likelihood base class + Likelihood base class, used to defing p(y|f). + + All instances use _inverse_ link functions, which can be swapped out. It is + expected that inherriting classes define a default inverse link function To use this class, inherrit and define missing functionality. - To enable use with EP, ... + Inherriting classes *must* implement: + pdf_link : a bound method which turns the output of the link function into the pdf + logpdf_link : the logarithm of the above - To enable use with Laplace approximation, ... + To enable use with EP, inherriting classes *must* define: + TODO: a suitable derivative function for any parameters of the class + It is also desirable to define: + moments_match_ep : a function to compute the EP moments If this isn't defined, the moments will be computed using 1D quadrature. - For exact Gaussian inference, define ... + To enable use with Laplace approximation, inherriting classes *must* define: + Some derivative functions *AS TODO* + + For exact Gaussian inference, define *JH TODO* """ def __init__(self, gp_link, name):