Table of Contents

Interface IEpisodicDataset<T, TInput, TOutput>

Namespace
AiDotNet.MetaLearning.Data
Assembly
AiDotNet.dll
public interface IEpisodicDataset<T, TInput, TOutput>

Type Parameters

T
TInput
TOutput

Properties

ClassCounts

Gets the number of examples per class in the dataset.

Dictionary<int, int> ClassCounts { get; }

Property Value

Dictionary<int, int>

A dictionary mapping class indices to their example counts.

NumClasses

Gets the total number of classes available in the dataset.

int NumClasses { get; }

Property Value

int

The total number of classes.

Split

Gets the split type of this dataset (train, validation, or test).

DatasetSplit Split { get; }

Property Value

DatasetSplit

The split type.

Methods

SampleTasks(int, int, int, int)

Samples a batch of N-way K-shot tasks from the dataset.

IMetaLearningTask<T, TInput, TOutput>[] SampleTasks(int numTasks, int numWays, int numShots, int numQueryPerClass)

Parameters

numTasks int

The number of tasks to sample.

numWays int

The number of classes per task (N in N-way K-shot).

numShots int

The number of support examples per class (K in N-way K-shot).

numQueryPerClass int

The number of query examples per class.

Returns

IMetaLearningTask<T, TInput, TOutput>[]

An array of sampled tasks.

Remarks

For Beginners: This method creates multiple learning tasks from your dataset. Each task will have N classes, K examples per class for training (support set), and additional examples for testing (query set).

SetRandomSeed(int)

Sets the random seed for reproducible task sampling.

void SetRandomSeed(int seed)

Parameters

seed int

The random seed value.