rbfopt_settings module

Settings for RBFOpt.

This module contains the settings of the main optimization algorithm.

Licensed under Revised BSD license, see LICENSE. (C) Copyright Singapore University of Technology and Design 2015. (C) Copyright International Business Machines Corporation 2016.

class rbfopt_settings.RbfoptSettings(max_iterations=1000, max_evaluations=300, max_noisy_evaluations=200, max_cycles=1000, max_clock_time=1e+30, num_cpus=1, parallel_wakeup_time=0.1, algorithm='MSRSM', rbf='auto', rbf_shape_parameter=0.1, target_objval=-10000000000.0, eps_opt=0.01, eps_zero=1e-15, eps_impr=0.0001, eps_linear_dependence=1e-06, min_dist=1e-05, do_infstep=False, num_global_searches=5, init_strategy='lhd_maximin', max_random_init=50, function_scaling='auto', log_scaling_threshold=1000000.0, domain_scaling='auto', dynamism_clipping='auto', dynamism_threshold=1000.0, local_search_threshold=0.25, local_search_box_scaling=0.5, max_stalled_iterations=100, discarded_window_size=30, max_fraction_discarded=0.5, max_consecutive_restoration=15, max_cross_validations=50, max_noisy_restarts=2, max_noisy_iterations=200, targetval_clipping=True, global_search_method='genetic', ga_base_population_size=400, ga_num_generations=20, num_samples_aux_problems=1000, modified_msrsm_score=True, max_consecutive_refinement=5, thresh_unlimited_refinement=0.9, thresh_unlimited_refinement_stalled=0.9, refinement_frequency=3, tr_num_integer_candidates=10, tr_acceptable_decrease_shrink=0.2, tr_acceptable_decrease_enlarge=0.6, tr_acceptable_decrease_move=0.1, tr_min_radius=0.001, tr_init_radius_multiplier=2.0, tr_min_grad_norm=0.01, print_solver_output=False, save_state_interval=100000, save_state_file='rbfopt_algorithm_state.dat', minlp_solver_path='bonmin', nlp_solver_path='ipopt', debug=False, rand_seed=937627691)[source]

Global and algorithmic settings for RBF method.

Class containing algorithmic settings for the enhanced RBF method, as well as global settings such as tolerances, limits and so on.

NOTICE: The docstring for the parameters below is used to build the help in the command-line interface. It is therefore very important that it is kept tidy in the correct numpy docstring format.

Parameters:
max_iterations : int

Maximum number of iterations. Default 1000.

max_evaluations : int

Maximum number of function evaluations in accurate mode. Default 300.

max_noisy_evaluations : int

Maximum number of function evaluations in noisy mode. Default 200.

max_cycles : int

Maximum number of optimization cycles. Default 1000.

max_clock_time : float

Maximum wall clock time in seconds. Default 1.0e30.

algorithm : string

Optimization algorithm used. Choice of ‘Gutmann’ and ‘MSRSM’, see References Gutmann (2001) and Regis and Shoemaker (2007). Default ‘MSRSM’.

num_cpus : int

Number of CPUs used. Default 1.

parallel_wakeup_time : float

Time (in seconds) after which the main optimization engine checks the arrival of results from workers busy with function evaluations or other computations. This parameter is only used by the parallel optimizer. Default 0.1.

rbf : string

Radial basis function used by the method. Choice of ‘cubic’, ‘thin_plate_spline’, ‘linear’, ‘multiquadric’, ‘gaussian’, ‘auto’. In case of ‘auto’, the type of rbf and the shape parameter will be dynamically selected by the algorithm. Default ‘auto’.

rbf_shape_parameter : float

Shape parameter for the radial basis function. Used only by the gaussian and multiquadric RBF, this is also known as the gamma parameter. If the rbf is ‘auto’, this will be automatically selected from a finite set. Default 0.1.

target_objval : float

The objective function value we want to reach, i.e. the value of the unknown optimum. It can be set to an acceptable value, if the optimum is unknown. Default -1.0e10.

eps_opt : float

Optimality threshold. Any solution within this relative distance from the target_objval is considered optimal. Default 1.0e-2.

eps_zero : float

Tolerance for zeroing out small coefficients in the calculations. Any value smaller than this will be considered zero. Default 1.0e-15.

eps_impr : float

Tolerance for improvement of the objective function. Any improvement in the objective function by less than this amount in absolute and relative terms, will be ignored. Default 1.0e-4.

eps_linear_dependence : float

Tolerance to determine if a set of columns/rows is linearly dependent. Default 1.0e-6.

