🚀 Chronos - Bolt⚡ (Mini)
Chronos - Bolt是一系列预训练的时间序列预测模型,可用于零样本预测。它基于T5编码器 - 解码器架构,在近1000亿个时间序列观测值上进行了训练。该模型将历史时间序列上下文分块为多个观测值的片段,然后输入到编码器中。解码器再利用这些表示直接生成多个未来步骤的分位数预测,这是一种被称为直接多步预测的方法。与相同规模的原始Chronos模型相比,Chronos - Bolt模型更准确,速度提高了多达250倍,内存效率提高了20倍。
🚀 快速开始
模型更新信息
🚀 2025年2月14日更新:Chronos - Bolt模型现已在Amazon SageMaker JumpStart上可用!查看教程笔记本,了解如何通过几行代码部署Chronos端点以用于生产。
✨ 主要特性
性能优势
速度对比
以下图表对比了Chronos - Bolt与原始Chronos模型在预测1024个时间序列时的推理时间,上下文长度为512个观测值,预测范围为64步。
准确性对比
Chronos - Bolt模型不仅速度显著更快,而且比原始Chronos模型更准确。以下图表分别报告了Chronos - Bolt在加权分位数损失(WQL)和平均绝对缩放误差(MASE)方面的概率和点预测性能,这些性能是在27个数据集上汇总得出的(有关此基准测试的详细信息,请参阅Chronos论文)。值得注意的是,尽管在训练期间没有接触过这些数据集,但零样本的Chronos - Bolt模型的表现优于在这些数据集上训练的常用统计模型和深度学习模型(用*表示)。此外,它们的表现也优于其他基础模型(用 + 表示),这表明这些模型在我们的基准测试中的某些数据集上进行了预训练,并非完全零样本。值得一提的是,Chronos - Bolt(Base)在预测准确性方面也超过了原始Chronos(Large)模型,同时速度快了600多倍。
模型规格
Chronos - Bolt模型有以下几种规格可供选择:
模型 |
参数数量 |
基于的模型 |
[chronos - bolt - tiny](https://huggingface.co/autogluon/chronos - bolt - tiny) |
9M |
[t5 - efficient - tiny](https://huggingface.co/google/t5 - efficient - tiny) |
[chronos - bolt - mini](https://huggingface.co/autogluon/chronos - bolt - mini) |
21M |
[t5 - efficient - mini](https://huggingface.co/google/t5 - efficient - mini) |
[chronos - bolt - small](https://huggingface.co/autogluon/chronos - bolt - small) |
48M |
[t5 - efficient - small](https://huggingface.co/google/t5 - efficient - small) |
[chronos - bolt - base](https://huggingface.co/autogluon/chronos - bolt - base) |
205M |
[t5 - efficient - base](https://huggingface.co/google/t5 - efficient - base) |
📦 安装指南
安装依赖
pip install autogluon
pip install -U sagemaker
💻 使用示例
基础用法
在AutoGluon中使用Chronos - Bolt进行零样本推理
from autogluon.timeseries import TimeSeriesPredictor, TimeSeriesDataFrame
df = TimeSeriesDataFrame("https://autogluon.s3.amazonaws.com/datasets/timeseries/m4_hourly/train.csv")
predictor = TimeSeriesPredictor(prediction_length=48).fit(
df,
hyperparameters={
"Chronos": {"model_path": "autogluon/chronos-bolt-mini"},
},
)
predictions = predictor.predict(df)
将Chronos - Bolt端点部署到SageMaker
from sagemaker.jumpstart.model import JumpStartModel
model = JumpStartModel(
model_id="autogluon-forecasting-chronos-bolt-base",
instance_type="ml.c5.2xlarge",
)
predictor = model.deploy()
import pandas as pd
df = pd.read_csv("https://raw.githubusercontent.com/AileenNielsen/TimeSeriesAnalysisWithPython/master/data/AirPassengers.csv")
payload = {
"inputs": [
{"target": df["#Passengers"].tolist()}
],
"parameters": {
"prediction_length": 12,
}
}
forecast = predictor.predict(payload)["predictions"]
高级用法
对于微调和使用协变量进行预测等更高级的功能,请查看此教程。Chronos - Bolt模型可以部署到CPU和GPU实例上,并且支持使用协变量进行预测。有关端点API的更多详细信息,请查看[示例笔记本](https://github.com/amazon - science/chronos - forecasting/blob/main/notebooks/deploy - chronos - bolt - to - amazon - sagemaker.ipynb)。
📚 详细文档
引用说明
如果您发现Chronos或Chronos - Bolt模型对您的研究有用,请考虑引用相关论文:
@article{ansari2024chronos,
title={Chronos: Learning the Language of Time Series},
author={Ansari, Abdul Fatir and Stella, Lorenzo and Turkmen, Caner and Zhang, Xiyuan, and Mercado, Pedro and Shen, Huibin and Shchur, Oleksandr and Rangapuram, Syama Syndar and Pineda Arango, Sebastian and Kapoor, Shubham and Zschiegner, Jasper and Maddix, Danielle C. and Mahoney, Michael W. and Torkkola, Kari and Gordon Wilson, Andrew and Bohlke-Schneider, Michael and Wang, Yuyang},
journal={Transactions on Machine Learning Research},
issn={2835-8856},
year={2024},
url={https://openreview.net/forum?id=gerNCVqqtR}
}
📄 许可证
本项目采用Apache - 2.0许可证。