CoreSetStrategy<T, TInput, TOutput>
Models & Types · AiDotNet.ActiveLearning.Strategies.Diversity
CoreSet strategy for active learning using geometric diversity.
Implements: IDiversityStrategy<T, TInput, TOutput>
For Beginners
CoreSet is a diversity-based strategy that aims to select samples that best represent the entire dataset. It’s like choosing a small set of “core” points that cover the data space well.
How It Works
How CoreSet Works:
Distance Metrics:
When to Use:
Reference: Sener and Savarese “Active Learning for Convolutional Neural Networks: A Core-Set Approach” (ICLR 2018)
Constructors
| Constructor | Summary |
|---|---|
CoreSetStrategy() |
Initializes a new CoreSet strategy with Euclidean distance. |
CoreSetStrategy(DistanceMetric distanceMetric, ActiveLearnerConfig<T> config) |
Initializes a new CoreSet strategy with specified distance metric. |
Properties
| Property | Summary |
|---|---|
string Description { get; } |
|
string Name { get; } |
Methods
| Method | Summary |
|---|---|
Matrix<T> ComputeDistanceMatrix(IDataset<T, TInput, TOutput> dataset) |
|
T ComputeDiversity(TInput sample1, TInput sample2) |
|
Vector<T> ComputeDensityWeights(IDataset<T, TInput, TOutput> pool) |
|
Vector<T> ComputeDiversityScores(IDataset<T, TInput, TOutput> unlabeledData, IDataset<T, TInput, TOutput> labeledData) |
|
Vector<T> ComputeScores(IFullModel<T, TInput, TOutput> model, IDataset<T, TInput, TOutput> unlabeledPool) |
|
Vector<T> GetFeatureRepresentation(TInput input) |
|
int[] SelectDiverseSamples(IDataset<T, TInput, TOutput> unlabeledData, IDataset<T, TInput, TOutput> labeledData, int numSamples) |
|
int[] SelectSamples(IFullModel<T, TInput, TOutput> model, IDataset<T, TInput, TOutput> unlabeledPool, int batchSize) |
|
void InitializeLabeledFeatures(IDataset<T, TInput, TOutput> labeledData, IFullModel<T, TInput, TOutput> model) |
Sets the initial labeled features for distance computation. |
void Reset() |
|
void UpdateState(int[] newlyLabeledIndices, TOutput[] labels) |