Priorband
neps.optimizers.multi_fidelity_prior.priorband
#
PriorBand
#
PriorBand(
pipeline_space: SearchSpace,
budget: int,
eta: int = 3,
initial_design_type: Literal[
"max_budget", "unique_configs"
] = "max_budget",
sampling_policy: Any = EnsemblePolicy,
promotion_policy: Any = SyncPromotionPolicy,
loss_value_on_error: None | float = None,
cost_value_on_error: None | float = None,
ignore_errors: bool = False,
logger=None,
prior_confidence: Literal[
"low", "medium", "high"
] = "medium",
random_interleave_prob: float = 0.0,
sample_default_first: bool = True,
sample_default_at_target: bool = True,
prior_weight_type: str = "geometric",
inc_sample_type: str = "mutation",
inc_mutation_rate: float = 0.5,
inc_mutation_std: float = 0.25,
inc_style: str = "dynamic",
model_based: bool = False,
modelling_type: str = "joint",
initial_design_size: int = None,
model_policy: Any = ModelPolicy,
surrogate_model: str | Any = "gp",
domain_se_kernel: str = None,
hp_kernels: list = None,
surrogate_model_args: dict = None,
acquisition: str | BaseAcquisition = "EI",
log_prior_weighted: bool = False,
acquisition_sampler: (
str | AcquisitionSampler
) = "random",
)
Bases: MFBOBase
, HyperbandCustomDefault
, PriorBandBase
Source code in neps/optimizers/multi_fidelity_prior/priorband.py
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 |
|
calc_sampling_args
#
calc_sampling_args(rung) -> dict
Sets the weights for each of the sampling techniques.
Source code in neps/optimizers/multi_fidelity_prior/priorband.py
clear_old_brackets
#
Enforces reset at each new bracket.
The _get_rungs_state() function creates the rung_promotions
dict mapping which
is used by the promotion policies to determine the next step: promotion/sample.
To simulate reset of rungs like in vanilla HB, the algorithm is viewed as a
series of SH brackets, where the SH brackets comprising HB is repeated. This is
done by iterating over the closed loop of possible SH brackets (self.sh_brackets).
The oldest, active, incomplete SH bracket is searched for to choose the next
evaluation. If either all brackets are over or waiting, a new SH bracket,
corresponding to the SH bracket under HB as registered by current_SH_bracket
.
Source code in neps/optimizers/multi_fidelity/hyperband.py
find_1nn_distance_from_incumbent
#
Finds the distance to the nearest neighbour.
find_all_distances_from_incumbent
#
Finds the distance to the nearest neighbour.
Source code in neps/optimizers/multi_fidelity_prior/priorband.py
find_incumbent
#
find_incumbent(rung: int = None) -> SearchSpace
Find the best performing configuration seen so far.
Source code in neps/optimizers/multi_fidelity_prior/priorband.py
get_config_and_ids
#
get_config_and_ids() -> tuple[SearchSpace, str, str | None]
...and this is the method that decides which point to query.
RETURNS | DESCRIPTION |
---|---|
tuple[SearchSpace, str, str | None]
|
|
Source code in neps/optimizers/multi_fidelity_prior/priorband.py
get_cost
#
Calls result.utils.get_cost() and passes the error handling through. Please use self.get_cost() instead of get_cost() in all optimizer classes.
Source code in neps/optimizers/base_optimizer.py
get_learning_curve
#
Calls result.utils.get_loss() and passes the error handling through. Please use self.get_loss() instead of get_loss() in all optimizer classes.
Source code in neps/optimizers/base_optimizer.py
get_loss
#
Calls result.utils.get_loss() and passes the error handling through. Please use self.get_loss() instead of get_loss() in all optimizer classes.
Source code in neps/optimizers/base_optimizer.py
is_activate_inc
#
is_activate_inc() -> bool
Function to check optimization state to allow/disallow incumbent sampling.
This function checks if the total resources used for the finished evaluations sums to the budget of one full SH bracket.
Source code in neps/optimizers/multi_fidelity_prior/priorband.py
is_init_phase
#
is_init_phase() -> bool
Returns True is in the warmstart phase and False under model-based search.
Source code in neps/optimizers/multi_fidelity/mf_bo.py
is_promotable
#
is_promotable() -> int | None
Returns an int if a rung can be promoted, else a None.
Source code in neps/optimizers/multi_fidelity/successive_halving.py
prior_to_incumbent_ratio
#
Calculates the normalized weight distribution between prior and incumbent.
Sum of the weights should be 1.
Source code in neps/optimizers/multi_fidelity_prior/priorband.py
sample_new_config
#
sample_new_config(rung: int = None, **kwargs)
Samples configuration from policies or random.
Source code in neps/optimizers/multi_fidelity/mf_bo.py
PriorBandBase
#
Class that defines essential properties needed by PriorBand.
Designed to work with the topmost parent class as SuccessiveHalvingBase.
calc_sampling_args
#
calc_sampling_args(rung) -> dict
Sets the weights for each of the sampling techniques.
Source code in neps/optimizers/multi_fidelity_prior/priorband.py
find_1nn_distance_from_incumbent
#
Finds the distance to the nearest neighbour.
find_all_distances_from_incumbent
#
Finds the distance to the nearest neighbour.
Source code in neps/optimizers/multi_fidelity_prior/priorband.py
find_incumbent
#
find_incumbent(rung: int = None) -> SearchSpace
Find the best performing configuration seen so far.
Source code in neps/optimizers/multi_fidelity_prior/priorband.py
is_activate_inc
#
is_activate_inc() -> bool
Function to check optimization state to allow/disallow incumbent sampling.
This function checks if the total resources used for the finished evaluations sums to the budget of one full SH bracket.
Source code in neps/optimizers/multi_fidelity_prior/priorband.py
prior_to_incumbent_ratio
#
Calculates the normalized weight distribution between prior and incumbent.
Sum of the weights should be 1.
Source code in neps/optimizers/multi_fidelity_prior/priorband.py
PriorBandNoIncToPrior
#
PriorBandNoIncToPrior(
pipeline_space: SearchSpace,
budget: int,
eta: int = 3,
initial_design_type: Literal[
"max_budget", "unique_configs"
] = "max_budget",
sampling_policy: Any = EnsemblePolicy,
promotion_policy: Any = SyncPromotionPolicy,
loss_value_on_error: None | float = None,
cost_value_on_error: None | float = None,
ignore_errors: bool = False,
logger=None,
prior_confidence: Literal[
"low", "medium", "high"
] = "medium",
random_interleave_prob: float = 0.0,
sample_default_first: bool = True,
sample_default_at_target: bool = True,
prior_weight_type: str = "geometric",
inc_sample_type: str = "mutation",
inc_mutation_rate: float = 0.5,
inc_mutation_std: float = 0.25,
inc_style: str = "dynamic",
model_based: bool = False,
modelling_type: str = "joint",
initial_design_size: int = None,
model_policy: Any = ModelPolicy,
surrogate_model: str | Any = "gp",
domain_se_kernel: str = None,
hp_kernels: list = None,
surrogate_model_args: dict = None,
acquisition: str | BaseAcquisition = "EI",
log_prior_weighted: bool = False,
acquisition_sampler: (
str | AcquisitionSampler
) = "random",
)
Bases: PriorBand
Disables incumbent sampling to replace with prior-based sampling.
This is equivalent to running HyperBand with Prior and Random sampling, where their
relationship is controlled by the prior_weight_type
argument.
Source code in neps/optimizers/multi_fidelity_prior/priorband.py
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 |
|
calc_sampling_args
#
calc_sampling_args(rung) -> dict
Sets the weights for each of the sampling techniques.
Source code in neps/optimizers/multi_fidelity_prior/priorband.py
clear_old_brackets
#
Enforces reset at each new bracket.
The _get_rungs_state() function creates the rung_promotions
dict mapping which
is used by the promotion policies to determine the next step: promotion/sample.
To simulate reset of rungs like in vanilla HB, the algorithm is viewed as a
series of SH brackets, where the SH brackets comprising HB is repeated. This is
done by iterating over the closed loop of possible SH brackets (self.sh_brackets).
The oldest, active, incomplete SH bracket is searched for to choose the next
evaluation. If either all brackets are over or waiting, a new SH bracket,
corresponding to the SH bracket under HB as registered by current_SH_bracket
.
Source code in neps/optimizers/multi_fidelity/hyperband.py
find_1nn_distance_from_incumbent
#
Finds the distance to the nearest neighbour.
find_all_distances_from_incumbent
#
Finds the distance to the nearest neighbour.
Source code in neps/optimizers/multi_fidelity_prior/priorband.py
find_incumbent
#
find_incumbent(rung: int = None) -> SearchSpace
Find the best performing configuration seen so far.
Source code in neps/optimizers/multi_fidelity_prior/priorband.py
get_config_and_ids
#
get_config_and_ids() -> tuple[SearchSpace, str, str | None]
...and this is the method that decides which point to query.
RETURNS | DESCRIPTION |
---|---|
tuple[SearchSpace, str, str | None]
|
|
Source code in neps/optimizers/multi_fidelity_prior/priorband.py
get_cost
#
Calls result.utils.get_cost() and passes the error handling through. Please use self.get_cost() instead of get_cost() in all optimizer classes.
Source code in neps/optimizers/base_optimizer.py
get_learning_curve
#
Calls result.utils.get_loss() and passes the error handling through. Please use self.get_loss() instead of get_loss() in all optimizer classes.
Source code in neps/optimizers/base_optimizer.py
get_loss
#
Calls result.utils.get_loss() and passes the error handling through. Please use self.get_loss() instead of get_loss() in all optimizer classes.
Source code in neps/optimizers/base_optimizer.py
is_activate_inc
#
is_activate_inc() -> bool
Function to check optimization state to allow/disallow incumbent sampling.
This function checks if the total resources used for the finished evaluations sums to the budget of one full SH bracket.
Source code in neps/optimizers/multi_fidelity_prior/priorband.py
is_init_phase
#
is_init_phase() -> bool
Returns True is in the warmstart phase and False under model-based search.
Source code in neps/optimizers/multi_fidelity/mf_bo.py
is_promotable
#
is_promotable() -> int | None
Returns an int if a rung can be promoted, else a None.
Source code in neps/optimizers/multi_fidelity/successive_halving.py
prior_to_incumbent_ratio
#
Calculates the normalized weight distribution between prior and incumbent.
Sum of the weights should be 1.
Source code in neps/optimizers/multi_fidelity_prior/priorband.py
sample_new_config
#
sample_new_config(rung: int = None, **kwargs)
Samples configuration from policies or random.
Source code in neps/optimizers/multi_fidelity/mf_bo.py
PriorBandNoPriorToInc
#
Bases: PriorBand
Disables prior based sampling to replace with incumbent-based sampling.
Source code in neps/optimizers/multi_fidelity_prior/priorband.py
calc_sampling_args
#
calc_sampling_args(rung) -> dict
Sets the weights for each of the sampling techniques.
Source code in neps/optimizers/multi_fidelity_prior/priorband.py
clear_old_brackets
#
Enforces reset at each new bracket.
The _get_rungs_state() function creates the rung_promotions
dict mapping which
is used by the promotion policies to determine the next step: promotion/sample.
To simulate reset of rungs like in vanilla HB, the algorithm is viewed as a
series of SH brackets, where the SH brackets comprising HB is repeated. This is
done by iterating over the closed loop of possible SH brackets (self.sh_brackets).
The oldest, active, incomplete SH bracket is searched for to choose the next
evaluation. If either all brackets are over or waiting, a new SH bracket,
corresponding to the SH bracket under HB as registered by current_SH_bracket
.
Source code in neps/optimizers/multi_fidelity/hyperband.py
find_1nn_distance_from_incumbent
#
Finds the distance to the nearest neighbour.
find_all_distances_from_incumbent
#
Finds the distance to the nearest neighbour.
Source code in neps/optimizers/multi_fidelity_prior/priorband.py
find_incumbent
#
find_incumbent(rung: int = None) -> SearchSpace
Find the best performing configuration seen so far.
Source code in neps/optimizers/multi_fidelity_prior/priorband.py
get_config_and_ids
#
get_config_and_ids() -> tuple[SearchSpace, str, str | None]
...and this is the method that decides which point to query.
RETURNS | DESCRIPTION |
---|---|
tuple[SearchSpace, str, str | None]
|
|
Source code in neps/optimizers/multi_fidelity_prior/priorband.py
get_cost
#
Calls result.utils.get_cost() and passes the error handling through. Please use self.get_cost() instead of get_cost() in all optimizer classes.
Source code in neps/optimizers/base_optimizer.py
get_learning_curve
#
Calls result.utils.get_loss() and passes the error handling through. Please use self.get_loss() instead of get_loss() in all optimizer classes.
Source code in neps/optimizers/base_optimizer.py
get_loss
#
Calls result.utils.get_loss() and passes the error handling through. Please use self.get_loss() instead of get_loss() in all optimizer classes.
Source code in neps/optimizers/base_optimizer.py
is_activate_inc
#
is_activate_inc() -> bool
Function to check optimization state to allow/disallow incumbent sampling.
This function checks if the total resources used for the finished evaluations sums to the budget of one full SH bracket.
Source code in neps/optimizers/multi_fidelity_prior/priorband.py
is_init_phase
#
is_init_phase() -> bool
Returns True is in the warmstart phase and False under model-based search.
Source code in neps/optimizers/multi_fidelity/mf_bo.py
is_promotable
#
is_promotable() -> int | None
Returns an int if a rung can be promoted, else a None.
Source code in neps/optimizers/multi_fidelity/successive_halving.py
prior_to_incumbent_ratio
#
Calculates the normalized weight distribution between prior and incumbent.
Sum of the weights should be 1.
Source code in neps/optimizers/multi_fidelity_prior/priorband.py
sample_new_config
#
sample_new_config(rung: int = None, **kwargs)
Samples configuration from policies or random.