DataLoaderBase<T>

Base Classes · AiDotNet.Data.Loaders

Abstract base class providing common functionality for all data loaders.

Implements: IDataLoader<T>

Known derived types: EpisodicDataLoaderBase<T, TInput, TOutput>, GraphDataLoaderBase<T>, InputOutputDataLoaderBase<T, TInput, TOutput>, M4DatasetLoader<T>, RLDataLoaderBase<T>, StatefulDataLoader<T, TInput, TOutput>, StreamingDataLoaderBase<T, TInput, TOutput>, TextLineDataset<T>, TransformedDataLoader<T>

For Beginners

This class handles the “boring but important” stuff that all data loaders need to do: tracking where you are in the data, resetting to start over, and making sure data is loaded before you try to use it.

When you create a custom data loader, you extend one of the domain-specific base classes (like GraphDataLoaderBase) which in turn extends this class, so you get all this functionality for free.

How It Works

DataLoaderBase implements shared functionality for all data loaders including:

  • State management (loaded/unloaded)
  • Iteration tracking (current index, progress)
  • Reset functionality
  • Thread-safe operations where needed

Domain-specific base classes (GraphDataLoaderBase, InputOutputDataLoaderBase) extend this class with specialized functionality.

Properties

Property Summary
bool IsLoaded { get; set; }
double Progress { get; }
int BatchCount { get; }
int BatchSize { get; set; } Gets or sets the batch size for iteration.
int CurrentBatchIndex { get; set; }
int CurrentIndex { get; set; }
int TotalCount { get; }
string Description { get; }
string Name { get; }

Methods

Method Summary
Task LoadAsync(CancellationToken cancellationToken)
void Reset()
void Unload()