TimeSeriesFoundationModelBase<T>

Base Classes · AiDotNet.Finance.Base

Abstract base class for time series foundation models that support multiple downstream tasks.

Inheritance: NeuralNetworkBase<T> → FinancialModelBase<T> → ForecastingModelBase<T> → TimeSeriesFoundationModelBase<T>

Implements: ITimeSeriesFoundationModel<T>

Known derived types: CCDM<T>, CSDI<T>, ChronosBolt<T>, Chronos<T>, FlowState<T>, GPT4TS<T>, Kairos<T>, Kronos<T>, LLMTime<T>, MGTSD<T>, MOIRAI<T>, MOMENT<T>, SimMTM<T>, Sundial<T>, TEST<T>, TFC<T>, TOTEM<T>, TOTO<T>, TS2Vec<T>, TSDiff<T>, TimeBridge<T>, TimeDiff<T>, TimeGrad<T>, TimeMAE<T>, TimeMoE<T>, Timer<T>, TimesFM<T>, TinyTimeMixers<T>, VisionTS<T>, YingLong<T>

For Beginners

This is the foundation that all time series foundation models build upon. It provides:

  • Common infrastructure for both ONNX and native mode operation
  • Default “not supported” implementations for optional tasks
  • A ValidateTaskSupported helper to check task compatibility
  • Standard properties for model size, parameter count, and context limits

Models that support only forecasting (like TimesFM) can inherit this class and only override the forecasting-related methods. Multi-task models (like MOMENT) override the additional task methods they support.

How It Works

This base class extends ForecastingModelBase with multi-task capabilities defined by ITimeSeriesFoundationModel. It provides default implementations that throw NotSupportedException for optional tasks, allowing single-task models (e.g., forecasting-only) to inherit without implementing every method.

Properties

Property Summary
FoundationModelSize ModelSize { get; }
IReadOnlyList<TimeSeriesFoundationModelTask> SupportedTasks { get; }
TimeSeriesFoundationModelTask CurrentTask { get; }
int MaxContextLength { get; }
int MaxPredictionHorizon { get; }

Methods

Method Summary
Tensor<T> Classify(Tensor<T> series, int numClasses)
Tensor<T> DetectAnomalies(Tensor<T> series, double? threshold)
Tensor<T> Embed(Tensor<T> series)
Tensor<T> Impute(Tensor<T> series, Tensor<T> mask)