Optimizer¶
The Optimizer class orchestrates the active learning loop by coordinating the acquisition
function and search strategy. It selects the most promising candidates for evaluation by first
obtaining a candidate pool from the search strategy, then scoring candidates using the acquisition
function, and finally selecting the top-k candidates for oracle evaluation.
- class alf_core.optimizer.optimizer.Optimizer(acquisition_fn, search_fn)[source]¶
Bases:
objectImplements the ask/tell interface for active learning.
Coordinates search and acquisition functions to propose candidates and update the surrogate model iteratively.
- ask(state)[source]¶
Propose the next batch of candidates to evaluate.
Uses the search function to generate a candidate pool, then the acquisition function to score and select the top candidates. In the first round, uses the training dataset if available.
- get_metrics(state)[source]¶
Collect metrics from acquired candidates, surrogate, and search functions.
- Parameters:
state (
State) – Current task state.- Returns:
Metrics on acquired candidates (mean, max, min)
Surrogate training metrics (if available)
Search function metrics
- Return type:
dict[str,float]