DynamicTaskSampler<T, TInput, TOutput>

Models & Types · AiDotNet.MetaLearning.Data

Samples tasks with probability proportional to the loss observed on previous evaluations. Tasks with higher loss are sampled more frequently, focusing training on areas the model finds most difficult (inspired by hard-example mining and curriculum learning research).

Implements: ITaskSampler<T, TInput, TOutput>

Constructors

Constructor Summary
DynamicTaskSampler(IMetaDataset<T, TInput, TOutput> dataset, int numWays, int numShots, int numQueryPerClass, double explorationRate, int? seed) Creates a dynamic task sampler that adapts based on observed losses.

Properties

Property Summary
int NumQueryPerClass { get; }
int NumShots { get; }
int NumWays { get; }

Methods

Method Summary
IEpisode<T, TInput, TOutput> SampleOne()
TaskBatch<T, TInput, TOutput> SampleBatch(int batchSize)
void SetSeed(int seed)
void UpdateWithFeedback(IReadOnlyList<IEpisode<T, TInput, TOutput>> episodes, IReadOnlyList<double> losses)