Package specific_analyses :: Package model_free :: Module optimisation
[hide private]
[frames] | no frames]

Module optimisation

source code

The model-free analysis optimisation functions.

Classes [hide private]
  MF_memo
The model-free memo class.
  MF_minimise_command
Command class for standard model-free minimisation.
  MF_grid_command
Command class for the model-free grid search.
  MF_result_command
Class for processing the model-free results.
Functions [hide private]
 
disassemble_result(param_vector=None, func=None, iter=None, fc=None, gc=None, hc=None, warning=None, spin=None, sim_index=None, model_type=None, scaling=None, scaling_matrix=None)
Disassemble the optimisation results.
source code
 
grid_search_config(num_params, spin=None, spin_id=None, lower=None, upper=None, inc=None, scaling_matrix=None, verbosity=1)
Configure the grid search.
source code
 
grid_search_diff_bounds(lower, upper)
Set up the default grid search bounds the diffusion tensor.
source code
 
grid_search_spin_bounds(spin, lower, upper)
Set up the default grid search bounds for a single spin.
source code
tuple
minimise_data_setup(data_store, min_algor, num_data_sets, min_options, spin=None, sim_index=None)
Set up all the data required for minimisation.
source code
tuple
relax_data_opt_structs(spin, sim_index=None)
Package the relaxation data into the data structures used for optimisation.
source code
 
reset_min_stats()
Reset all the minimisation statistics.
source code
 
spin_print(spin_id, verbosity)
Print out some header text for the spin.
source code
Variables [hide private]
  __package__ = 'specific_analyses.model_free'

Imports: pi, generic_minimise, grid, grid_point_array, array, dot, float64, match, lib, RelaxError, RelaxInfError, RelaxMultiVectorError, RelaxNaNError, isNaN, isInf, test_grid_ops, return_gyromagnetic_ratio, Memo, Result_command, Slave_command, pipes, return_interatom_list, return_spin, return_spin_from_index, spin_loop, determine_model_type, assemble_param_vector, disassemble_param_vector, Mf


Function Details [hide private]

disassemble_result(param_vector=None, func=None, iter=None, fc=None, gc=None, hc=None, warning=None, spin=None, sim_index=None, model_type=None, scaling=None, scaling_matrix=None)

source code 

Disassemble the optimisation results.

Parameters:
  • param_vector (numpy array) - The model-free parameter vector.
  • func (float) - The optimised chi-squared value.
  • iter (int) - The number of optimisation steps required to find the minimum.
  • fc (int) - The function count.
  • gc (int) - The gradient count.
  • hc (int) - The Hessian count.
  • warning (str or None) - Any optimisation warnings.
  • spin (SpinContainer instance or None) - The spin container.
  • sim_index (int or None) - The Monte Carlo simulation index.
  • model_type (str) - The model-free model type, one of 'mf', 'local_tm', 'diff', or 'all'.
  • scaling (bool) - If True, diagonal scaling is enabled during optimisation to allow the problem to be better conditioned.
  • scaling_matrix (numpy diagonal matrix) - The diagonal, square scaling matrix.

grid_search_config(num_params, spin=None, spin_id=None, lower=None, upper=None, inc=None, scaling_matrix=None, verbosity=1)

source code 

Configure the grid search.

Parameters:
  • num_params (int) - The number of parameters in the model.
  • spin (SpinContainer instance) - The spin data container.
  • spin_id (str) - The spin identification string.
  • 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.
  • scaling_matrix (numpy diagonal matrix) - The diagonal, square scaling matrix.
  • verbosity (int) - A flag specifying the amount of information to print. The higher the value, the greater the verbosity.

grid_search_diff_bounds(lower, upper)

source code 

Set up the default grid search bounds the diffusion tensor.

This method appends the default bounds to the lower and upper lists.

Parameters:
  • lower (list) - The lower bound list to append to.
  • upper (list) - The upper bound list to append to.

grid_search_spin_bounds(spin, lower, upper)

source code 

Set up the default grid search bounds for a single spin.

This method appends the default bounds to the lower and upper lists. The ordering of the lists in min_options matches that of the params list in the spin container.

Parameters:
  • spin (class instance) - A SpinContainer object.
  • lower (list) - The lower bound list to append to.
  • upper (list) - The upper bound list to append to.

minimise_data_setup(data_store, min_algor, num_data_sets, min_options, spin=None, sim_index=None)

source code 

Set up all the data required for minimisation.

Parameters:
  • data_store (class instance) - A data storage container.
  • min_algor (str) - The minimisation algorithm to use.
  • num_data_sets (int) - The number of data sets.
  • min_options (list) - The minimisation options array.
  • spin (SpinContainer instance) - The spin data container.
  • sim_index (int) - The optional MC simulation index.
Returns: tuple
An insane tuple. The full tuple is (ri_data, ri_data_err, equations, param_types, param_values, r, csa, num_frq, frq, num_ri, remap_table, noe_r1_table, ri_types, num_params, xh_unit_vectors, diff_type, diff_params)

relax_data_opt_structs(spin, sim_index=None)

source code 

Package the relaxation data into the data structures used for optimisation.

Parameters:
  • spin (SpinContainer instance) - The spin container to extract the data from.
  • sim_index (int) - The optional MC simulation index.
Returns: tuple
The structures ri_data, ri_data_err, num_frq, num_ri, ri_ids, frq, remap_table, noe_r1_table.

reset_min_stats()

source code 

Reset all the minimisation statistics.

All global and spin specific values will be set to None.

spin_print(spin_id, verbosity)

source code 

Print out some header text for the spin.

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