Package pipe_control :: Module minimise
[hide private]
[frames] | no frames]

Module minimise

source code

Module for model minimisation/optimisation.

Functions [hide private]
 
calc(verbosity=1)
Function for calculating the function value.
source code
 
grid_search(lower=None, upper=None, inc=None, constraints=True, verbosity=1)
The grid search function.
source code
 
minimise(min_algor=None, line_search=None, hessian_mod=None, hessian_type=None, func_tol=None, grad_tol=None, max_iter=None, constraints=True, scaling=True, verbosity=1, sim_index=None)
Minimisation function.
source code
 
reset_min_stats(data_pipe=None, spin=None)
Function for resetting the minimisation statistics.
source code
 
set(val=None, error=None, param=None, scaling=None, spin_id=None)
Set global or spin specific minimisation parameters.
source code
Variables [hide private]
  status = Status()
  uf_tables = Uf_tables()
  __package__ = 'pipe_control'

Imports: Processor_box, return_spin, spin_loop, pipes, return_api, Status, Uf_tables


Function Details [hide private]

calc(verbosity=1)

source code 

Function for calculating the function value.

Parameters:
  • verbosity (int) - The amount of information to print. The higher the value, the greater the verbosity.

grid_search(lower=None, upper=None, inc=None, constraints=True, verbosity=1)

source code 

The grid search function.

Parameters:
  • lower (array of numbers) - The lower bounds of the grid search which must be equal to the number of parameters in the model.
  • upper (array of numbers) - The upper bounds of the grid search which must be equal to the number of parameters in the model.
  • inc (array of int) - The increments for each dimension of the space for the grid search. The number of elements in the array must equal to the number of parameters in the model.
  • constraints (bool) - If True, constraints are applied during the grid search (elinating parts of the grid). If False, no constraints are used.
  • verbosity (int) - The amount of information to print. The higher the value, the greater the verbosity.

minimise(min_algor=None, line_search=None, hessian_mod=None, hessian_type=None, func_tol=None, grad_tol=None, max_iter=None, constraints=True, scaling=True, verbosity=1, sim_index=None)

source code 

Minimisation function.

Parameters:
  • min_algor (str) - The minimisation algorithm to use.
  • line_search (str or None) - The line search algorithm which will only be used in combination with the line search and conjugate gradient methods. This will default to the More and Thuente line search.
  • hessian_mod (str or None) - The Hessian modification. This will only be used in the algorithms which use the Hessian, and defaults to Gill, Murray, and Wright modified Cholesky algorithm.
  • hessian_type (str or None) - The Hessian type. This will only be used in a few trust region algorithms, and defaults to BFGS.
  • func_tol (None or float) - The function tolerance which, when reached, terminates optimisation. Setting this to None turns of the check.
  • grad_tol (None or float) - The gradient tolerance which, when reached, terminates optimisation. Setting this to None turns of the check.
  • max_iter (int) - The maximum number of iterations for the algorithm.
  • constraints (bool) - If True, constraints are used during optimisation.
  • scaling (bool) - If True, diagonal scaling is enabled during optimisation to allow the problem to be better conditioned.
  • verbosity (int) - The amount of information to print. The higher the value, the greater the verbosity.
  • sim_index (None or int) - The index of the simulation to optimise. This should be None if normal optimisation is desired.

reset_min_stats(data_pipe=None, spin=None)

source code 

Function for resetting the minimisation statistics.

Parameters:
  • data_pipe (str) - The name of the data pipe to reset the minimisation statisics of. This defaults to the current data pipe.
  • spin (SpinContainer) - The spin data container if spin specific data is to be reset.

set(val=None, error=None, param=None, scaling=None, spin_id=None)

source code 

Set global or spin specific minimisation parameters.

Parameters:
  • val (number) - The parameter values.
  • param (str) - The parameter names.
  • scaling (float) - Unused.
  • spin_id (str) - The spin identification string.