From 6d64559f1f020570bfd01b2a15daa4b7fad127af Mon Sep 17 00:00:00 2001 From: James Hensman Date: Tue, 4 Jun 2013 17:38:05 +0100 Subject: [PATCH] re-merged. only RA's errors (probit?) remain --- GPy/core/model.py | 4 ++-- GPy/testing/prior_tests.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/GPy/core/model.py b/GPy/core/model.py index da06dee8..3a1d08e9 100644 --- a/GPy/core/model.py +++ b/GPy/core/model.py @@ -20,7 +20,7 @@ from GPy.core.domains import POSITIVE, REAL class model(parameterised): def __init__(self): parameterised.__init__(self) - self.priors = [None for i in range(self._get_params().size)] + self.priors = None self.optimization_runs = [] self.sampling_runs = [] self.preferred_optimizer = 'tnc' @@ -55,7 +55,7 @@ class model(parameterised): if self.priors is None: self.priors = [None for i in range(self._get_params().size)] - which = self.grep_param_names(which) + which = self.grep_param_names(regexp) # check tied situation tie_partial_matches = [tie for tie in self.tied_indices if (not set(tie).isdisjoint(set(which))) & (not set(tie) == set(which))] diff --git a/GPy/testing/prior_tests.py b/GPy/testing/prior_tests.py index b3e3a440..d3269560 100644 --- a/GPy/testing/prior_tests.py +++ b/GPy/testing/prior_tests.py @@ -15,12 +15,12 @@ class PriorTests(unittest.TestCase): X, y = X[:, None], y[:, None] m = GPy.models.GP_regression(X, y) m.ensure_default_constraints() - lognormal = GPy.priors.log_Gaussian(1, 2) + lognormal = GPy.priors.LogGaussian(1, 2) m.set_prior('rbf', lognormal) m.randomize() self.assertTrue(m.checkgrad()) - def test_gamma(self): + def test_Gamma(self): xmin, xmax = 1, 2.5*np.pi b, C, SNR = 1, 0, 0.1 X = np.linspace(xmin, xmax, 500) @@ -29,8 +29,8 @@ class PriorTests(unittest.TestCase): X, y = X[:, None], y[:, None] m = GPy.models.GP_regression(X, y) m.ensure_default_constraints() - gamma = GPy.priors.gamma(1, 1) - m.set_prior('rbf', gamma) + Gamma = GPy.priors.Gamma(1, 1) + m.set_prior('rbf', Gamma) m.randomize() self.assertTrue(m.checkgrad())