HuggingFace镜像/timer-base-84m
模型介绍
文件和版本
分析

时序变换器(Timer)

更新(2025年5月):我们在HuggingFace发布了生成式时间序列基础模型Sundial。

更新(2025年2月):我们发布OpenLTM用于大规模时间序列模型的预训练/微调。

Timer是本文论文提出的大型时间序列模型,并通过后续研究进行了增强。

image/png

本版本采用8400万参数,基于2600亿时间点进行单变量预训练,是面向零样本点预测的轻量级生成式变换器。

我们在以下基准测试中评估该模型:TSLib数据集。

更多信息请参阅GitHub代码库。

该模型确实存在改进空间。我们正积极开展相关工作,并乐于收到建设性意见和值得关注的案例:)

快速开始

pip install transformers==4.40.1 # Use this version and Python 3.10 for stable compatibility
import torch
from transformers import AutoModelForCausalLM

# load pretrain model
model = AutoModelForCausalLM.from_pretrained('thuml/timer-base-84m', trust_remote_code=True)

# prepare input
batch_size, lookback_length = 1, 2880
seqs = torch.randn(batch_size, lookback_length)

# generate forecast
prediction_length = 96
output = model.generate(seqs, max_new_tokens=prediction_length)

print(output.shape)

我们还提供了一个笔记本示例,详见此处。欢迎尝试!

技术规格

  • 架构:因果Transformer(仅解码器)
  • 预训练规模:2600亿时间点
  • 上下文长度:最高2880
  • 参数量:8400万
  • 片段长度:96
  • 层数:8

模型适配

对于有兴趣微调此模型的开发者,我们在此代码库中提供了模型检查点和代码实现。

致谢

本工作得到了国家自然科学基金(62022050和U2342217)、北京信息科学与技术国家研究中心创新基金(BNR2024RC01010)以及国家大数据软件工程研究中心的支持。

该模型主要基于互联网公开时间序列数据集构建,这些数据来自不同的研究团队和供应商。我们衷心感谢所有贡献数据的个人和组织。没有他们的慷慨分享,这个模型将无法实现。

引用

如果您发现Timer或Timer-XL对您的研究有所帮助,请引用我们的论文:

@inproceedings{liutimer,
  title={Timer: Generative Pre-trained Transformers Are Large Time Series Models},
  author={Liu, Yong and Zhang, Haoran and Li, Chenyu and Huang, Xiangdong and Wang, Jianmin and Long, Mingsheng},
  booktitle={Forty-first International Conference on Machine Learning}
}

@article{liu2024timer,
  title={Timer-XL: Long-Context Transformers for Unified Time Series Forecasting},
  author={Liu, Yong and Qin, Guo and Huang, Xiangdong and Wang, Jianmin and Long, Mingsheng},
  journal={arXiv preprint arXiv:2410.04803},
  year={2024}
}

联系方式

如有任何疑问或希望使用代码,欢迎随时联系:

  • 刘勇 (liuyong21@mails.tsinghua.edu.cn)
  • 秦果 (qinguo24@mails.tsinghua.edu.cn)

许可协议

本模型基于 Apache-2.0 许可证授权使用。