mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-15 06:52:39 +02:00
final prior computation issues killed
This commit is contained in:
parent
345e5b3e7c
commit
a4212e1904
2 changed files with 3 additions and 2 deletions
|
|
@ -228,10 +228,9 @@ class Constrainable(Nameable, Indexable, Parameterizable):
|
|||
|
||||
def log_prior(self):
|
||||
"""evaluate the prior"""
|
||||
import numpy as np
|
||||
if self.priors.size > 0:
|
||||
x = self._get_params()
|
||||
return np.sum([p.lnpdf(x[ind]) for p, ind in self.priors.iteritems()])
|
||||
return reduce(lambda a,b: a+b, [p.lnpdf(x[ind]).sum() for p, ind in self.priors.iteritems()], 0)
|
||||
return 0.
|
||||
|
||||
def _log_prior_gradients(self):
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ class Prior(object):
|
|||
from ...plotting.matplot_dep import priors_plots
|
||||
priors_plots.univariate_plot(self)
|
||||
|
||||
def __repr__(self, *args, **kwargs):
|
||||
return self.__str__()
|
||||
|
||||
class Gaussian(Prior):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue