Evolution Controls
Package related to evolution controls.
Classes summary
Abstract class for evolution controls. |
|
Class for random evolution control. |
|
Abstract class for informed evolution controls. |
|
Class for best predicted EC. |
|
Class for distance EC. |
|
Class for predictive standard deviation EC. |
|
|
Class for expected improvement EC. |
|
Class for probability of improvement EC. |
|
Class for lower confident bound EC. |
|
Class for Wang-2020's adaptive EC. |
Class for the EC based on multi-objective POV and LCB from: |
|
Class for the IC based on multi-objective POV and LCB from: |
|
Abstract class for ensembles of EC. |
|
Class for Pareto-based EC. |
|
|
Class for bi-objective Pareto-based EC from Tian-2018. |
|
Class for dynamic exclusive EC. |
|
Class for dynamic inclusive EC. |
Class for adaptive EC. |
|
Class for committee of evolution controls. |
Naive
Evolution Control (abstract)
- class Evolution_Controls.Evolution_Control.Evolution_Control
Bases:
ABCAbstract class for evolution controls.
- abstract get_sorted_indexes(pop)
Returns the candidates’ indexes sorted in descending promise order.
- Parameters:
pop (Population) – population to split
- Returns:
list of indexes
- Return type:
np.ndarray
Random
- class Evolution_Controls.Random_EC.Random_EC
Bases:
Evolution_ControlClass for random evolution control.
- get_sorted_indexes(pop)
Returns the candidates’ indexes sorted in descending promise order.
- Parameters:
pop (Population) – population to split
- Returns:
list of indexes
- Return type:
np.ndarray
Informed
Informed (abstract)
- class Evolution_Controls.Informed_EC.Informed_EC(surr)
Bases:
Evolution_ControlAbstract class for informed evolution controls.
- Parameters:
surr (Surrogate) – surrogate model
- abstract get_IC_value(dvec)
Returns the promisingness values of candidates.
- Parameters:
dvec (np.ndarray) – decision vectors
- Returns:
the promise
- Return type:
np.ndarray
- abstract get_sorted_indexes(pop)
Returns the candidates’ indexes sorted in descending promise order.
- Parameters:
pop (Population) – population to split
- Returns:
list of indexes
- Return type:
np.ndarray
Predicted Objective Value
- class Evolution_Controls.POV_EC.POV_EC(surr)
Bases:
Informed_ECClass for best predicted EC.
Candidates with lower predicted objective value (POV) by the surrogate are more promising.
__init__ method’s input
- Parameters:
surr (Surrogate) – surrogate model
- get_sorted_indexes(pop)
Returns the candidates’ indexes sorted in descending promise order.
- Parameters:
pop (Population) – population to split
- Returns:
list of indexes
- Return type:
np.ndarray
- get_IC_value(dvec)
Returns the promisingness values of candidates.
- Parameters:
dvec (np.ndarray) – decision vectors
- Returns:
the promise
- Return type:
np.ndarray
Distance
- class Evolution_Controls.Distance_EC.Distance_EC(surr)
Bases:
Informed_ECClass for distance EC.
Candidates with greater distance from the set of already simulated candidates are more promising.
__init__ method’s input
- Parameters:
surr (Surrogate) – surrogate model
- get_sorted_indexes(pop)
Returns the candidates’ indexes sorted in descending promise order.
- Parameters:
pop (Population) – population to split
- Returns:
list of indexes
- Return type:
np.ndarray
- get_IC_value(dvec)
Returns the promisingness values of candidates.
- Parameters:
dvec (np.ndarray) – decision vectors
- Returns:
the promise
- Return type:
np.ndarray
Predictive Standard Deviation
- class Evolution_Controls.Pred_Stdev_EC.Pred_Stdev_EC(surr)
Bases:
Informed_ECClass for predictive standard deviation EC.
Candidates with greater predictive standard deviation are more promising.
__init__ method’s input
- Parameters:
surr (Surrogate) – surrogate model
- get_sorted_indexes(pop)
Returns the candidates’ indexes sorted in descending promise order.
- Parameters:
pop (Population) – population to split
- Returns:
list of indexes
- Return type:
np.ndarray
- get_IC_value(dvec)
Returns the promisingness values of candidates.
- Parameters:
dvec (np.ndarray) – decision vectors
- Returns:
the promise
- Return type:
np.ndarray
Expected Improvement
- class Evolution_Controls.Expected_Improvement_EC.Expected_Improvement_EC(surr)
Bases:
Informed_ECClass for expected improvement EC.
Candidates with greater expected improvement are more promising.
__init__ method’s input
- Parameters:
surr (Surrogate) – surrogate model
- get_sorted_indexes(pop)
Returns the candidates’ indexes sorted in descending promise order.
- Parameters:
pop (Population) – population to split
- Returns:
list of indexes
- Return type:
np.ndarray
- get_IC_value(dvec)
Returns the promisingness values of candidates.
- Parameters:
dvec (np.ndarray) – decision vectors
- Returns:
the promise
- Return type:
np.ndarray
Probability Improvement
- class Evolution_Controls.Probability_Improvement_EC.Probability_Improvement_EC(surr)
Bases:
Informed_ECClass for probability of improvement EC.
Candidates with greater probability of improvement are more promising.
__init__ method’s input
- Parameters:
surr (Surrogate) – surrogate model
- get_sorted_indexes(pop)
Returns the candidates’ indexes sorted in descending promise order.
- Parameters:
pop (Population) – population to split
- Returns:
list of indexes
- Return type:
np.ndarray
- get_IC_value(dvec)
Returns the promisingness values of candidates.
- Parameters:
dvec (np.ndarray) – decision vectors
- Returns:
the promise
- Return type:
np.ndarray
Lower Confident Bound
- class Evolution_Controls.Lower_Confident_Bound_EC.Lower_Confident_Bound_EC(surr, w=1.0)
Bases:
Informed_ECClass for lower confident bound EC.
Candidates with lower lower confident bound are more promising.
- Parameters:
w (float in [0; 3]) – weight for LCB
__init__ method’s input
- Parameters:
surr (Surrogate) – surrogate model
- get_sorted_indexes(pop)
Returns the candidates’ indexes sorted in descending promise order.
- Parameters:
pop (Population) – population to split
- Returns:
list of indexes
- Return type:
np.ndarray
- get_IC_value(dvec)
Returns the promisingness values of candidates.
- Parameters:
dvec (np.ndarray) – decision vectors
- Returns:
the promise
- Return type:
np.ndarray
Adaptive (from Wang-2020)
- class Evolution_Controls.Adaptive_Wang2020_EC.Adaptive_Wang2020_EC(surr, search_budget, uncert_treatment)
Bases:
Informed_ECClass for Wang-2020’s adaptive EC.
The EC is described in: X. Wang, Y. Jin, S. Schmitt and M. Olhofer. An adaptive Bayesian approach to surrogate-assisted evolutionary multi-objective optimization. In Information Sciences 519 (2020), pp. 317–331. ISSN: 0020-0255.
At the early stage of the search, minimization of the predicted objective value prevails (favoring fast convergence). As the search progresses, more importance is given to uncertainty minimization (favoring exploitation) or uncertainty maximization (favoring exploration).
- Parameters:
search_budget (positive int, not zero) – search budget (expressed either in number of generations, number of cycles, number of batches or time)
weight (float) – weight (alpha in Wang-2020)
uncert_treatment (int) – 1 for uncertainty minimization, -1 for uncertainty maximization
__init__ method’s input
- Parameters:
surr (Surrogate) – surrogate model
uncert_treatment (str) – “min” for uncertainty minimization, “max” for uncertainty maximization
- get_sorted_indexes(pop)
Returns the candidates’ indexes sorted in descending promise order.
- Parameters:
pop (Population) – population to split
- Returns:
list of indexes
- Return type:
np.ndarray
- get_IC_value(dvec)
Returns the promisingness values of candidates.
- Parameters:
dvec (np.ndarray) – decision vectors
- Returns:
the promise
- Return type:
np.ndarray
- update_EC(search_progress)
Set the weight according to the search progress.
- Parameters:
search_progress (positive int) – current search progress (expressed either in number of generations, number of cycles, number of batches or time)
Multi-objective POV and LCB (from Ruan-2020)
- class Evolution_Controls.MO_POV_LCB_EC.MO_POV_LCB_EC(surr, q)
Bases:
Informed_ECClass for the EC based on multi-objective POV and LCB from:
- Parameters:
q (int) – number of candidates to retain for simulation
__init__ method’s input
- Parameters:
surr (Surrogate) – surrogate model
- get_sorted_indexes(pop)
Returns the candidates’ indexes sorted in descending promise order.
- Parameters:
pop (Population) – population to split
- Returns:
list of indexes
- Return type:
np.ndarray
- get_IC_value(dvec)
Returns the promisingness values of candidates.
- Parameters:
dvec (np.ndarray) – decision vectors
- Returns:
the promise
- Return type:
np.ndarray
- class Evolution_Controls.MO_POV_LCB_IC.MO_POV_LCB_IC(surr)
Bases:
Informed_ECClass for the IC based on multi-objective POV and LCB from:
__init__ method’s input
- Parameters:
surr (Surrogate) – surrogate model
- get_sorted_indexes(pop)
Returns the candidates’ indexes sorted in descending promise order.
- Parameters:
pop (Population) – population to split
- Returns:
list of indexes
- Return type:
np.ndarray
- get_IC_value(dvec)
Returns the promisingness values of candidates.
- Parameters:
dvec (np.ndarray) – decision vectors
- Returns:
the promise
- Return type:
np.ndarray
Ensemble
Ensemble (abstract)
- class Evolution_Controls.Ensemble_EC.Ensemble_EC(*ECs)
Bases:
Evolution_ControlAbstract class for ensembles of EC.
- Parameters:
ECs_list (list(Evolution_Control)) – evolution controls
- abstract get_sorted_indexes(pop)
Returns the candidates’ indexes sorted in descending promise order.
- Parameters:
pop (Population) – population to split
- Returns:
list of indexes
- Return type:
np.ndarray
Pareto
- class Evolution_Controls.Pareto_EC.Pareto_EC(coeffs, distinct_mode, *ECs)
Bases:
Ensemble_ECClass for Pareto-based EC.
Candidate minimazing the first EC (multiplied by its coefficient -1 or 1) is the most promising. Candidate minimizing the second EC (multiplied by its coefficient -1 or 1) is the second most promising. Remaining candidates are ordering according to their non-dominated rank (the lowest the rank the more promising is the candidate). Candidates with same non-dominated rank are ordered either according to their crowding distance cd or according to their hypervolume contribution hvc.
- Parameters:
coeffs (np.ndarray) – coefficients (1 or -1) to multiply the EC with (allow to convert a minimization problem into a maximization problem and reversely)
distinct_mode (either cd or hvc) – criterion to distinguish solutions with same non domination rank. When equals cd solutions with higher crowded distance are considered as more promising. When equals to hvc, solutions with higher hypervolume contribution are considered as more promising.
__init__ method’s input
- Parameters:
ECs (list(Evolution_Control)) – evolution controls
- get_sorted_indexes(pop)
Returns the candidates’ indexes sorted in descending promise order.
- Parameters:
pop (Population) – population to split
- Returns:
list of indexes
- Return type:
np.ndarray
Pareto-based (from Tian-2018)
- class Evolution_Controls.Pareto_Tian2018_EC.Pareto_Tian2018_EC(coeffs, *ECs)
Bases:
Ensemble_ECClass for bi-objective Pareto-based EC from Tian-2018.
Candidates with lowest non-dominated and highest rank according to minimization of the ECs (multiplied by their respective coefficient 1 or -1) are more promising. Then, Candidates with increasing non-dominated rank are increasingly promising.
- Parameters:
coeffs (np.ndarray) – coefficients (1 or -1) to multiply the EC with (allow to convert a minimization problem into a maximization problem and reversely)
__init__ method’s input
- Parameters:
ECs (list(Evolution_Control)) – evolution controls
- get_sorted_indexes(pop)
Returns the candidates’ indexes sorted in descending promise order.
- Parameters:
pop (Population) – population to split
- Returns:
list of indexes
- Return type:
np.ndarray
Dynamic Exclusive
- class Evolution_Controls.Dynamic_Exclusive_EC.Dynamic_Exclusive_EC(search_budget, sections, *ECs)
Bases:
Ensemble_ECClass for dynamic exclusive EC.
Only one EC is active at a time. The active EC changes during the search according to the search budget, the activation sections and the current search progress.
- Parameters:
search_budget (positive int, not zero) – search budget (expressed either in number of generations, number of acquisition processes or time)
sections (list) – activation sections (determines the moment to change the active EC)
idx_active (positive int) – index of the current active EC in ECs_list
__init__ method’s input
- Parameters:
ECs (list(Evolution_Control)) – evolution controls
- get_sorted_indexes(pop)
Returns the candidates’ indexes sorted in descending promise order.
- Parameters:
pop (Population) – population to split
- Returns:
list of indexes
- Return type:
np.ndarray
- update_active(search_progress)
Update the active EC.
- Parameters:
search_progress (positive int) – current search progress (expressed either in number of generations, number of acquisition processes or time)
Dynamic Inclusive
- class Evolution_Controls.Dynamic_Inclusive_EC.Dynamic_Inclusive_EC(search_budget, N_SIM, N_PRED, *ECs)
Bases:
Ensemble_ECClass for dynamic inclusive EC.
Designed as an ensemble of 2 ECs only. Two ECs are active at a time. The proportion of use of each EC changes during the search according to the search budget, and the current search progress.
- Parameters:
search_budget (positive int, not zero) – search budget (expressed either in number of generations, number of acquisition processes or time)
search_progress (positive int, not zero) – search progress (expressed either in number of generations, number of acquisition processes or time)
N_SIM (int, positive) – number of solution to select for simulation
N_PRED (int, positive) – number of solution to select for prediction
__init__ method’s input
- Parameters:
ECs (list(Evolution_Control)) – evolution controls
- get_sorted_indexes(pop)
Returns the candidates’ indexes sorted in descending promise order.
- Parameters:
pop (Population) – population to split
- Returns:
list of indexes
- Return type:
np.ndarray
- update_active(search_progress)
Update the proportion of use of each EC.
- Parameters:
search_progress (positive int) – current search progress (expressed either in number of generations, number of acquisition processes or time)
Adaptive
- class Evolution_Controls.Adaptive_EC.Adaptive_EC(sim_obj_vals, pred_obj_vals, init_best_obj_val, *ECs)
Bases:
Ensemble_ECClass for adaptive EC.
Only one EC is active at a time. The active EC is switched according to a stagnation detection mechanism and a reward mechanism. The stagnation detection mechanism triggers the EC switch when the best simulated objective value found so far has not improve by at least 1e-8 during 8 batches (i.e. 8 acquisition processes). The reward mechanism chooses which EC becomes active by rewarding and penalizing all the ECs at each batch (i.e. each acquisition process) according to the error between the simulated objective values and the predicted objective values computed on the last batch of candidates.
- Parameters:
previous_best_obj_val (float) – best simulated objective value found so far
counter (int) – counter for the stagnation detection mechanism
ECs_reward (list) – rewards of each EC
idx_active (positive int) – index of the current active EC in ECs_list
threshold (float) – threshold value (mean error between simulated objective values and predicted objective values from the last batches of simulations)
saved_idx (np.ndarray) – 1 row per EC. A row contains the candidates indexes (into the population) ordered according to the associated EC.
__init__ method’s input
- Parameters:
sim_obj_vals (np.ndarray) – simulation objective values of the last batch of candidates (to initialize threshold)
pred_obj_vals (np.ndarray) – prediction objective values of the last batch of candidates (to initialize threshold)
init_best_obj_val (float) – initial best simulated objective value found
ECs (list(Evolution_Control)) – evolution controls
- get_sorted_indexes(pop)
Returns the candidates’ indexes sorted in descending promise order.
- Parameters:
pop (Population) – population to split
- Returns:
list of indexes
- Return type:
np.ndarray
- update_active(sim_obj_vals, pred_obj_vals, new_best_obj_val)
Set the rewards/penalties, update the threshold and the counter. Potentially update the active EC.
Reward mechanism: The error, computed as the difference between simulated and predicted objective values over the last batch of candidates, is compared to the threshold. A small error produces a reward for ECs that should have decided to simulate (including the active EC) and produces a penalty for other ECs. A large error produces a penalty for ECs that should have decided to simulate (including the active EC) and produces a reward for other ECs.
Stagnation detection mechanism: if the best simulated objective value found so far has not improved by at least 1e-2 during 8 iteration, the active EC is updated. If the last active EC get the higher reward, it remains the active EC. When the stagnation detection occurs, the counter and the reward vector are reset.
- Parameters:
sim_obj_vals (np.ndarray) – simulation objective values of the last batch of candidates (to compute the error)
pred_obj_vals (np.ndarray) – prediction objective values of the last batch of candidates (to compute the error)
new_best_obj_val (float) – best simulated objective value found so far
Committee
- class Evolution_Controls.Committee_EC.Committee_EC(n_sim, *ECs)
Bases:
Ensemble_ECClass for committee of evolution controls.
All the ECs vote to determine the promise of the candidates.
- Parameters:
n_sim (positive int, not zero) – number of simulated candidates from the batch
__init__ method’s input
- Parameters:
ECs (list(Evolution_Control)) – evolution controls
- get_sorted_indexes(pop)
Returns the candidates’ indexes sorted in descending promise order.
- Parameters:
pop (Population) – population to split
- Returns:
list of indexes
- Return type:
np.ndarray