hwanyu112/TimeRAF

7

stars

8

commits

Python

primary language

Nov 11, 2025

updated

README

TimeRAF

This repo provides official code for TimeRAF: Retrieval-Augmented Foundation model for Zero-shot Time Series Forecasting

Python Version

The current Python versions supported are 3.9, 3.10, 3.11.

Installing

Install Pytorch and necessary dependencies.

pip install -r requirements.txt

Datasets

Inference Datasets

You can download downstream datasets from Google Drive.

Code for Training

  1. Put training datasets under the folder ./datasets/train/.

  2. Put the knowledge base under the folder ./kb/.

  3. Run the provided script

    bash ./train.sh
    

Code for Inference

  1. Put downstream datasets under the folder ./datasets/test/.

  2. Put the checkpoint under the folder ./checkpoints/.

  3. Run the provided script

    bash ./test.sh
    

    For example, the inference output of the ETTm1 dataset is as follows:

    {'eval_loss': 0.39922061562538147, 'eval_model_preparation_time': 0.0036, 'eval_runtime': 23.4378, 'eval_samples_per_second': 3412.228, 'eval_steps_per_second': 0.853}
    

    where the 'eval_loss' is the MSE.

Code for Inference on baseline

  1. Put downstream datasets under the folder ./datasets/test/.

  2. Run the provided script

    bash ./baseline.sh
    

    For example, the inference output of the baseline model on the ETTh2 dataset is as follows:

    {'eval_loss': 0.2855670750141144, 'eval_model_preparation_time': 0.002, 'eval_runtime': 0.7691, 'eval_samples_per_second': 25346.349, 'eval_steps_per_second': 9.101}
    

    where the 'eval_loss' is the MSE.

Citation

If you find our work helpful for your research, please consider citing our work.

@article{zhang2025timeraf,
  title={Timeraf: Retrieval-augmented foundation model for zero-shot time series forecasting},
  author={Zhang, Huanyu and Xu, Chang and Zhang, Yi-Fan and Zhang, Zhang and Wang, Liang and Bian, Jiang},
  journal={IEEE Transactions on Knowledge and Data Engineering},
  year={2025},
  publisher={IEEE}
}

Contributors

hwanyu112

8 commits

hwanyu112/TimeRAF

7

stars

8

commits

Python

primary language

Nov 11, 2025

updated

README

TimeRAF

This repo provides official code for TimeRAF: Retrieval-Augmented Foundation model for Zero-shot Time Series Forecasting

Python Version

The current Python versions supported are 3.9, 3.10, 3.11.

Installing

Install Pytorch and necessary dependencies.

pip install -r requirements.txt

Datasets

Inference Datasets

You can download downstream datasets from Google Drive.

Code for Training

  1. Put training datasets under the folder ./datasets/train/.

  2. Put the knowledge base under the folder ./kb/.

  3. Run the provided script

    bash ./train.sh
    

Code for Inference

  1. Put downstream datasets under the folder ./datasets/test/.

  2. Put the checkpoint under the folder ./checkpoints/.

  3. Run the provided script

    bash ./test.sh
    

    For example, the inference output of the ETTm1 dataset is as follows:

    {'eval_loss': 0.39922061562538147, 'eval_model_preparation_time': 0.0036, 'eval_runtime': 23.4378, 'eval_samples_per_second': 3412.228, 'eval_steps_per_second': 0.853}
    

    where the 'eval_loss' is the MSE.

Code for Inference on baseline

  1. Put downstream datasets under the folder ./datasets/test/.

  2. Run the provided script

    bash ./baseline.sh
    

    For example, the inference output of the baseline model on the ETTh2 dataset is as follows:

    {'eval_loss': 0.2855670750141144, 'eval_model_preparation_time': 0.002, 'eval_runtime': 0.7691, 'eval_samples_per_second': 25346.349, 'eval_steps_per_second': 9.101}
    

    where the 'eval_loss' is the MSE.

Citation

If you find our work helpful for your research, please consider citing our work.

@article{zhang2025timeraf,
  title={Timeraf: Retrieval-augmented foundation model for zero-shot time series forecasting},
  author={Zhang, Huanyu and Xu, Chang and Zhang, Yi-Fan and Zhang, Zhang and Wang, Liang and Bian, Jiang},
  journal={IEEE Transactions on Knowledge and Data Engineering},
  year={2025},
  publisher={IEEE}
}

Contributors

hwanyu112

8 commits

Languages

Python

98.8%

Shell

1.2%