Informer: Long-Sequence Time-Series Forecasting

repository·main·Indexed 27 days ago

https://github.com/zhouhaoyi/informer2020

A Transformer-based model for long-sequence time-series forecasting featuring ProbSparse self-attention to reduce computational complexity. Includes implementation details for training and testing on ETT, ECL, and Weather datasets using main_informer.py.

Tokens
523
Snippets
2
Records
7
Agent score
42%

What's inside Informer

  1. Install Informer dependencies

    main

    Install the required Python packages using the provided requirements.txt file. The project requires Python 3.6 and specific versions of matplotlib, numpy, pandas, scikit-learn, and torch.

    pip install -r requirements.txt
  2. Reproduce experiment results

    main

    To reproduce the results, follow these steps using make:

    1. Initialize the docker image: make init.
    2. Download datasets: make dataset.
    3. Run specific scripts in scripts/ using: make run_module module="bash <script_name>.sh".

    Alternatively, run all scripts in the scripts/ directory at once:

    for file in `ls scripts`; do make run_module module="bash scripts/$file"; done
  3. Troubleshoot RuntimeError regarding tensor size mismatch

    main
    If you encounter RuntimeError: The size of tensor a (98) must match the size of tensor b (96) at non-singleton dimension 1, it is likely due to changes in how Conv1d handles circular padding mode across different PyTorch versions. You may need to modify the Conv1d implementation within TokenEmbedding in models/embed.py.
  4. Run Informer training and testing with ProbSparse attention

    main

    Execute main_informer.py with specific flags to train and test on ETT datasets using ProbSparse self-attention.

    # ETTh1
    python -u main_informer.py --model informer --data ETTh1 --attn prob --freq h
    
    # ETTh2
    python -u main_informer.py --model informer --data ETTh2 --attn prob --freq h
    
    # ETTm1
    python -u main_informer.py --model informer --data ETTm1 --attn prob --freq t