fitbenchmarking.controllers.bumps_controller module
Implements a controller for the Bumps fitting software.
- class fitbenchmarking.controllers.bumps_controller.BumpsController(cost_func)
Bases:
ControllerController for the Bumps fitting software.
Sasview requires a model to fit. Setup creates a model with the correct function.
- algorithm_check = {'MCMC': ['dream'], 'all': ['amoeba', 'lm-bumps', 'newton', 'de', 'scipy-leastsq', 'dream'], 'bfgs': ['newton'], 'conjugate_gradient': [], 'deriv_free': ['amoeba', 'de'], 'gauss_newton': [], 'general': ['amoeba', 'newton', 'de'], 'global_optimization': ['de'], 'levenberg-marquardt': ['lm-bumps', 'scipy-leastsq'], 'ls': ['lm-bumps', 'scipy-leastsq'], 'simplex': ['amoeba'], 'steepest_descent': [], 'trust_region': ['lm-bumps', 'scipy-leastsq']}
Within the controller class, you must initialize a dictionary,
algorithm_check, such that the keys are given by:all- all minimizersls- least-squares fitting algorithmsderiv_free- derivative free algorithms (these are algorithms that cannot use information about derivatives – e.g., theSimplexmethod inMantid)general- minimizers which solve a generic min f(x)simplex- derivative free simplex based algorithms e.g. Nelder-Meadtrust_region- algorithms which employ a trust region approachlevenberg-marquardt- minimizers that use the Levenberg-Marquardt algorithmgauss_newton- minimizers that use the Gauss Newton algorithmbfgs- minimizers that use the BFGS algorithmconjugate_gradient- Conjugate Gradient algorithmssteepest_descent- Steepest Descent algorithmsglobal_optimization- Global Optimization algorithmsMCMC- 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
GSLcontroller.The
algorithm_checkdictionary is used to determine which minimizers to run given thealgorithm_typeselected 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.
- fit()
Run problem with Bumps.
- setup()
Setup problem ready to run with Bumps.
Creates a FitProblem for calling in the fit() function of Bumps
- 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