Table of Contents

Class AutoformerOptions<T>

Namespace
AiDotNet.Models.Options
Assembly
AiDotNet.dll

Configuration options for the Autoformer model (Autoformer: Decomposition Transformers with Auto-Correlation for Long-Term Series Forecasting).

public class AutoformerOptions<T> : TimeSeriesRegressionOptions<T>

Type Parameters

T

The numeric type used for calculations (typically double or float).

Inheritance
AutoformerOptions<T>
Inherited Members

Remarks

Autoformer (Wu et al., NeurIPS 2021) introduces a novel decomposition-based transformer architecture for long-term time series forecasting. Key innovations include: - Series Decomposition Block: Progressive trend-seasonal separation at each layer - Auto-Correlation Mechanism: Efficient O(L log L) sub-series aggregation replacing self-attention - Moving Average Kernel: Learnable trend extraction from time series

For Beginners: Autoformer is designed to capture both the trend (long-term direction) and seasonality (repeating patterns) in time series data. Unlike Informer which focuses on attention efficiency, Autoformer focuses on decomposing the signal into meaningful components.

Think of it like separating a song into vocals and instrumentals - by processing these separately, the model can better understand and predict each component.

Key features:

  • Auto-Correlation: Instead of attending to individual time points, looks at how sub-sequences correlate with each other (like finding repeating patterns)
  • Series Decomposition: Separates trend from seasonal patterns at every layer
  • Progressive Refinement: Each layer further refines the decomposition

Best suited for:

  • Long-horizon forecasting (weeks/months ahead)
  • Data with clear seasonal patterns (energy consumption, retail sales)
  • Complex trend patterns (economic indicators)

Constructors

AutoformerOptions()

Creates a new instance with default values.

public AutoformerOptions()

AutoformerOptions(AutoformerOptions<T>)

Creates a copy of the specified options.

public AutoformerOptions(AutoformerOptions<T> other)

Parameters

other AutoformerOptions<T>

Properties

AutoCorrelationFactor

Gets or sets the auto-correlation aggregation factor (c in the paper).

public int AutoCorrelationFactor { get; set; }

Property Value

int

Remarks

For Beginners: Controls how many top correlations to consider. The formula is: top_k = c * log(L) where L is sequence length. A factor of 3 provides good accuracy/efficiency tradeoff.

BatchSize

Gets or sets the batch size for training.

public int BatchSize { get; set; }

Property Value

int

DropoutRate

Gets or sets the dropout rate for regularization.

public double DropoutRate { get; set; }

Property Value

double

EmbeddingDim

Gets or sets the embedding dimension (model width).

public int EmbeddingDim { get; set; }

Property Value

int

Remarks

For Beginners: The internal representation size of the model. Larger values can capture more complex patterns but require more computation. 512 is a good balance for most time series.

Epochs

Gets or sets the number of training epochs.

public int Epochs { get; set; }

Property Value

int

ForecastHorizon

Gets or sets the forecast horizon (decoder output length).

public int ForecastHorizon { get; set; }

Property Value

int

Remarks

For Beginners: How far ahead the model predicts. A value of 24 with hourly data means predicting the next day.

LearningRate

Gets or sets the learning rate for optimization.

public double LearningRate { get; set; }

Property Value

double

LookbackWindow

Gets or sets the lookback window (encoder input length).

public int LookbackWindow { get; set; }

Property Value

int

Remarks

For Beginners: How far back in time the model looks to make predictions. A value of 96 with hourly data means looking at the past 4 days.

MovingAverageKernel

Gets or sets the kernel size for moving average in series decomposition.

public int MovingAverageKernel { get; set; }

Property Value

int

Remarks

For Beginners: The window size for separating trend from seasonality. Larger values capture longer-term trends. Should be odd for symmetric smoothing. A value of 25 works well for daily patterns in hourly data.

NumAttentionHeads

Gets or sets the number of attention heads in auto-correlation.

public int NumAttentionHeads { get; set; }

Property Value

int

Remarks

For Beginners: Number of parallel pattern-detection mechanisms. More heads can capture different types of patterns simultaneously.

NumDecoderLayers

Gets or sets the number of decoder layers.

public int NumDecoderLayers { get; set; }

Property Value

int

NumEncoderLayers

Gets or sets the number of encoder layers.

public int NumEncoderLayers { get; set; }

Property Value

int

Remarks

For Beginners: How many times the model processes the input. More layers can capture more complex patterns but risk overfitting.