simopt.solvers package¶
Submodules¶
simopt.solvers.adam module¶
Summary¶
ADAM An algorithm for first-order gradient-based optimization of stochastic objective functions, based on adaptive estimates of lower-order moments. A detailed description of the solver can be found here.
- class simopt.solvers.adam.ADAM(name='ADAM', fixed_factors=None)¶
Bases:
Solver
An algorithm for first-order gradient-based optimization of stochastic objective functions, based on adaptive estimates of lower-order moments.
- name¶
name of solver
- Type:
string
- objective_type¶
- description of objective types:
“single” or “multi”
- Type:
string
- constraint_type¶
- description of constraints types:
“unconstrained”, “box”, “deterministic”, “stochastic”
- Type:
string
- variable_type¶
- description of variable types:
“discrete”, “continuous”, “mixed”
- Type:
string
- rng_list¶
list of RNGs used for the solver’s internal purposes
- Type:
list of mrg32k3a.mrg32k3a.MRG32k3a objects
- Parameters:
See also
- check_alpha()¶
- check_beta_1()¶
- check_beta_2()¶
- check_epsilon()¶
- check_r()¶
- check_sensitivity()¶
- finite_diff(new_solution, BdsCheck, problem)¶
- solve(problem)¶
Run a single macroreplication of a solver on a problem.
- Parameters:
problem (Problem object) – simulation-optimization problem to solve
crn_across_solns (bool) – indicates if CRN are used when simulating different solutions
- Returns:
recommended_solns (list of Solution objects) – list of solutions recommended throughout the budget
intermediate_budgets (list of ints) – list of intermediate budgets when recommended solutions changes
simopt.solvers.aloe module¶
Summary¶
ALOE The solver is a stochastic line search algorithm with the gradient estimate recomputed in each iteration, whether or not a step is accepted. The algorithm includes the relaxation of the Armijo condition by an additive constant. A detailed description of the solver can be found here.
- class simopt.solvers.aloe.ALOE(name='ALOE', fixed_factors=None)¶
Bases:
Solver
Adaptive Line-search with Oracle Estimations
- name¶
name of solver
- Type:
string
- objective_type¶
- description of objective types:
“single” or “multi”
- Type:
string
- constraint_type¶
- description of constraints types:
“unconstrained”, “box”, “deterministic”, “stochastic”
- Type:
string
- variable_type¶
- description of variable types:
“discrete”, “continuous”, “mixed”
- Type:
string
- rng_list¶
list of RNGs used for the solver’s internal purposes
- Type:
list of mrg32k3a.mrg32k3a.MRG32k3a objects
- Parameters:
See also
- check_alpha_0()¶
- check_alpha_max()¶
- check_epsilon_f()¶
- check_gamma()¶
- check_lambda()¶
- check_r()¶
- check_sensitivity()¶
- check_theta()¶
- finite_diff(new_solution, BdsCheck, problem, stepsize, r)¶
- solve(problem)¶
Run a single macroreplication of a solver on a problem.
- Parameters:
problem (Problem object) – simulation-optimization problem to solve
crn_across_solns (bool) – indicates if CRN are used when simulating different solutions
- Returns:
recommended_solns (list of Solution objects) – list of solutions recommended throughout the budget
intermediate_budgets (list of ints) – list of intermediate budgets when recommended solutions changes
simopt.solvers.astrodf module¶
Summary¶
The ASTRO-DF solver progressively builds local models (quadratic with diagonal Hessian) using interpolation on a set of points on the coordinate bases of the best (incumbent) solution. Solving the local models within a trust region (closed ball around the incumbent solution) at each iteration suggests a candidate solution for the next iteration. If the candidate solution is worse than the best interpolation point, it is replaced with the latter (a.k.a. direct search). The solver then decides whether to accept the candidate solution and expand the trust-region or reject it and shrink the trust-region based on a success ratio test. The sample size at each visited point is determined adaptively and based on closeness to optimality. A detailed description of the solver can be found here.
This version does not require a delta_max, instead it estimates the maximum step size using get_random_solution(). Parameter tuning on delta_max is therefore not needed and removed from this version as well. - Delta_max is so longer a factor, instead the maximum step size is estimated using get_random_solution(). - Parameter tuning on delta_max is therefore not needed and removed from this version as well. - No upper bound on sample size may be better - testing - It seems for SAN we always use pattern search - why? because the problem is convex and model may be misleading at the beginning - Added sufficient reduction for the pattern search
- class simopt.solvers.astrodf.ASTRODF(name='ASTRODF', fixed_factors=None)¶
Bases:
Solver
The ASTRO-DF solver.
- name¶
name of solver
- Type:
string
- objective_type¶
- description of objective types:
“single” or “multi”
- Type:
string
- constraint_type¶
- description of constraints types:
“unconstrained”, “box”, “deterministic”, “stochastic”
- Type:
string
- variable_type¶
- description of variable types:
“discrete”, “continuous”, “mixed”
- Type:
string
- rng_list¶
list of RNGs used for the solver’s internal purposes
- Type:
list of mrg32k3a.mrg32k3a.MRG32k3a objects
- Parameters:
See also
- check_eta_1()¶
- check_eta_2()¶
- check_gamma_1()¶
- check_gamma_2()¶
- check_lambda_min()¶
- check_ps_sufficient_reduction()¶
- construct_model(x_k, delta, k, problem, expended_budget, kappa, new_solution, visited_pts_list)¶
- evaluate_model(x_k, q)¶
- get_coordinate_basis_interpolation_points(x_k, delta, problem)¶
- get_coordinate_vector(size, v_no)¶
- get_model_coefficients(Y, fval, problem)¶
- get_rotated_basis(first_basis, rotate_index)¶
- get_rotated_basis_interpolation_points(x_k, delta, problem, rotate_matrix, reused_x)¶
- get_stopping_time(k, sig2, delta, kappa, dim)¶
- iterate(k, delta_k, delta_max, problem, visited_pts_list, new_x, expended_budget, budget_limit, recommended_solns, intermediate_budgets, kappa, new_solution)¶
- solve(problem)¶
Run a single macroreplication of a solver on a problem. :param problem: simulation-optimization problem to solve :type problem: Problem object :param crn_across_solns: indicates if CRN are used when simulating different solutions :type crn_across_solns: bool
- Returns:
recommended_solns (list of Solution objects) – list of solutions recommended throughout the budget
intermediate_budgets (list of ints) – list of intermediate budgets when recommended solutions changes
simopt.solvers.neldmd module¶
Summary¶
Nelder-Mead: An algorithm that maintains a simplex of points that moves around the feasible region according to certain geometric operations: reflection, expansion, contraction, and shrinking. A detailed description of the solver can be found here.
- class simopt.solvers.neldmd.NelderMead(name='NELDMD', fixed_factors=None)¶
Bases:
Solver
The Nelder-Mead algorithm, which maintains a simplex of points that moves around the feasible region according to certain geometric operations: reflection, expansion, contraction, and shrinking.
- name¶
name of solver
- Type:
string
- objective_type¶
- description of objective types:
“single” or “multi”
- Type:
string
- constraint_type¶
- description of constraints types:
“unconstrained”, “box”, “deterministic”, “stochastic”
- Type:
string
- variable_type¶
- description of variable types:
“discrete”, “continuous”, “mixed”
- Type:
string
- rng_list¶
list of RNGs used for the solver’s internal purposes
- Type:
list of mrg32k3a.mrg32k3a.MRG32k3a objects
- Parameters:
See also
- check_alpha()¶
- check_betap()¶
- check_const(pt, pt2)¶
- check_delta()¶
- check_gammap()¶
- check_initial_spread()¶
- check_r()¶
- check_sensitivity()¶
- solve(problem)¶
Run a single macroreplication of a solver on a problem.
- Parameters:
problem (Problem object) – simulation-optimization problem to solve
- Returns:
recommended_solns (list of Solution objects) – list of solutions recommended throughout the budget
intermediate_budgets (list of ints) – list of intermediate budgets when recommended solutions changes
- sort_and_end_update(problem, sol)¶
simopt.solvers.randomsearch module¶
Summary¶
Randomly sample solutions from the feasible region. Can handle stochastic constraints. A detailed description of the solver can be found here.
- class simopt.solvers.randomsearch.RandomSearch(name='RNDSRCH', fixed_factors=None)¶
Bases:
Solver
A solver that randomly samples solutions from the feasible region. Take a fixed number of replications at each solution.
- name¶
name of solver
- Type:
string
- objective_type¶
- description of objective types:
“single” or “multi”
- Type:
string
- constraint_type¶
- description of constraints types:
“unconstrained”, “box”, “deterministic”, “stochastic”
- Type:
string
- variable_type¶
- description of variable types:
“discrete”, “continuous”, “mixed”
- Type:
string
- rng_list¶
list of RNGs used for the solver’s internal purposes
- Type:
list of mrg32k3a.mrg32k3a.MRG32k3a objects
- Parameters:
See also
- check_sample_size()¶
- solve(problem)¶
Run a single macroreplication of a solver on a problem.
- Parameters:
problem (Problem object) – simulation-optimization problem to solve
crn_across_solns (bool) – indicates if CRN are used when simulating different solutions
- Returns:
recommended_solns (list of Solution objects) – list of solutions recommended throughout the budget
intermediate_budgets (list of ints) – list of intermediate budgets when recommended solutions changes
simopt.solvers.spsa module¶
Summary¶
Simultaneous perturbation stochastic approximation (SPSA) is an algorithm for optimizing systems with multiple unknown parameters.
- class simopt.solvers.spsa.SPSA(name='SPSA', fixed_factors=None)¶
Bases:
Solver
Simultaneous perturbation stochastic approximation (SPSA) is an algorithm for optimizing systems with multiple unknown parameters.
- name¶
name of solver
- Type:
string
- objective_type¶
- description of objective types:
“single” or “multi”
- Type:
string
- constraint_type¶
- description of constraints types:
“unconstrained”, “box”, “deterministic”, “stochastic”
- Type:
string
- variable_type¶
- description of variable types:
“discrete”, “continuous”, “mixed”
- Type:
string
- rng_list¶
list of RNGs used for the solver’s internal purposes
- Type:
list of mrg32k3a.mrg32k3a.MRG32k3a objects
- Parameters:
See also
- check_alpha()¶
- check_eval_pct()¶
- check_gamma()¶
- check_gavg()¶
- check_iter_pct()¶
- check_n_loss()¶
- check_n_reps()¶
- check_problem_factors()¶
- check_step()¶
- gen_simul_pert_vec(dim)¶
Generate a new simulatanious pertubation vector with a 50/50 probability discrete distribution, with values of -1 and 1. The vector size is the problem’s dimension. The vector components are independent from each other.
- solve(problem)¶
Run a single macroreplication of a solver on a problem.
- Parameters:
problem (Problem object) – simulation-optimization problem to solve
crn_across_solns (bool) – indicates if CRN are used when simulating different solutions
- Returns:
recommended_solns (list of Solution objects) – list of solutions recommended throughout the budget
intermediate_budgets (list of ints) – list of intermediate budgets when recommended solutions changes
- simopt.solvers.spsa.check_cons(candidate_x, new_x, lower_bound, upper_bound)¶
Evaluates the distance from the new vector (candiate_x) compared to the current vector (new_x) respecting the vector’s boundaries of feasibility. Returns the evaluated vector (modified_x) and the weight (t2 - how much of a full step took) of the new vector. The weight (t2) is used to calculate the weigthed average in the ftheta calculation.
simopt.solvers.strong module¶
Summary¶
STRONG: A trust-region-based algorithm that fits first- or second-order models through function evaluations taken within a neighborhood of the incumbent solution. A detailed description of the solver can be found here.
- class simopt.solvers.strong.STRONG(name='STRONG', fixed_factors=None)¶
Bases:
Solver
A trust-region-based algorithm that fits first- or second-order models through function evaluations taken within a neighborhood of the incumbent solution.
- name¶
name of solver
- Type:
string
- objective_type¶
- description of objective types:
“single” or “multi”
- Type:
string
- constraint_type¶
- description of constraints types:
“unconstrained”, “box”, “deterministic”, “stochastic”
- Type:
string
- variable_type¶
- description of variable types:
“discrete”, “continuous”, “mixed”
- Type:
string
- rng_list¶
list of RNGs used for the solver’s internal purposes
- Type:
list of mrg32k3a.mrg32k3a.MRG32k3a objects
- Parameters:
See also
- cauchy_point(grad, Hessian, new_x, problem)¶
- check_cons(candidate_x, new_x, lower_bound, upper_bound)¶
- check_delta_T()¶
- check_delta_threshold()¶
- check_eta_0()¶
- check_eta_1()¶
- check_gamma_1()¶
- check_gamma_2()¶
- check_lambda()¶
- check_n_r()¶
- check_sensitivity()¶
- finite_diff(new_solution, BdsCheck, stage, problem, n_r)¶
- solve(problem)¶
Run a single macroreplication of a solver on a problem.
- Parameters:
problem (Problem object) – simulation-optimization problem to solve
crn_across_solns (bool) – indicates if CRN are used when simulating different solutions
- Returns:
recommended_solns (list of Solution objects) – list of solutions recommended throughout the budget
intermediate_budgets (list of ints) – list of intermediate budgets when recommended solutions changes