fitbenchmarking.controllers.ralfit_controller module

Implements a controller for RALFit https://github.com/ralna/RALFit

class fitbenchmarking.controllers.ralfit_controller.RALFitController(cost_func)

Bases: fitbenchmarking.controllers.base_controller.Controller

Controller for the RALFit fitting software.

algorithm_check = {'all': ['gn', 'hybrid', 'gn_reg', 'hybrid_reg'], 'bfgs': [], 'conjugate_gradient': [], 'deriv_free': [], 'gauss_newton': ['gn', 'gn_reg'], 'general': [], 'global_optimization': [], 'levenberg-marquardt': ['gn', 'gn_reg'], 'ls': ['gn', 'hybrid', 'gn_reg', 'hybrid_reg'], 'simplex': [], 'steepest_descent': [], 'trust_region': ['gn', 'hybrid']}

Within the controller class, you must initialize a dictionary, algorithm_check, such that the keys are given by:

  • all - all minimizers

  • ls - least-squares fitting algorithms

  • deriv_free - derivative free algorithms (these are algorithms that cannot use information about derivatives – e.g., the Simplex method in Mantid)

  • general - minimizers which solve a generic min f(x)

  • simplex - derivative free simplex based algorithms e.g. Nelder-Mead

  • trust_region - algorithms which emply a trust region approach

  • levenberg-marquardt - minimizers that use the Levenberg-Marquardt algorithm

  • gauss_newton - minimizers that use the Gauss Newton algorithm

  • bfgs - minimizers that use the BFGS algorithm

  • conjugate_gradient - Conjugate Gradient algorithms

  • steepest_descent - Steepest Descent algorithms

  • global_optimization - Global Optimization algorithms

The values of the dictionary are given as a list of minimizers for that specific controller that fit into each of the above categories. See for example the GSL controller.

cleanup()

Convert the result to a numpy array and populate the variables results will be read from.

fit()

Run problem with RALFit.

hes_eval(params, r)

Function to ensure correct inputs and outputs are used for the RALFit hessian evaluation

param params

parameters

type params

numpy array

param r

residuals, required by RALFit to be passed for hessian evaluation

type r

numpy array

return

hessian 2nd order term: sum_{i=1}^m r_i

abla^2 r_i
rtype

numpy array

hessian_enabled_solvers = ['hybrid', 'hybrid_reg']

Within the controller class, you must define the list hessian_enabled_solvers if any of the minimizers for the specific software are able to use hessian information.

  • hessian_enabled_solvers: a list of minimizers in a specific

software that allow Hessian information to be passed into the fitting algorithm

jacobian_enabled_solvers = ['gn', 'hybrid', 'gn_reg', 'hybrid_reg']

Within the controller class, you must define the list jacobian_enabled_solvers if any of the minimizers for the specific software are able to use jacobian information.

  • jacobian_enabled_solvers: a list of minimizers in a specific

software that allow Jacobian information to be passed into the fitting algorithm

setup()

Setup for RALFit