def test_q_theta(self, pdoc_object): parameters = np.array([2.]) q = pdoc_object.objective_object.q jac = jac_jax_reshaped(q, (1, 1)) jac_val = jac(parameters, 2.) assert jac_val == np.array([[2 * parameters[0]]])
def test_int_theta(self, pdoc_object): parameters = np.array(2.) intw = pdoc_object.objective_object.integral_weights jac = jac_jax_reshaped(intw, (2, 2)) jac_val = jac(parameters, 2.) assert jac_val is not None
def test_compute_theta_f(self, f_lin_param_dae): jac = jac_jax_reshaped(f_lin_param_dae, (3, )) np.testing.assert_equal(jac(3., 3.), np.zeros((3, 1)))
def test_compute_theta_a(self, a_lin_param_dae): jac = jac_jax_reshaped(a_lin_param_dae, (3, 3)) np.testing.assert_equal(jac(3., 3.)[..., 0], np.diag((0, -1., 0)))