Table of Contents

Interface IEpisodicDataset<T, TInput, TOutput>

Namespace
AiDotNet.Interfaces
Assembly
AiDotNet.dll

Interface for episodic datasets used in meta-learning.

public interface IEpisodicDataset<T, TInput, TOutput>

Type Parameters

T

The numeric data type used for calculations (e.g., float, double).

TInput

The input data type (e.g., Matrix<T>, Tensor<T>, double[]).

TOutput

The output data type (e.g., Vector<T>, Tensor<T>, double[]).

Properties

ClassesPerEpisode

Gets the number of classes per episode (N-way).

int ClassesPerEpisode { get; }

Property Value

int

EpisodeCount

Gets the total number of episodes in the dataset.

int EpisodeCount { get; }

Property Value

int

ExamplesPerClass

Gets the number of examples per class (K-shot).

int ExamplesPerClass { get; }

Property Value

int

HasMoreEpisodes

Gets whether the dataset has more episodes.

bool HasMoreEpisodes { get; }

Property Value

bool

QueryExamplesPerClass

Gets the number of query examples per class.

int QueryExamplesPerClass { get; }

Property Value

int

Methods

GetEpisode(int)

Gets a specific episode from the dataset.

IMetaLearningTask<T, TInput, TOutput> GetEpisode(int episodeIndex)

Parameters

episodeIndex int

The index of the episode to retrieve.

Returns

IMetaLearningTask<T, TInput, TOutput>

The episode containing support and query sets.

GetEpisodeBatch(int, bool)

Gets a batch of episodes from the dataset.

List<IMetaLearningTask<T, TInput, TOutput>> GetEpisodeBatch(int batchSize, bool shuffle = true)

Parameters

batchSize int

The number of episodes to include in the batch.

shuffle bool

Whether to shuffle the episodes before sampling.

Returns

List<IMetaLearningTask<T, TInput, TOutput>>

A batch of episodes.

Reset()

Resets the dataset to the beginning.

void Reset()

SampleTasks(int, int?)

Samples a batch of tasks from the dataset.

List<IMetaLearningTask<T, TInput, TOutput>> SampleTasks(int numTasks, int? episodeIndex = null)

Parameters

numTasks int

The number of tasks to sample.

episodeIndex int?

The starting episode index (optional).

Returns

List<IMetaLearningTask<T, TInput, TOutput>>

A list of sampled tasks.

SetRandomSeed(int)

Sets the random seed for reproducible sampling.

void SetRandomSeed(int seed)

Parameters

seed int

The random seed to use.

Shuffle()

Shuffles the dataset.

void Shuffle()