🚀 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許可證。