GradientBatchStrategy<T, TInput, TOutput>

Models & Types · AiDotNet.ActiveLearning.Batch

Gradient-based batch selection strategy using gradient embeddings (BADGE-style).

Implements: IGradientBatchStrategy<T, TInput, TOutput>

For Beginners

BADGE (Batch Active learning by Diverse Gradient Embeddings) is a state-of-the-art method that combines uncertainty and diversity. It uses gradient embeddings - vectors derived from the model’s gradients - to represent samples.

How It Works

How It Works:

Why Gradient Embeddings?

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

Constructors

Constructor Summary
GradientBatchStrategy() Initializes a new GradientBatchStrategy with default settings.
GradientBatchStrategy(bool useHypotheticalGradients) Initializes a new GradientBatchStrategy with specified parameters.

Properties

Property Summary
T DiversityTradeoff { get; set; }
string Name { get; }

Methods

Method Summary
Matrix<T> ComputeGradientEmbeddings(IFullModel<T, TInput, TOutput> model, IDataset<T, TInput, TOutput> samples)
T ComputeDiversity(TInput sample1, TInput sample2)
int[] KMeansPlusPlusSelection(Matrix<T> embeddings, int batchSize)
int[] SelectBatch(int[] candidateIndices, Vector<T> scores, IDataset<T, TInput, TOutput> unlabeledPool, int batchSize)