AutoformerOptions<T>

Options & Configuration · AiDotNet.Models.Options

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

Inheritance: ModelOptions → RegressionOptions<T> → TimeSeriesRegressionOptions<T> → AutoformerOptions<T>

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)

How It Works

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: the window of the moving average that extracts the trend

Constructors

Constructor Summary
AutoformerOptions() Creates a new instance with the reference’s defaults.
AutoformerOptions(AutoformerOptions<T> other) Creates a copy of the specified options.

Properties

Property Summary
bool UseGelu { get; set; } Gets or sets whether the feed-forward activation is GELU (activation ‘gelu’; false: ReLU).
double DropoutRate { get; set; } Gets or sets the dropout rate (dropout, 0.05).
double LearningRate { get; set; } Gets or sets the initial learning rate of Adam (learning_rate, 1e-4), halved after every epoch (lradj ‘type1’).
int AutoCorrelationFactor { get; set; } Gets or sets the Auto-Correlation factor c: the ⌊c·ln L⌋ strongest lags are aggregated (factor, 1).
int BatchSize { get; set; } Gets or sets the batch size (batch_size, 32).
int EmbeddingDim { get; set; } Gets or sets the model width (d_model, 512).
int Epochs { get; set; } Gets or sets the number of training epochs (train_epochs, 10).
int FeedForwardDim { get; set; } Gets or sets the feed-forward width (d_ff, 2048).
int ForecastHorizon { get; set; } Gets or sets the forecast horizon (pred_len, 96).
int LabelLength { get; set; } Gets or sets the start-token length: the last steps of the input’s seasonal and trend parts that open the decoder (label_len).
int LookbackWindow { get; set; } Gets or sets the lookback window, the encoder input length (seq_len; the reference’s default 96).
int MovingAverageKernel { get; set; } Gets or sets the moving-average window of the series decomposition, an odd number (moving_avg, 25).
int NumAttentionHeads { get; set; } Gets or sets the number of heads of the Auto-Correlation projections (n_heads, 8).
int NumDecoderLayers { get; set; } Gets or sets the number of decoder layers (d_layers, 1).
int NumEncoderLayers { get; set; } Gets or sets the number of encoder layers (e_layers, 2).