BADGEStrategy<T, TInput, TOutput>

Models & Types · AiDotNet.ActiveLearning.Strategies.Hybrid

BADGE (Batch Active learning by Diverse Gradient Embeddings) strategy.

Implements: IQueryStrategy<T, TInput, TOutput>

For Beginners

BADGE is a state-of-the-art strategy that combines uncertainty and diversity. It uses gradient embeddings (gradients of the loss with respect to the final layer) to represent samples, then uses k-means++ to select diverse samples.

How It Works

How BADGE Works:

Key Insight: Gradient embeddings naturally combine model uncertainty (large gradients for uncertain samples) with feature diversity (different gradient directions for different samples).

When to Use:

Reference: Ash et al. “Deep Batch Active Learning by Diverse, Uncertain Gradient Lower Bounds” (ICLR 2020)

Constructors

Constructor Summary
BADGEStrategy(int numClasses) Initializes a new BADGE strategy.
BADGEStrategy(int numClasses, ActiveLearnerConfig<T> config) Initializes a new BADGE strategy with configuration.

Properties

Property Summary
string Description { get; }
string Name { get; }

Methods

Method Summary
Vector<T> ComputeScores(IFullModel<T, TInput, TOutput> model, IDataset<T, TInput, TOutput> unlabeledPool)
int[] SelectSamples(IFullModel<T, TInput, TOutput> model, IDataset<T, TInput, TOutput> unlabeledPool, int batchSize)
void Reset()
void UpdateState(int[] newlyLabeledIndices, TOutput[] labels)