mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-10 20:42:39 +02:00
mostly docstring noodling
This commit is contained in:
parent
9011d8fe2f
commit
f1a08fbfdb
2 changed files with 19 additions and 5 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue