ModelPredictiveTaskSampler<T, TInput, TOutput>

Models & Types · AiDotNet.MetaLearning.Data

Model Predictive Task Sampling (MPTS): predicts which tasks will yield the greatest learning signal by maintaining a posterior estimate of per-task adaptation risk, then sampling tasks that balance exploration and exploitation.

Implements: ITaskSampler<T, TInput, TOutput>

For Beginners

Instead of sampling tasks randomly, MPTS tries to predict which tasks will help the model learn the most. It keeps track of how much the model improved on each task and favors tasks where improvement is likely highest.

How It Works

Reference: Model Predictive Task Sampling (2025).

Constructors

Constructor Summary
ModelPredictiveTaskSampler(IMetaDataset<T, TInput, TOutput> dataset, int numWays, int numShots, int numQueryPerClass, double explorationWeight, double ucbScale, int? seed) Creates a model-predictive task sampler.

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)