Skip to content

API – jacobian_evaluator

HOMER.jacobian_evaluator.jacobian(cost_function=None, init_estimate=None, sparsity=None, further_args=None, sparse=True, return_sparsity=False)

Given a jax compatible callable, returns both a compiled jax function, but also the autodifferentiated jacobian of the function.

:param cost_function: the callable cost function. :param init_estimate: x0, the first estimate of the minimum of the cost function.

:param sparsity: A pre known sparsity structure of the jacobian. :param further_args: Additional arguments to the cost function that are not compiled. :param sparse: Some jacobians may be dense, so will not benefit from sparse jac acceleration, and it can be skipped.

:returns cost_function: The compiled cost function :returns jac_function: The jac function defining the derivative of outputs with respect to parameters of the cost function.