autogluon / chronos-t5-small

huggingface.co
Total runs: 5.0K
24-hour runs: -12
7-day runs: 369
30-day runs: -10.4K
Model's Last Updated: May 14 2024
time-series-forecasting

Introduction of chronos-t5-small

Model Details of chronos-t5-small

Chronos-T5 (Small)

Chronos is a family of pretrained time series forecasting models based on language model architectures. A time series is transformed into a sequence of tokens via scaling and quantization, and a language model is trained on these tokens using the cross-entropy loss. Once trained, probabilistic forecasts are obtained by sampling multiple future trajectories given the historical context. Chronos models have been trained on a large corpus of publicly available time series data, as well as synthetic data generated using Gaussian processes.

For details on Chronos models, training data and procedures, and experimental results, please refer to the paper Chronos: Learning the Language of Time Series .


Fig. 1: High-level depiction of Chronos. ( Left ) The input time series is scaled and quantized to obtain a sequence of tokens. ( Center ) The tokens are fed into a language model which may either be an encoder-decoder or a decoder-only model. The model is trained using the cross-entropy loss. ( Right ) During inference, we autoregressively sample tokens from the model and map them back to numerical values. Multiple trajectories are sampled to obtain a predictive distribution.


Architecture

The models in this repository are based on the T5 architecture . The only difference is in the vocabulary size: Chronos-T5 models use 4096 different tokens, compared to 32128 of the original T5 models, resulting in fewer parameters.

Usage

To perform inference with Chronos models, install the package in the GitHub companion repo by running:

pip install git+https://github.com/amazon-science/chronos-forecasting.git

A minimal example showing how to perform inference using Chronos models:

import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import torch
from chronos import ChronosPipeline

pipeline = ChronosPipeline.from_pretrained(
  "amazon/chronos-t5-small",
  device_map="cuda",
  torch_dtype=torch.bfloat16,
)

df = pd.read_csv("https://raw.githubusercontent.com/AileenNielsen/TimeSeriesAnalysisWithPython/master/data/AirPassengers.csv")

# context must be either a 1D tensor, a list of 1D tensors,
# or a left-padded 2D tensor with batch as the first dimension
context = torch.tensor(df["#Passengers"])
prediction_length = 12
forecast = pipeline.predict(context, prediction_length)  # shape [num_series, num_samples, prediction_length]

# visualize the forecast
forecast_index = range(len(df), len(df) + prediction_length)
low, median, high = np.quantile(forecast[0].numpy(), [0.1, 0.5, 0.9], axis=0)

plt.figure(figsize=(8, 4))
plt.plot(df["#Passengers"], color="royalblue", label="historical data")
plt.plot(forecast_index, median, color="tomato", label="median forecast")
plt.fill_between(forecast_index, low, high, color="tomato", alpha=0.3, label="80% prediction interval")
plt.legend()
plt.grid()
plt.show()
Citation

If you find Chronos models useful for your research, please consider citing the associated paper :

@article{ansari2024chronos,
  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},
  title   = {Chronos: Learning the Language of Time Series},
  journal = {arXiv preprint arXiv:2403.07815},
  year    = {2024}
}
Security

See CONTRIBUTING for more information.

License

This project is licensed under the Apache-2.0 License.

Runs of autogluon chronos-t5-small on huggingface.co

5.0K
Total runs
-12
24-hour runs
-203
3-day runs
369
7-day runs
-10.4K
30-day runs

More Information About chronos-t5-small huggingface.co Model

More chronos-t5-small license Visit here:

https://choosealicense.com/licenses/apache-2.0

chronos-t5-small huggingface.co

chronos-t5-small huggingface.co is an AI model on huggingface.co that provides chronos-t5-small's model effect (), which can be used instantly with this autogluon chronos-t5-small model. huggingface.co supports a free trial of the chronos-t5-small model, and also provides paid use of the chronos-t5-small. Support call chronos-t5-small model through api, including Node.js, Python, http.

chronos-t5-small huggingface.co Url

https://huggingface.co/autogluon/chronos-t5-small

autogluon chronos-t5-small online free

chronos-t5-small huggingface.co is an online trial and call api platform, which integrates chronos-t5-small's modeling effects, including api services, and provides a free online trial of chronos-t5-small, you can try chronos-t5-small online for free by clicking the link below.

autogluon chronos-t5-small online free url in huggingface.co:

https://huggingface.co/autogluon/chronos-t5-small

chronos-t5-small install

chronos-t5-small is an open source model from GitHub that offers a free installation service, and any user can find chronos-t5-small on GitHub to install. At the same time, huggingface.co provides the effect of chronos-t5-small install, users can directly use chronos-t5-small installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

chronos-t5-small install url in huggingface.co:

https://huggingface.co/autogluon/chronos-t5-small

Url of chronos-t5-small

chronos-t5-small huggingface.co Url

Provider of chronos-t5-small huggingface.co

autogluon
ORGANIZATIONS

Other API from autogluon