MetaDatasetFormat<T, TInput, TOutput>

Models & Types · AiDotNet.MetaLearning.Data

Supports the Meta-Dataset benchmark format (Triantafillou et al., 2020): a multi-domain evaluation protocol with variable-way variable-shot task sampling. Wraps multiple IMetaDataset instances and samples episodes from a randomly chosen domain, or from a specific domain on request.

Implements: IMetaDataset<T, TInput, TOutput>

For Beginners

The Meta-Dataset benchmark tests how well a model generalizes across multiple very different domains (e.g., birds, textures, aircraft, fungi). This class lets you combine several datasets and sample tasks from any of them.

How It Works

Reference: Meta-Dataset: A Dataset of Datasets for Learning to Learn from Few Examples (Triantafillou et al., ICLR 2020).

Constructors

Constructor Summary
MetaDatasetFormat(IReadOnlyList<IMetaDataset<T, TInput, TOutput>> domains, IReadOnlyList<string> domainNames, int? seed) Creates a multi-domain meta-dataset from multiple individual datasets.

Properties

Property Summary
IReadOnlyDictionary<int, int> ClassExampleCounts { get; }
IReadOnlyList<string> DomainNames { get; } Gets the domain names.
int DomainCount { get; } Gets the number of domains in this multi-domain dataset.
int TotalClasses { get; }
int TotalExamples { get; }
string Name { get; }

Methods

Method Summary
IEpisode<T, TInput, TOutput> SampleEpisode(int numWays, int numShots, int numQueryPerClass)
IEpisode<T, TInput, TOutput> SampleFromDomain(int domainIndex, int numWays, int numShots, int numQueryPerClass) Samples an episode from a specific domain by index.
IReadOnlyList<IEpisode<T, TInput, TOutput>> SampleEpisodes(int count, int numWays, int numShots, int numQueryPerClass)
bool SupportsConfiguration(int numWays, int numShots, int numQueryPerClass)
void SetSeed(int seed)