Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
ALF documentation
ALF documentation

Documentation

  • Explanation
    • Why ALF?
    • Intro to Active Learning
    • Core Concepts
  • Tutorials
  • How-to / Recipes
    • Add your own model
    • Add a dataset
    • Add an acquisition function
    • Add a search function
    • Switch offline to online
    • Run with Docker
  • Reference
    • Glossary
  • ALF Installation Guide

API Reference

  • Core
    • Dataclasses
      • Candidate
      • Labelled Candidates
      • Predictions
      • Results
      • Round Metrics
      • State
      • Surrogate Epoch Metrics
    • Dataset
      • Base Dataset
      • Splitting Utils
    • Model
      • Base Model
      • Normalisers
    • Optimizer
      • Optimizer
      • Acquisition Function
      • Search
    • Oracle
    • Surrogate
    • Tasks
      • Base Task
      • Design Task
      • Supervised Task
      • Zero-Shot Task
    • Utils
      • Enums
      • Metrics
        • Acquisition Batch
        • Base
        • Calibration
        • Classification
        • Design Task Metrics
        • Regression
      • State Logger
  • Tools
    • Datasets
      • GFP Dataset
      • ProteinGym Dataset
      • FLIP Dataset
      • GuacaMol Dataset
    • Models
      • CNN Model
      • MLP Model
      • ESMFold Model
      • GP Model
      • ESM2 Model
      • Chemprop Model
      • MLIP Model
      • PyRosetta Model
      • Ensemble Wrapper
      • Utilities
    • Optimizer
      • Acquisition Functions
        • BoTorch Acquisition Wrapper
        • BoTorch MC Samplers
        • CoreSet
        • Expected Improvement
        • Greedy
        • Thompson Sampling
        • Upper Confidence Bound (UCB)
      • Search Strategies
        • Botorch Continuous Search
        • Single Mutant Search
    • Utils
      • Constants
Back to top
View this page

Search¶

The BaseSearch class defines the interface for search strategies that generate candidate pools for evaluation. Search strategies can operate on predefined datasets (DatasetSearch), generate new candidates using models (GeneratorSearch), or apply mutations to existing sequences (SingleMutantSearch).

class alf_core.optimizer.search.BaseSearch[source]¶

Bases: ABC

Base class for all types of search methods.

Search methods provide a way of searching the design space in order to propose new candidates not yet observed in the training dataset. This can be achieved in multiple ways depending on the search protocol, or availability of ground truth labels.

get_metrics(state)[source]¶

Get metrics for the search function.

Parameters:

state (State) – Current task state.

Return type:

dict[str, float]

Returns:

Dictionary of metric names to values. Returns empty dict by default; subclasses should override.

class alf_core.optimizer.search.DatasetSearch[source]¶

Bases: BaseSearch

Offline search method based on a dataset defining the search pool.

get_metrics(state)[source]¶

Return recall and regret metrics for the dataset search method.

Both metrics compare the initial candidate pool against the candidates acquired during the loop. The acquired-only set is reconstructed from state.history so the initial labelled seed (which is not part of the candidate pool) does not enter the comparison.

Parameters:

state (State) – Current task state.

Return type:

dict[str, float]

Returns:

Dictionary containing recall and regret metrics comparing the initial candidate pool to the acquired candidates. The metrics are omitted until at least one candidate has been acquired.

class alf_core.optimizer.search.GeneratorSearch(model)[source]¶

Bases: BaseSearch

Search method based on a model generating samples.

class alf_core.optimizer.search.ModelProtocolSearch(model, protocol)[source]¶

Bases: BaseSearch

Search method based on a model and a protocol to define the search pool.

class alf_core.optimizer.search.ProtocolSearch(protocol)[source]¶

Bases: BaseSearch

Search method based on a function/procedure to define the search pool.

class alf_core.optimizer.search.SearchProtocol[source]¶

Bases: object

Search protocol is used to define the search process.

Next
Oracle
Previous
Acquisition Function
Copyright © 2026, InstaDeep
Made with Sphinx and @pradyunsg's Furo
On this page
  • Search
    • BaseSearch
      • BaseSearch.get_metrics
    • DatasetSearch
      • DatasetSearch.get_metrics
    • GeneratorSearch
    • ModelProtocolSearch
    • ProtocolSearch
    • SearchProtocol