min_dist : float

Minimum Euclidean distance between nodes. A new point will be discarded if it is closer than this value from existing nodes. This prevents the RBF matrix, which depends on pairwise distances, from becoming singular. Default 1.0e-5.

do_infstep : bool

Perform a pure global search in every optimization cycle. Default False.

num_global_searches : int

Number of steps in the global search phase. Default 5.

init_strategy : string

Strategy to select initial points. Choice of ‘all_corners’, ‘lower_corners’, ‘rand_corners’, ‘lhd_maximin’, ‘lhd_corr’. Default ‘lhd_maximin’.

max_random_init : int

Maximum number of trials for the random initialization strategies, in case they generate a linearly dependent set of samples. After this number of trials, the initialization algorithm will bail out. Default 50.

function_scaling : string

Rescaling method for the function values. Choice of ‘off’, ‘affine’, ‘log’, ‘auto’. Default ‘auto’.

log_scaling_threshold : float

Minimum value for the difference between median and minimum function value before a log scaling of the function values is applied in the ‘auto’ setting. Default 1.0e6.

domain_scaling : string

Rescaling method for the domain. Choice of ‘off’, ‘affine’, ‘auto’. Default ‘auto’.

dynamism_clipping : string

Dynamism clipping strategy. Choice of ‘off’, ‘median’, ‘clip_at_dyn’, ‘auto’. Default ‘auto’.

dynamism_threshold : float

Minimum value of the ratio between the largest and the smallest absolute function values before the dynamism clipping strategy is applied. Default 1.0e3.

local_search_threshold : float

Threshold used to determines what is a local search. If the scaling factor used in the computation of f_n^* is less than this value, it is assumed that the search is a local search. Default 0.25.

local_search_box_scaling : float

Rescaling factor for the hyperbox used for local search. See parameter nu of Regis and Shoemaker (2007). Default 0.5.

max_stalled_iterations : int

Maximum number of iterations without improvement before we perform a full restart. Default 100.

discarded_window_size : int

Number of consecutive iterations that are considered to determine if a restart should be triggered, based on too many discarded points. This number is multiplied by the number of cpus to determine the actual rolling window size. Default 30.

max_fraction_discarded : float

Maximum fraction of discarded points within the last discarded_window_size*num_cpus iterations before a restart is triggered. Default 0.5.

max_consecutive_restoration : int

Maximum number of consecutive nonsingularity restoration phases before the algorithm fails. Default 15.

max_cross_validations : int

Maximum number of cross validations before we trust our previous results. Default 50.

max_noisy_restarts : int

Maximum number of restarts in noisy mode before we switch to accurate mode. Default 2.

max_noisy_iterations : int

Maximum number of iterations in noisy mode before switching to accurate mode. Default 200.

targetval_clipping : bool

Clip target value selection based on periodically eliminating some of the largest function values, as proposed by Gutmann (2001) and later Regis and Shoemaker (2007). Used by Gutmann RBF method only. Default True.

global_search_method : string

The methodology to be used in the solution of global search problems, i.e. the infstep and the global step. The options are’genetic’, ‘sampling’ and ‘solver’. If ‘genetic’, a heuristic based on a genetic algorithm is used. If ‘sampling’, random sampling is used. If ‘solver’, the available solvers are used to try to solve mathematical programming models. Default ‘genetic’.

ga_base_population_size : int

Minimum population size for the genetic algorithm used to optimize the global search step or infstep, when the genetic global search method is chosen. The final population is computed as the minimum population + n/5, where n is the number of decision variables. Default 400.

ga_num_generations : int

Number of generations for the genetic algorithm used to optimize the global search step or infstep, when the genetic global search method is chosen. Default 20.

num_samples_aux_problems : int

Multiplier for the dimension of the problem to determine the number of samples used by the Metric SRSM traditional algorithm at every iteration. Default 1000.

modified_msrsm_score : bool

Use the modified MSRSM score function in which the objective function value contribution always has a weight of 1, instead of 1 - distance_weight. This setting is more aggressive in improving the objective function value, compared to the original MSRSM score function. Default True.

max_consecutive_refinement : int

Maximum number of consecutive refinement steps. Default 5.

thresh_unlimited_refinement : float

Lower threshold for the amount of search budget depleted, after which the maximum limit on consecutive refinement is ignored. The search budget here is in terms of number of iterations, number of evaluations, wall clock time. Default 0.9.

thresh_unlimited_refinement_stalled : float

