From 2e90dd41e7816905097383cd7997eafcef5215e7 Mon Sep 17 00:00:00 2001 From: Jan Caron <j.caron@fz-juelich.de> Date: Fri, 10 Jun 2016 20:39:40 +0200 Subject: [PATCH] Fixed an error in the test for hess_diag in FirstOrderRegularisator. --- pyramid/tests/test_regularisator.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pyramid/tests/test_regularisator.py b/pyramid/tests/test_regularisator.py index 814dd76..7ffaf55 100644 --- a/pyramid/tests/test_regularisator.py +++ b/pyramid/tests/test_regularisator.py @@ -124,10 +124,8 @@ class TestCaseFirstOrderRegularisator(unittest.TestCase): err_msg='Unexpected behaviour in hess_dot()!') def test_hess_diag(self): - hess_diag = self.reg.hess_diag(np.ones(3 * self.n)) # derivatives in all directions! - hess_diag_ref = np.zeros(3 * self.n) # derivatives in all directions! - first_order_jac_ref = np.load(os.path.join(self.path, 'first_order_jac_ref.npy')) - hess_diag_ref[0:self.n] = np.diag(first_order_jac_ref) + hess_diag = self.reg.hess_diag(np.ones(self.n)) + hess_diag_ref = np.diag(np.load(os.path.join(self.path, 'first_order_jac_ref.npy'))) assert_allclose(hess_diag, hess_diag_ref, atol=1E-7, err_msg='Unexpected behaviour in hess_diag()!') -- GitLab