diff --git a/GPy/core/parameterization/parameter_core.py b/GPy/core/parameterization/parameter_core.py index 9cedc46d..e5652d66 100644 --- a/GPy/core/parameterization/parameter_core.py +++ b/GPy/core/parameterization/parameter_core.py @@ -17,7 +17,7 @@ from transformations import Logexp, NegativeLogexp, Logistic, __fixed__, FIXED, import numpy as np import re -__updated__ = '2014-05-20' +__updated__ = '2014-05-21' class HierarchyError(Exception): """ @@ -389,7 +389,7 @@ class Indexable(Nameable, Observable): self[:] = value index = self._raveled_index() - # reconstrained = self.unconstrain() + reconstrained = self.unconstrain() index = self._add_to_index_operations(self.constraints, index, __fixed__, warning) self._highest_parent_._set_fixed(self, index) self.notify_observers(self, None if trigger_parent else -np.inf) diff --git a/GPy/testing/model_tests.py b/GPy/testing/model_tests.py index 7279ef31..75c0dadc 100644 --- a/GPy/testing/model_tests.py +++ b/GPy/testing/model_tests.py @@ -94,22 +94,18 @@ class MiscTests(unittest.TestCase): np.testing.assert_equal(m.log_likelihood(), m2.log_likelihood()) m.kern.lengthscale.randomize() - m.update_model() m2.kern.lengthscale = m.kern.lengthscale np.testing.assert_equal(m.log_likelihood(), m2.log_likelihood()) m.kern.lengthscale.randomize() - m.update_model() m2['.*lengthscale'] = m.kern.lengthscale np.testing.assert_equal(m.log_likelihood(), m2.log_likelihood()) m.kern.lengthscale.randomize() - m.update_model() m2['.*lengthscale'] = m.kern['.*lengthscale'] np.testing.assert_equal(m.log_likelihood(), m2.log_likelihood()) m.kern.lengthscale.randomize() - m.update_model() m2.kern.lengthscale = m.kern['.*lengthscale'] np.testing.assert_equal(m.log_likelihood(), m2.log_likelihood()) diff --git a/GPy/testing/observable_tests.py b/GPy/testing/observable_tests.py index c5022832..05794dc3 100644 --- a/GPy/testing/observable_tests.py +++ b/GPy/testing/observable_tests.py @@ -94,12 +94,12 @@ class Test(unittest.TestCase): def test_set_params(self): self.assertEqual(self.par.params_changed_count, 0, 'no params changed yet') self.par.param_array[:] = 1 - self.par.update_model() + self.par._trigger_params_changed() self.assertEqual(self.par.params_changed_count, 1, 'now params changed') self.assertEqual(self.parent.parent_changed_count, self.par.params_changed_count) self.par.param_array[:] = 2 - self.par.update_model() + self.par._trigger_params_changed() self.assertEqual(self.par.params_changed_count, 2, 'now params changed') self.assertEqual(self.parent.parent_changed_count, self.par.params_changed_count) diff --git a/GPy/testing/pickle_tests.py b/GPy/testing/pickle_tests.py index 13a67744..a98cb7f6 100644 --- a/GPy/testing/pickle_tests.py +++ b/GPy/testing/pickle_tests.py @@ -126,8 +126,8 @@ class Test(ListDictTestCase): def test_modelrecreation(self): par = toy_rbf_1d_50(optimize=0, plot=0) pcopy = GPRegression(par.X.copy(), par.Y.copy(), kernel=par.kern.copy()) - self.assertListEqual(par.param_array.tolist(), pcopy.param_array.tolist()) - self.assertListEqual(par.gradient_full.tolist(), pcopy.gradient_full.tolist()) + np.testing.assert_allclose(par.param_array, pcopy.param_array) + np.testing.assert_allclose(par.gradient_full, pcopy.gradient_full) self.assertSequenceEqual(str(par), str(pcopy)) self.assertIsNot(par.param_array, pcopy.param_array) self.assertIsNot(par.gradient_full, pcopy.gradient_full) @@ -140,7 +140,7 @@ class Test(ListDictTestCase): par.pickle(f) f.seek(0) pcopy = pickle.load(f) - self.assertListEqual(par.param_array.tolist(), pcopy.param_array.tolist()) + np.testing.assert_allclose(par.param_array, pcopy.param_array) np.testing.assert_allclose(par.gradient_full, pcopy.gradient_full) self.assertSequenceEqual(str(par), str(pcopy)) self.assert_(pcopy.checkgrad())