This section describes how to add further methods to approximate the Hessian within FitBenchmarking
In order to add a new Hessian evaluation method, <hes_method>
, you will need to:
Create
fitbenchmarking/hessian/<hes_method>_hessian.py
, which contains a new subclass of~fitbenchmarking.hessian.base_hessian.hessian
. Then implement the method:fitbenchmarking.hessian.base_hessian.Hessian.eval()
The method is set sequentially within
~fitbenchmarking.core.fitting_benchmarking.loop_over_hessians()
by using themethod
attribute of the class.- Enable the new method as an option in
fitting_option
, following the instructions inoptions_extend
. Specifically:- Amend the
VALID_FITTING
dictionary so that the element associated with thehes_method
key contains the new<hes_method>
.
- Amend the
- Document the available Hessians by:
- adding to the list of available
method
options underhes_method
infitting_option
.- updating any example files in the
examples
directory
- Create tests for the Hessian evaluation in
fitbenchmarking/hessian/tests/test_hessians.py
.
The ~fitbenchmarking.parsing.fitting_problem.FittingProblem
and ~fitbenchmarking.jacobian.base_jacobian.Jacobian
When adding new Hessian, you will find it helpful to make use of the following members of the ~fitbenchmarking.parsing.fitting_problem.FittingProblem
and subclasses of ~fitbenchmarking.jacobian.base_jacobian.Jacobian
:
fitbenchmarking.parsing.fitting_problem
fitbenchmarking.parsing.fitting_problem.FittingProblem
fitbenchmarking.jacobian.base_jacobian
fitbenchmarking.jacobian.base_jacobian.Jacobian