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
TThe numeric data type used for calculations (e.g., float, double).
TInputThe input data type (e.g., Matrix<T>, Tensor<T>, double[]).
TOutputThe 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
EpisodeCount
Gets the total number of episodes in the dataset.
int EpisodeCount { get; }
Property Value
ExamplesPerClass
Gets the number of examples per class (K-shot).
int ExamplesPerClass { get; }
Property Value
HasMoreEpisodes
Gets whether the dataset has more episodes.
bool HasMoreEpisodes { get; }
Property Value
QueryExamplesPerClass
Gets the number of query examples per class.
int QueryExamplesPerClass { get; }
Property Value
Methods
GetEpisode(int)
Gets a specific episode from the dataset.
IMetaLearningTask<T, TInput, TOutput> GetEpisode(int episodeIndex)
Parameters
episodeIndexintThe 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
batchSizeintThe number of episodes to include in the batch.
shuffleboolWhether 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
numTasksintThe number of tasks to sample.
episodeIndexint?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
seedintThe random seed to use.
Shuffle()
Shuffles the dataset.
void Shuffle()