Skip to content
Snippets Groups Projects
Commit 2e90dd41 authored by Jan Caron's avatar Jan Caron
Browse files

Fixed an error in the test for hess_diag in FirstOrderRegularisator.

parent 78b98984
No related branches found
No related tags found
No related merge requests found
......@@ -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()!')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment