Table of Contents

Class DatasetExtensions

Namespace
AiDotNet.ContinualLearning.Memory
Assembly
AiDotNet.dll

Extension methods for IDataset to convert to DataPoints.

public static class DatasetExtensions
Inheritance
DatasetExtensions
Inherited Members

Methods

GetAllDataPoints<T, TInput, TOutput>(IDataset<T, TInput, TOutput>, int)

Converts a dataset to an enumerable of DataPoint objects.

public static IEnumerable<DataPoint<T, TInput, TOutput>> GetAllDataPoints<T, TInput, TOutput>(this IDataset<T, TInput, TOutput> dataset, int taskId = 0)

Parameters

dataset IDataset<T, TInput, TOutput>

The dataset to convert.

taskId int

Optional task ID to assign to all data points (default: 0).

Returns

IEnumerable<DataPoint<T, TInput, TOutput>>

Enumerable of DataPoint objects containing inputs, outputs, and task IDs.

Type Parameters

T
TInput
TOutput

Remarks

For Beginners: This converts a dataset into individual data points that can be stored in the experience replay buffer. Each data point includes the task ID so we can track which task each example came from.

GetDataPointsAt<T, TInput, TOutput>(IDataset<T, TInput, TOutput>, IEnumerable<int>, int)

Gets a subset of data points from the dataset.

public static IEnumerable<DataPoint<T, TInput, TOutput>> GetDataPointsAt<T, TInput, TOutput>(this IDataset<T, TInput, TOutput> dataset, IEnumerable<int> indices, int taskId = 0)

Parameters

dataset IDataset<T, TInput, TOutput>

The dataset to sample from.

indices IEnumerable<int>

The indices to retrieve.

taskId int

Optional task ID to assign (default: 0).

Returns

IEnumerable<DataPoint<T, TInput, TOutput>>

Enumerable of DataPoint objects at the specified indices.

Type Parameters

T
TInput
TOutput