BALD<T>
Models & Types · AiDotNet.ActiveLearning
Implements Bayesian Active Learning by Disagreement (BALD) for sample selection.
Implements: IActiveLearningStrategy<T>
For Beginners
BALD uses information theory to select samples that maximize the mutual information between model predictions and model parameters. In practice, this means selecting samples where different “versions” of the model disagree the most.
How It Works
Formula: I(y; θ|x, D) = H(y|x, D) - E_θ[H(y|x, θ)]
where H is entropy, y is the label, θ are model parameters, x is input, D is training data.
Interpretation:
Implementation: Uses MC Dropout to approximate Bayesian inference by running multiple forward passes with dropout enabled during inference.
Reference: Houlsby, N. et al. (2011). “Bayesian Active Learning for Classification and Preference Learning.”
Constructors
| Constructor | Summary |
|---|---|
BALD(int numMcSamples, double dropoutRate) |
Initializes a new instance of the BALD class. |
Properties
| Property | Summary |
|---|---|
bool UseBatchDiversity { get; set; } |
|
string Name { get; } |
Methods
| Method | Summary |
|---|---|
Dictionary<string, T> GetSelectionStatistics() |
|
Vector<T> ComputeInformativenessScores(IFullModel<T, Tensor<T>, Tensor<T>> model, Tensor<T> unlabeledPool) |
|
int[] SelectSamples(IFullModel<T, Tensor<T>, Tensor<T>> model, Tensor<T> unlabeledPool, int batchSize) |