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
float
return_conversion_factor(stat_type)
Dummy function for returning 1.0.
source code
str
return_data_name(name)
Return a unique identifying string for the minimisation parameter.
source code
str
return_grace_string(stat_type)
Function for returning the Grace string representing the data type for axis labelling.
source code
None
return_units(stat_type)
Dummy function which returns None as the stats have no units.
source code
 
return_value(spin=None, stat_type=None, sim=None)
Function for returning the minimisation statistic corresponding to 'stat_type'.
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()
  return_data_name_doc = Desc_container("Minimisation statistic ...
  table = uf_tables.add_table(label= "table: min data type patte...
  set_doc = '\n Minimisation statistic set details\n ...
  __package__ = 'pipe_control'

Imports: search, RelaxError, Processor_box, return_spin, spin_loop, pipes, specific_analyses, Status, Uf_tables, Desc_container


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.

return_conversion_factor(stat_type)

source code 

Dummy function for returning 1.0.

Parameters:
  • stat_type (str) - The name of the statistic. This is unused!
Returns: float
A conversion factor of 1.0.

return_data_name(name)

source code 

Return a unique identifying string for the minimisation parameter.

Parameters:
  • name (str) - The minimisation parameter.
Returns: str
The unique parameter identifying string.

return_grace_string(stat_type)

source code 

Function for returning the Grace string representing the data type for axis labelling.

Parameters:
  • stat_type (str) - The name of the statistic to return the Grace string for.
Returns: str
The Grace string.

return_units(stat_type)

source code 

Dummy function which returns None as the stats have no units.

Parameters:
  • stat_type (str) - The name of the statistic. This is unused!
Returns: None
Nothing.

return_value(spin=None, stat_type=None, sim=None)

source code 

Function for returning the minimisation statistic corresponding to 'stat_type'.

Parameters:
  • spin (SpinContainer) - The spin data container if spin specific data is to be reset.
  • stat_type (str) - The name of the statistic to return the value for.
  • sim (None or int) - The index of the simulation to return the value for. If None, then the normal value is returned.

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.

Variables Details [hide private]

return_data_name_doc

Value:
Desc_container("Minimisation statistic data type string matching patte\
rns")

table

Value:
uf_tables.add_table(label= "table: min data type patterns", caption= "\
Minimisation statistic data type string matching patterns.")

set_doc

Value:
'''
        Minimisation statistic set details
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        This shouldn\'t really be executed by a user.
'''