def test_adams_gradient(self): f, y0, t_points, sol = construct_problem(TEST_DEVICE) tuple_f = lambda t, y: (f(t, y[0]), f(t, y[1])) for i in range(2): func = lambda y0, t_points: tfdiffeq.odeint(tuple_f, (y0, y0), t_points, method='adams')[i] self.assertTrue(gradcheck(func, (y0, t_points)))
def test_adams(self): f, y0, t_points, _ = problems.construct_problem(TEST_DEVICE) func = lambda y0, t_points: tfdiffeq.odeint(f, y0, t_points, method='adams') self.assertTrue(gradcheck(func, (y0, t_points)))