pySOT Optimization Methods¶
Python Surrogate Optimization Toolbox (pySOT) [1] implements a collection of surrogate optimization algorithms with several variations in surrogate model, optimization strategy, and experimental plan provided. pySOT includes support for asynchronous use of all optimization algorithms which is utilized by rsopt.
Currently rsopt implements a fixed choice for the three components and uses:
RBFInterpolant for the surrogate model, SRBFStrategy for the strategy, and SymmetricLatinHypercube for the
experimental plan.
- pySOT is not included in rsopt’s basic install. It can installed via pip with:
pip install pySOT
Configuration¶
Requirements and optional keys for setting up the configuration file to use pySOT are given below.
Codes Blocks¶
No special configuration is needed in any portion of the codes blocks to use pySOT.
Options¶
The following required and optional keys can be used within the options: block:
software[str (required)]:pysotsoftware_options[dict (optional)]:num_pts[int (optional)]: Sets the number of points that will be evaluated as part of the experimental planning phase before optimization begins. Defaults to \(2 * (DIM + 1)\) if not set.
Objective Function¶
The objective function must return a single value of type float. Minimization of the objective is always assumed.
1 # As passed to options.objective_function:
2 def obj_f(J):
3 # Objective function is always passed
4 # to the rsopt job dictionary `J`
5
6 # ... Code to calculate objective value `f`
7
8 return f
9
10 # Example if using code block type `python`
11 # without options.objective_function:
12 def my_function(x, y):
13 # Assuming user defined `parameters` (x, y)
14 # in the configuration file
15
16 f = x**2 + y**2 + x * y
17
18 return f
Example Options Block¶
options:
software: pysot
# 9 workers will run simulations. 1 worker will be running pysot.
nworkers: 10
software_options:
num_pts: 42
exit_criteria:
sim_max: 400
# objective_function can be optional if using python in codes
objective_function: [objective.py, obj_f]