🚀 Chronos - Bolt⚡ (Small)
Chronos - Boltは、ゼロショット予測に使用できる事前学習済みの時系列予測モデルファミリーです。このモデルは、T5エンコーダ - デコーダアーキテクチャに基づいており、約1000億件の時系列観測データで学習されています。過去の時系列コンテキストを複数の観測値のパッチに分割し、エンコーダに入力します。そして、デコーダがこれらの表現を使用して、複数の未来のステップにわたる分位数予測を直接生成します。これは、直接的な多ステップ予測として知られる方法です。Chronos - Boltモデルは、同じサイズの元のChronosモデルよりも精度が高く、最大250倍高速で、20倍メモリ効率が良いです。
🚀 クイックスタート
2025年2月14日の更新
Chronos - BoltモデルがAmazon SageMaker JumpStartで利用可能になりました! [チュートリアルノートブック](https://github.com/amazon - science/chronos - forecasting/blob/main/notebooks/deploy - chronos - bolt - to - amazon - sagemaker.ipynb)を参照して、数行のコードで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モデルが、これらのデータセットで学習された一般的な統計モデルや深層学習モデル(*で強調表示)を上回っていることです。さらに、+で示される他の基礎モデル(FM)よりも性能が良く、これはこれらのモデルが私たちのベンチマークの特定のデータセットで事前学習されており、完全なゼロショットではないことを示しています。特に、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-small"},
},
)
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-small",
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ライセンスの下でライセンスされています。