active_learning.strategies

Active learning query strategies with backend dispatch for NumPy and PyTorch.

Submodules

numpy

NumPy implementations of active learning query strategies.

torch

PyTorch implementations of active learning query strategies.

Classes

BadgeEstimator

Protocol for estimators usable by BADGEQuery.

BADGEQuery

Selects a diverse uncertain batch via BADGE gradient embedding k-means++.

EntropySampling

Selects unlabeled samples with the highest prediction entropy.

Estimator

Protocol for estimators usable by query strategies.

LeastConfidentSampling

Selects unlabeled samples where the model is least confident in its top prediction.

MarginSampling

Selects unlabeled samples with the smallest margin between top-2 class probs.

QueryStrategy

Protocol for active learning query strategies.

RandomQuery

Selects unlabeled samples uniformly at random.

UncertaintyEstimator

Protocol for estimators that provide uncertainty scores.

UncertaintyQuery

Selects samples with the highest estimator-provided uncertainty scores.

Functions

badge_embed

Extract embeddings for BADGE selection.

badge_select

Select n indices via BADGE gradient embedding k-means++.

entropy_score

Compute the entropy of a distribution.

least_confident_score

Score each sample by 1 - max(prob).

margin_score

Score each sample by negative margin.

random_select

Select n unique random indices, returning the backend's native index type.

topk_select

Select n indices with the highest scores.