fitbenchmarking.controllers.aoclda_controller module

Implements a controller for AMD AOCL Data Analytics NLLS solver https://github.com/amd/aocl-data-analytics

class fitbenchmarking.controllers.aoclda_controller.AOCLDAController(cost_func)

Bases: Controller

Controller for the AOCLDA NLLS fitting software.

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

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 employ 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

  • MCMC - Markov Chain Monte Carlo 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.

The algorithm_check dictionary is used to determine which minimizers to run given the algorithm_type selected in Fitting Options. For guidance on how to categorise minimizers, see the Optimization Algorithms section of the FitBenchmarking docs.

cleanup()

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

eval_r(x, r, data) int

Function to ensure correct inputs and outputs are used for the AOCLDA residual evaluation

Parameters:
  • x (numpy array) – coefficients

  • r – output, residual term Store r update in-place.

  • data – alias to self

Type:

numpy array

Type:

pointer

Returns:

evaluation flag

Return type:

int

fit()

Run problem with AOCLDA. Note: only this method is timed

hes_eval(x, r, Hr, data) int

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

Parameters:
  • x (numpy array) – coefficients

  • r (numpy array) – residuals, required by AOCLDA to be passed for hessian evaluation

  • data – alias to self

  • Hr – output, hessian 2nd order term \(\sum_{i=1}^m r_i \nabla^2 r_i\). Store Hr update in-place.

Type:

pointer

Type:

numpy array

Returns:

evaluation flag

Return type:

int

hessian_enabled_solvers = ['hybrid', 'newton', 'newton-tensor', 'hybrid_reg', 'newton_reg', 'newton-tensor_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

jac_eval(x, J, data) int

Function to ensure correct inputs and outputs are used for the AOCLDA jacobian evaluation

Parameters:
  • x (numpy array) – coefficients

  • J – output, jacobian 1nd order term Store J update in-place.

  • data – alias to self

Type:

numpy array

Type:

pointer

Returns:

evaluation flag

Return type:

int

jacobian_enabled_solvers = ['gn', 'hybrid', 'newton', 'newton-tensor', 'gn_reg', 'hybrid_reg', 'newton_reg', 'newton-tensor_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 AOCLDA

support_for_bounds = True

Used to check whether the fitting software has support for bounded problems, set as True if at least some minimizers in the fitting software have support for bounds