From a39a63c7f8bff92e1d392c0049112cd78a47cf7f Mon Sep 17 00:00:00 2001 From: Max Zwiessele Date: Tue, 8 Sep 2015 15:35:08 +0100 Subject: [PATCH] [testing] --- GPy/plotting/matplot_dep/dim_reduction_plots.py | 4 ++-- GPy/testing/parameterized_tests.py | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/GPy/plotting/matplot_dep/dim_reduction_plots.py b/GPy/plotting/matplot_dep/dim_reduction_plots.py index ff0887b8..f428537d 100644 --- a/GPy/plotting/matplot_dep/dim_reduction_plots.py +++ b/GPy/plotting/matplot_dep/dim_reduction_plots.py @@ -119,7 +119,7 @@ def plot_latent(model, labels=None, which_indices=None, Xtest_full[:, [input_1, input_2]] = x _, var = model.predict(Xtest_full, **predict_kwargs) var = var[:, :1] - return 2*np.sqrt(var) + return np.log(var) #Create an IMshow controller that can re-plot the latent space shading at a good resolution if plot_limits is None: @@ -304,7 +304,7 @@ def plot_magnification(model, labels=None, which_indices=None, view = ImshowController(ax, plot_function, (xmin, ymin, xmax, ymax), resolution, aspect=aspect, interpolation='bilinear', - cmap=cm.gray) + cmap=cm.get_cmap('Greys')) # make sure labels are in order of input: ulabels = [] diff --git a/GPy/testing/parameterized_tests.py b/GPy/testing/parameterized_tests.py index 0fb129ff..3ee93f2b 100644 --- a/GPy/testing/parameterized_tests.py +++ b/GPy/testing/parameterized_tests.py @@ -248,10 +248,16 @@ class ParameterizedTest(unittest.TestCase): m.randomize() self.assertEqual(m.p1, val) + def test_checkgrad(self): + assert(self.testmodel.kern.checkgrad()) + assert(self.testmodel.kern.lengthscale.checkgrad()) + assert(self.testmodel.likelihood.lengthscale.checkgrad()) + def test_printing(self): print(self.test1) print(self.param) print(self.test1['']) + print(self.testmodel.hierarchy_name(False)) if __name__ == "__main__": #import sys;sys.argv = ['', 'Test.test_add_parameter']