Table of Contents

Class InformerModel<T>

Namespace
AiDotNet.TimeSeries
Assembly
AiDotNet.dll

Implements the Informer model for efficient long-sequence time series forecasting.

public class InformerModel<T> : TimeSeriesModelBase<T>, ITimeSeriesModel<T>, IFullModel<T, Matrix<T>, Vector<T>>, IModel<Matrix<T>, Vector<T>, ModelMetadata<T>>, IModelSerializer, ICheckpointableModel, IParameterizable<T, Matrix<T>, Vector<T>>, IFeatureAware, IFeatureImportance<T>, ICloneable<IFullModel<T, Matrix<T>, Vector<T>>>, IGradientComputable<T, Matrix<T>, Vector<T>>, IJitCompilable<T>

Type Parameters

T

The numeric type used for calculations (e.g., float, double).

Inheritance
InformerModel<T>
Implements
IFullModel<T, Matrix<T>, Vector<T>>
IModel<Matrix<T>, Vector<T>, ModelMetadata<T>>
IParameterizable<T, Matrix<T>, Vector<T>>
ICloneable<IFullModel<T, Matrix<T>, Vector<T>>>
IGradientComputable<T, Matrix<T>, Vector<T>>
Inherited Members
Extension Methods

Remarks

The Long-Sequence Forecasting Problem: Traditional Transformer models achieve state-of-the-art results in many sequence modeling tasks, but they struggle with long time series because self-attention has O(L^2) time and memory complexity. For a sequence of 1000 time steps, vanilla attention requires 1 million operations per layer. This makes long-horizon forecasting computationally prohibitive.

The Informer Solution: Informer (Zhou et al., AAAI 2021) introduces three key innovations: 1. ProbSparse Self-Attention (O(L log L) complexity) 2. Self-Attention Distilling for sequence compression 3. Generative-Style Decoder for parallel multi-step forecasting

Constructors

InformerModel(InformerOptions<T>?)

Initializes a new instance of the Informer model with the specified options.

public InformerModel(InformerOptions<T>? options = null)

Parameters

options InformerOptions<T>

Properties

ParameterCount

Gets the number of parameters in the model.

public override int ParameterCount { get; }

Property Value

int

Remarks

This property returns the total count of trainable parameters in the model. It's useful for understanding model complexity and memory requirements.

Methods

CreateInstance()

Creates a new instance of the Informer model.

protected override IFullModel<T, Matrix<T>, Vector<T>> CreateInstance()

Returns

IFullModel<T, Matrix<T>, Vector<T>>

DeserializeCore(BinaryReader)

Deserializes the model-specific state from a binary reader.

protected override void DeserializeCore(BinaryReader reader)

Parameters

reader BinaryReader

ForecastHorizon(Vector<T>)

Generates multi-step forecasts using the full Informer architecture.

public Vector<T> ForecastHorizon(Vector<T> input)

Parameters

input Vector<T>

Returns

Vector<T>

GetModelMetadata()

Gets metadata about the time series model.

public override ModelMetadata<T> GetModelMetadata()

Returns

ModelMetadata<T>

A ModelMetaData object containing information about the model.

Remarks

This method provides comprehensive metadata about the model, including its type, configuration options, training status, evaluation metrics, and information about which features/lags are most important.

For Beginners: This method provides important information about the model that can help you understand its characteristics and performance.

The metadata includes:

  • The type of model (e.g., ARIMA, TBATS, Neural Network)
  • Configuration details (e.g., lag order, seasonality period)
  • Whether the model has been trained
  • Performance metrics from the last evaluation
  • Information about which features (time periods) are most influential

This information is useful for documentation, model comparison, and debugging. It's like a complete summary of everything important about the model.

PredictSingle(Vector<T>)

Predicts the next single value in the time series.

public override T PredictSingle(Vector<T> input)

Parameters

input Vector<T>

Returns

T

SerializeCore(BinaryWriter)

Serializes the model-specific state to a binary writer.

protected override void SerializeCore(BinaryWriter writer)

Parameters

writer BinaryWriter

TrainCore(Matrix<T>, Vector<T>)

Trains the model using proper backpropagation through the Informer architecture.

protected override void TrainCore(Matrix<T> x, Vector<T> y)

Parameters

x Matrix<T>
y Vector<T>