🚀 Chronos - Bolt⚡ (Tiny)
Chronos - Boltは、ゼロショット予測に使用できる事前学習済みの時系列予測モデルのファミリーです。このモデルは、T5エンコーダ - デコーダアーキテクチャに基づいており、約1000億の時系列観測値で学習されています。過去の時系列コンテキストを複数の観測値のパッチに分割し、エンコーダに入力します。そして、デコーダがこれらの表現を使用して、複数の未来のステップにわたる分位数予測を直接生成します。これは直接多ステップ予測として知られる方法です。Chronos - Boltモデルは、同じサイズの元のChronosモデルよりも精度が高く、最大250倍高速で、20倍メモリ効率が良いです。
🚀 クイックスタート
🚀 2025年2月14日更新: Chronos - BoltモデルがAmazon SageMaker JumpStartで利用可能になりましたを参照して、数行のコードでChronosエンドポイントを本番環境で展開する方法を学んでください。
✨ 主な機能
性能
次のプロットは、コンテキスト長が512観測値、予測期間が64ステップで1024の時系列を予測する際のChronos - Boltと元のChronosモデルの推論時間を比較しています。
Chronos - Boltモデルは、元のChronosモデルよりも大幅に高速で、精度も高いです。次のプロットは、[Weighted Quantile Loss (WQL)](https://auto.gluon.ai/stable/tutorials/timeseries/forecasting - metrics.html#autogluon.timeseries.metrics.WQL)と[Mean Absolute Scaled Error (MASE)](https://auto.gluon.ai/stable/tutorials/timeseries/forecasting - metrics.html#autogluon.timeseries.metrics.MASE)の観点から、Chronos - Boltの確率的予測と点予測の性能をそれぞれ報告しています。これらは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) |
📦 インストール
AutoGluonでのChronos - Boltによるゼロショット推論
必要な依存関係をインストールします。
pip install autogluon
SageMakerにChronos - Boltエンドポイントをデプロイするには、まずSageMaker SDKを更新して、すべての最新モデルが利用可能になるようにします。
pip install -U sagemaker
💻 使用例
AutoGluonでのChronos - Boltによるゼロショット推論
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-tiny"},
},
)
predictions = predictor.predict(df)
ファインチューニングや共変量を使用した予測などの高度な機能については、[このチュートリアル](https://auto.gluon.ai/stable/tutorials/timeseries/forecasting - chronos.html)を参照してください。
SageMakerへの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()
これで、JSON形式で時系列データをエンドポイントに送信できます。
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ライセンスの下でライセンスされています。