Interface IMemoryBasedStrategy<T, TInput, TOutput>
- Namespace
- AiDotNet.ContinualLearning.Interfaces
- Assembly
- AiDotNet.dll
Extended strategy interface for strategies that store task examples.
public interface IMemoryBasedStrategy<T, TInput, TOutput> : IContinualLearningStrategy<T, TInput, TOutput>
Type Parameters
TThe numeric type used for calculations.
TInputThe input data type.
TOutputThe output data type.
- Inherited Members
Properties
MaxExamples
Gets the maximum number of examples that can be stored.
int MaxExamples { get; }
Property Value
StoredExampleCount
Gets the number of examples stored in memory.
int StoredExampleCount { get; }
Property Value
Methods
ClearMemory()
Clears all stored examples.
void ClearMemory()
SampleExamples(int)
Samples a batch of stored examples for replay.
IReadOnlyList<(TInput Input, TOutput Output, int TaskId)> SampleExamples(int batchSize)
Parameters
batchSizeintNumber of examples to sample.
Returns
- IReadOnlyList<(TInput Input, TOutput Output, int TaskId)>
List of input-output pairs.
StoreTaskExamples(IDataset<T, TInput, TOutput>)
Stores examples from a completed task.
void StoreTaskExamples(IDataset<T, TInput, TOutput> taskData)
Parameters
taskDataIDataset<T, TInput, TOutput>The task data to sample from.