panobbgo.strategies.ucb.StrategyUCB#

class panobbgo.strategies.ucb.StrategyUCB(problem, ucb_c: float = 1.414, **kwargs)[source]#

This strategy uses the Upper Confidence Bound (UCB1) algorithm to select heuristics. It balances exploration (trying less used heuristics) and exploitation (using heuristics that have performed well).

The Multi-Armed Bandit formulation here is: - Arms: Heuristics - Pull: Generating points from a heuristic - Reward: 0 if point doesn’t improve best; >0 if it improves best.

Reward calculation: R(x) = 1 - e^{-(improvement)}.

  • Value Q_t(a): Average reward per point generated.

@type problem: panobbgo.lib.Problem @param problem: @param parse_args: @param testing_mode: @param kwargs: Additional configuration parameters (e.g. max_eval, max_evaluations)

__init__(problem, ucb_c: float = 1.414, **kwargs)[source]#

@type problem: panobbgo.lib.Problem @param problem: @param parse_args: @param testing_mode: @param kwargs: Additional configuration parameters (e.g. max_eval, max_evaluations)

Methods

__init__(problem[, ucb_c])

@type problem: panobbgo.lib.Problem @param problem: @param parse_args: @param testing_mode: @param kwargs: Additional configuration parameters (e.g. max_eval, max_evaluations).

add(Heur, **kwargs)

add_analyzer(a)

Add an analyzer to the strategy.

add_heuristic(h)

Add a heuristic to the strategy.

analyzer(who)

check_dependencies()

This method is called in self.start() (and only there) for checking all the dependencies of all modules.

execute()

Overwrite this method when you extend this base strategy.

heuristic(who)

Look up a heuristic by its who tag.

info()

init_module(module)

StrategyBase calls this method.

on_converged(reason, stats)

Called when the Convergence analyzer detects convergence.

on_new_best(best)

Called when a new best solution is found.

reward(best)

Calculate reward for a heuristic based on the improvement.

start()

validate_setup()

Validate that the framework is properly set up before starting optimization.

Attributes

PROBLEM_KEY

analyzers

avg_time_per_task

average walltime per finished task, NaN before the first one.

best

evaluators

Compatibility property for legacy code that references evaluators.

heuristics

name

time_cpu

effective cpu time in seconds

time_start_str

time_wall

wall time in seconds