selector.hp_point_selection
This module contains point selection functions.
Functions
|
Compute distance statistics. |
|
Get information of relations of suggested points by generator tag. |
|
Normalize and account for conditionals. |
|
Compute pairwise distances. |
|
Generate features and run simulation. |
|
Run simulations of config selection. |
- selector.hp_point_selection.distance_stats(smfeatures, distances)[source]
Compute distance statistics.
- Parameters:
suggested (list of selector.pool.Configuration) – List of suggested configurations.
distances (list) – Distance values.
- Returns:
New features for simulation.
- Return type:
ndarray
- selector.hp_point_selection.get_relatives(suggested)[source]
Get information of relations of suggested points by generator tag.
- Parameters:
suggested (list of selector.pool.Configuration) – List of suggested points.
- Returns:
Nested array, indices of related points (by selector.pool.Generator).
- Return type:
ndarray
- selector.hp_point_selection.normalize_plus_cond_acc(sugg, s)[source]
Normalize and account for conditionals.
- Parameters:
sugg (list of selector.pool.Configuration) – Suggested configurations.
s (selector.scenario.Scenario) – AC scenario.
- Returns:
Suggested configuration with normalized and adjusted values.
- Return type:
list
- selector.hp_point_selection.pairwise_distances(sugg_i, sugg_j)[source]
Compute pairwise distances.
- Parameters:
sugg_i (list) – Configuration values for the first set.
sugg_j (list) – Configuration values for the second set.
- Returns:
Pairwise distances between the configurations.
- Return type:
ndarray
- selector.hp_point_selection.select_point(scenario, suggested, max_evals, npoints, pool, epoch, max_epoch, features, weights, seed)[source]
Generate features and run simulation.
- Parameters:
s (selector.scenario.Scenario) – AC scenario.
suggested (list) – List of configs/points to select from.
max_eval (int) – Number of simulation runs per selected point.
npoints (int) – Number of configs/points requested.
pool (list) – List of configs/points to select from.
epoch (int) – Current epoch.
max_epoch (int) – Total number of epochs.
features (ndarray (n_suggestions, n_features)) – Features computed for each suggested configuration.
weights (ndarray (n_suggestions, n_features)) – Preset weights for the scoring function of the selection mechanism,
seed (int) – Random seed.
- Returns:
IDs of selected configs/points.
- Return type:
list
- selector.hp_point_selection.simulation(suggested, features, max_evals, selected_points, weights, npoints, distances, relatives)[source]
Run simulations of config selection.
- Parameters:
suggested (list) – List of configs/points to select from.
features (list) – Nested list, features of configs/points.
max_eval (int) – Number of simulation runs per selected point.
selected_points (list) – Indices of configurations selected so far in the simulations.
weights (ndarray) – Weights for the scoring function.
npoints (int) – Number of configurations to select
distances (ndarray) – Distance features between the configuraions.
relatives (ndarray) – Indices of relative configurations.
- Returns:
How often configs/points were selected in the simulation.
- Return type:
ndarray