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, do_local_search=True, num_global_searches=5, init_strategy='lhd_maximin', init_include_midpoint=True, init_sample_fraction=- 1.0, init_sample_increase_parallel=0.05, 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, ref_num_integer_candidates=10, ref_acceptable_decrease_shrink=0.2, ref_acceptable_decrease_enlarge=0.6, ref_acceptable_decrease_move=0.1, ref_min_radius=0.001, ref_init_radius_multiplier=2.0, ref_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]

Bases: object

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_iterationsint

Maximum number of iterations. Default 1000.

max_evaluationsint

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

max_noisy_evaluationsint

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

max_cyclesint

Maximum number of optimization cycles. Default 1000.

max_clock_timefloat

Maximum wall clock time in seconds. Default 1.0e30.

algorithmstring

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

num_cpusint

Number of CPUs used. Default 1.

parallel_wakeup_timefloat

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.

rbfstring

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_parameterfloat

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_objvalfloat

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_optfloat

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

eps_zerofloat

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

eps_imprfloat

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_dependencefloat

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

min_distfloat

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_infstepbool

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

do_local_searchbool

Perform a pure local search in every optimization cycle. Default True.

num_global_searchesint

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

init_strategystring

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

init_include_midpointbool

Include midpoint of the box among the initialization points. Default True.

init_sample_fractionfloat

The initial sample size is set to n + 1 times this number, with some adjustment for parallel optimization based on init_sample_increase_parallel. If set to -1 (or any negative number), the size of the initial sample set will be determined automatically. Default -1.

init_sample_increase_parallelfloat

Fraction of increase of the number of initial sample points in order to reduce synchronization efforst in asynchronous parallel evaluation. The number of total initialization points is increase by a factor (1 + num_cpus * init_sample_increase_parallel), and optimization starts when the originally targetd number of samples is reached. Default 0.05.

max_random_initint

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_scalingstring

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

log_scaling_thresholdfloat

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_scalingstring

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

dynamism_clippingstring

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

dynamism_thresholdfloat

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_thresholdfloat

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_scalingfloat

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

max_stalled_iterationsint

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

discarded_window_sizeint

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_discardedfloat

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

max_consecutive_restorationint

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

max_cross_validationsint

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

max_noisy_restartsint

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

max_noisy_iterationsint

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

targetval_clippingbool

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_methodstring

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_sizeint

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_generationsint

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_problemsint

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_scorebool

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_refinementint

Maximum number of consecutive refinement steps. Default 5.

thresh_unlimited_refinementfloat

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_stalledfloat

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_frequencyint

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.

ref_num_integer_candidatesint

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

ref_acceptable_decrease_shrinkfloat

Maximum ratio between real decrease and refinement model decrease for which the radius of the local search gets shrunk. Default 0.2.

ref_acceptable_decrease_enlargefloat

Minimum ratio between real decrease and refinement model decrease for which the radius of the local search gets enlarged. Default 0.6.

ref_acceptable_decrease_movefloat

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

ref_min_radiusfloat

Minimum radius of the local search for the refinement step. Default 1.0e-3.

ref_init_radius_multiplierfloat

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

ref_min_grad_normfloat

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

save_state_intervalint

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_filestring

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_outputbool

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_pathstring

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_pathstring

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’.

debugbool

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_seedint

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

Attributes
_allowed_rbfDict[string]

Allowed types of RBF functions.

_allowed_init_strategyDict[string]

Allowed initialization strategies.

_allowed_function_scalingDict[string]

Allowed function scaling strategies.

_allowed_domain_scalingDict[string]

Allowed domain scaling strategies.

_allowed_dynamism_clippingDict[string]

Allowed dynamism clipping strategies.

_allowed_algorithmDict[string]

Allowed algorithms.

_allowed_global_search_methodDict[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
argsDict[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_streamfile

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
dimensionint

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

var_lower1D numpy.ndarray[float]

Vector of variable lower bounds.

var_upper1D numpy.ndarray[float]

Vector of variable upper bounds.

integer_vars1D 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.