From 60e5034256019ec0d7fb0c593c9a3da953a35895 Mon Sep 17 00:00:00 2001 From: msbauer Date: Thu, 12 Oct 2017 13:15:09 +0200 Subject: [PATCH] Fix random seed for reproducible results in tests --- GPy/testing/mapping_tests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/GPy/testing/mapping_tests.py b/GPy/testing/mapping_tests.py index 23013f92..d07561ab 100644 --- a/GPy/testing/mapping_tests.py +++ b/GPy/testing/mapping_tests.py @@ -45,9 +45,10 @@ class MappingTests(unittest.TestCase): self.assertTrue(MappingGradChecker(mapping, X).checkgrad()) def test_mlpextmapping(self): + np.random.seed(42) + X = np.random.randn(100,3) for activation in ['tanh', 'relu', 'sigmoid']: mapping = GPy.mappings.MLPext(input_dim=3, hidden_dims=[5,5], output_dim=2, activation=activation) - X = np.random.randn(100,3) self.assertTrue(MappingGradChecker(mapping, X).checkgrad()) def test_addmapping(self):