GridTST

May 24, 2024 · View on GitHub

Leveraging 2D Information for Long-term Time Series Forecasting with Vanilla Transformers

A simple yet strong Long-term Time Series prediction model.

vanilla TransformerMultivariate ModelingSequntial Modeling
DLinear (AAAI2023)
CrossFormer (ICLR2023)✔️✔️
PatchTST (ICLR2023)✔️✔️
iTransformer (ICLR 2024)✔️✔️
GridTST✔️✔️✔️
ModelGridTSTPatchTST (ICLR 2023)iTransformer (ICLR 2024)Dlinear (AAAI 2023)
Weather0.2230.2280.2360.246
Traffic0.3720.3960.3860.433
Electricity0.1520.1630.1650.166
Illness1.6491.8062.1222.169
Etth10.4160.4210.4500.422
Ettm10.3450.3510.3650.357
Solar0.1870.2150.2150.244

Requirements

We recommand to use Conda to mange a virtual environment:

conda create -n gridtst python=3.8 && conda activate gridtst
pip install -r requirements.txt

logging and multi-gpu training setup:

wandb login
accelerate config

Datasets

This is the dataset we use, you could download here and put all csv files in the dataset folder.

Datast# Channels# TimeStepsPrediction LengthInformation
Weather2152696{96,192,336,720}Weather
Traffic86217544{96,192,336,720}Transportation
Electricity32126304{96,192,336,720}Electricity
Illness7966{12,24,48,60}Illness
Etth1717420{96,192,336,720}Electricity
Ettm1769680{96,192,336,720}Electricity
Solar13752560{96,192,336,720}Energy

Get Started

We provide all the scripts on the scripts folder. For example, training on the Weather dataset with lookback window = 336:

bash scripts/lookback_window_336/weather.sh

Available Checkpoints

We provide our trained model on the huggingface space

To evaluate these models, you could either specify a perticular model or evaluate them all at once.

For a certain model, for example GridTST on traffic dataset with lookback window=336 and prediction length=96:

python benchmark.py --data_file dataset/traffic.csv --seq_len 336 --label_len 96

To evaluate them all:

python benchmark.py --all