mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-30 14:35:15 +02:00
Priors added
This commit is contained in:
parent
922e72af94
commit
b1c98c2c3d
8 changed files with 206 additions and 356 deletions
|
|
@ -9,15 +9,16 @@ from domains import _REAL, _POSITIVE
|
|||
import warnings
|
||||
import weakref
|
||||
|
||||
class Prior:
|
||||
class Prior(object):
|
||||
domain = None
|
||||
|
||||
def pdf(self, x):
|
||||
return np.exp(self.lnpdf(x))
|
||||
|
||||
def plot(self):
|
||||
import sys
|
||||
assert "matplotlib" in sys.modules, "matplotlib package has not been imported."
|
||||
from ..plotting.matplot_dep import priors_plots
|
||||
from ...plotting.matplot_dep import priors_plots
|
||||
priors_plots.univariate_plot(self)
|
||||
|
||||
|
||||
|
|
@ -150,6 +151,7 @@ class MultivariateGaussian:
|
|||
return np.random.multivariate_normal(self.mu, self.var, n)
|
||||
|
||||
def plot(self):
|
||||
import sys
|
||||
assert "matplotlib" in sys.modules, "matplotlib package has not been imported."
|
||||
from ..plotting.matplot_dep import priors_plots
|
||||
priors_plots.multivariate_plot(self)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue