Utils
neps.optimizers.multi_fidelity_prior.utils
#
compute_config_dist
#
compute_config_dist(
config1: SearchSpace, config2: SearchSpace
) -> float
Computes distance between two configurations.
Divides the search space into continuous and categorical subspaces. Normalizes all the continuous values while gives numerical encoding to categories. Distance returned is the sum of the Euclidean distance of the continous subspace and the Hamming distance of the categorical subspace.
Source code in neps/optimizers/multi_fidelity_prior/utils.py
compute_scores
#
compute_scores(
config: SearchSpace,
prior: SearchSpace,
inc: SearchSpace,
) -> Union[float, float]
Scores the config by a Gaussian around the prior and the incumbent.
Source code in neps/optimizers/multi_fidelity_prior/utils.py
custom_crossover
#
custom_crossover(
config1: SearchSpace,
config2: SearchSpace,
crossover_prob: float = 0.5,
patience: int = 50,
) -> SearchSpace
Performs a crossover of config2 into config1.
Returns a configuration where each HP in config1 has crossover_prob
% chance of
getting config2's value of the corresponding HP. By default, crossover rate is 50%.
Source code in neps/optimizers/multi_fidelity_prior/utils.py
get_prior_weight_for_decay
#
Creates a step function schedule for the prior weight decay.
The prior weight ratio is decayed every time the total resources used is equivalent to the cost of one successive halving bracket within the HB schedule. This is approximately eta imes max_budget resources for one evaluation.
Source code in neps/optimizers/multi_fidelity_prior/utils.py
local_mutation
#
local_mutation(
config: SearchSpace,
std: float = 0.25,
mutation_rate: float = 0.5,
patience: int = 50,
) -> SearchSpace
Performs a local search by mutating randomly chosen hyperparameters.