Lower threshold for the percentage of stalled iterations, relative to the maximum number of stalled iterations that will trigger a restart, after which unlimited consecutive refinement are allowed. Default 0.9.

refinement_frequency : int

In serial search mode, this indicates the number of full global search cycles after which the refinement step can be performed (in case a better solution has been found in the meantime). In parallel mode, this determines the maximum acceptable ratio between other search steps and refinement steps. Default 3.

tr_num_integer_candidates : int

Number of integer candidates per dimension of the problem that are considered when rounding the (fractional) point computed during the refinement step. Default 10.

tr_acceptable_decrease_shrink : float

Maximum ratio between real decrease and trust region model decrease for which the radius of the trust region gets shrunk. Default 0.2.

tr_acceptable_decrease_enlarge : float

Minimum ratio between real decrease and trust region model decrease for which the radius of the trust region gets enlarged. Default 0.6.

tr_acceptable_decrease_move : float

Minimum ratio between real decrease and trust region model decrease for which the new candidate point is accepted as the new iterate. Default 0.1.

tr_min_radius : float

Minimum radius of the trust region for the refinement step. Default 1.0e-3.

tr_init_radius_multiplier : float

Exponent (with base 2) of the multiplier used to determine the minimum initial radius of the trust region for the refinement step. Default 2.0.

tr_min_grad_norm : float

Minimum norm of the gradient for the trust region method in the refinement step, before we assume that we converged to a stationary point. Default 1.0e-2.

save_state_interval : int

Number of iterations after which the state of the algorithm should be dumped to file. The algorithm can be resumed from a saved state. It can be useful in case something goes wrong. Default 100000.

save_state_file : string

Name of the file in which the state of the algorithm will be saved at regular intervals, see save_state_interval. Default ‘rbfopt_algorithm_state.dat’.

print_solver_output : bool

Print the output of the solvers to screen? Note that this cannot be redirected to file so it will go to stdout. Default False.

minlp_solver_path : string

Full path to the MINLP solver executable, i.e., bonmin. If only the name solver is specified, it is assumed that the solver is part of your system path and can be called from anywhere. Default ‘bonmin’.

nlp_solver_path : string

Full path to the NLP solver executable, i.e., ipopt. If only the name solver is specified, it is assumed that the solver is part of your system path and can be called from anywhere. Default ‘ipopt’.

debug : bool

Print debug output. Internal error messages are typically printed to stderr, Pyomo error messages are determined by its logger. If False, all warnings and error messages are suppressed. Default False.

rand_seed : int

Seed for the random number generator. The maximum number supported by numpy on all platforms is 2^32. Default 937627691.

Attributes:
_allowed_rbf : Dict[string]

Allowed types of RBF functions.

_allowed_init_strategy : Dict[string]

Allowed initialization strategies.

_allowed_function_scaling : Dict[string]

Allowed function scaling strategies.

_allowed_domain_scaling : Dict[string]

Allowed domain scaling strategies.

_allowed_dynamism_clipping : Dict[string]

Allowed dynamism clipping strategies.

_allowed_algorithm : Dict[string]

Allowed algorithms.

_allowed_global_search_method : Dict[string]

Allowed global search methods.

classmethod from_dictionary(args)[source]

Construct settings from dictionary containing parameter values.

Construct an instance of RbfoptSettings by looking up the value of the parameters from a given dictionary. The dictionary must contain only parameter values in the form args[‘name’] = value. Anything else present in the dictionary will raise an exception.

Parameters:
args : Dict[string]

A dictionary containing the values of the parameters in a format args[‘name’] = value.

Returns:
RbfoptSettings

An instance of the object of the class.

Raises:
ValueError

If the dictionary contains invalid parameters.

print(output_stream)[source]

Print the value of all settings.

Prints the settings to the output stream, on a very long line.

Parameters:
output_stream : file

The stream on which messages are printed.

set_auto_parameters(dimension, var_lower, var_upper, integer_vars)[source]

Determine the value for ‘auto’ parameters.

Create a copy of the settings and assign ‘auto’ parameters. The original settings are untouched.

Parameters:
dimension : int

The dimension of the problem, i.e. size of the space.

var_lower : 1D numpy.ndarray[float]

Vector of variable lower bounds.

var_upper : 1D numpy.ndarray[float]

Vector of variable upper bounds.

integer_vars : 1D numpy.ndarray[int]

A list containing the indices of the integrality constrained variables. If empty list, all variables are assumed to be continuous.

Returns:
RbfoptSettings

A copy of the settings, without any ‘auto’ parameter values.