Remove irrelevant stuff from config.json

#1
by abdulfatir - opened
README.md CHANGED
@@ -1,108 +1,4 @@
1
  ---
2
  license: apache-2.0
3
- pipeline_tag: time-series-forecasting
4
- tags:
5
- - time series
6
- - forecasting
7
- - pretrained models
8
- - foundation models
9
- - time series foundation models
10
- - time-series
11
  ---
12
-
13
- # Chronos-T5 (Base)
14
-
15
- 🚀 **Update Nov 27, 2024**: We have released Chronos-Bolt⚡️ models that are more accurate (5% lower error), up to 250 times faster and 20 times more memory-efficient than the original Chronos models of the same size. Check out the new models [here](https://huggingface.co/amazon/chronos-bolt-base).
16
-
17
- 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.
18
-
19
- For details on Chronos models, training data and procedures, and experimental results, please refer to the paper [Chronos: Learning the Language of Time Series](https://arxiv.org/abs/2403.07815).
20
-
21
- <p align="center">
22
- <img src="figures/main-figure.png" width="100%">
23
- <br />
24
- <span>
25
- Fig. 1: High-level depiction of Chronos. (<b>Left</b>) The input time series is scaled and quantized to obtain a sequence of tokens. (<b>Center</b>) 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. (<b>Right</b>) 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.
26
- </span>
27
- </p>
28
-
29
- ---
30
-
31
- ## Architecture
32
-
33
- The models in this repository are based on the [T5 architecture](https://arxiv.org/abs/1910.10683). 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.
34
-
35
- | Model | Parameters | Based on |
36
- | ---------------------------------------------------------------------- | ---------- | ---------------------------------------------------------------------- |
37
- | [**chronos-t5-tiny**](https://huggingface.co/amazon/chronos-t5-tiny) | 8M | [t5-efficient-tiny](https://huggingface.co/google/t5-efficient-tiny) |
38
- | [**chronos-t5-mini**](https://huggingface.co/amazon/chronos-t5-mini) | 20M | [t5-efficient-mini](https://huggingface.co/google/t5-efficient-mini) |
39
- | [**chronos-t5-small**](https://huggingface.co/amazon/chronos-t5-small) | 46M | [t5-efficient-small](https://huggingface.co/google/t5-efficient-small) |
40
- | [**chronos-t5-base**](https://huggingface.co/amazon/chronos-t5-base) | 200M | [t5-efficient-base](https://huggingface.co/google/t5-efficient-base) |
41
- | [**chronos-t5-large**](https://huggingface.co/amazon/chronos-t5-large) | 710M | [t5-efficient-large](https://huggingface.co/google/t5-efficient-large) |
42
-
43
- ## Usage
44
-
45
- To perform inference with Chronos models, install the package in the GitHub [companion repo](https://github.com/amazon-science/chronos-forecasting) by running:
46
-
47
- ```
48
- pip install git+https://github.com/amazon-science/chronos-forecasting.git
49
- ```
50
-
51
- A minimal example showing how to perform inference using Chronos models:
52
-
53
- ```python
54
- import matplotlib.pyplot as plt
55
- import numpy as np
56
- import pandas as pd
57
- import torch
58
- from chronos import ChronosPipeline
59
-
60
- pipeline = ChronosPipeline.from_pretrained(
61
- "amazon/chronos-t5-base",
62
- device_map="cuda",
63
- torch_dtype=torch.bfloat16,
64
- )
65
-
66
- df = pd.read_csv("https://raw.githubusercontent.com/AileenNielsen/TimeSeriesAnalysisWithPython/master/data/AirPassengers.csv")
67
-
68
- # context must be either a 1D tensor, a list of 1D tensors,
69
- # or a left-padded 2D tensor with batch as the first dimension
70
- context = torch.tensor(df["#Passengers"])
71
- prediction_length = 12
72
- forecast = pipeline.predict(context, prediction_length) # shape [num_series, num_samples, prediction_length]
73
-
74
- # visualize the forecast
75
- forecast_index = range(len(df), len(df) + prediction_length)
76
- low, median, high = np.quantile(forecast[0].numpy(), [0.1, 0.5, 0.9], axis=0)
77
-
78
- plt.figure(figsize=(8, 4))
79
- plt.plot(df["#Passengers"], color="royalblue", label="historical data")
80
- plt.plot(forecast_index, median, color="tomato", label="median forecast")
81
- plt.fill_between(forecast_index, low, high, color="tomato", alpha=0.3, label="80% prediction interval")
82
- plt.legend()
83
- plt.grid()
84
- plt.show()
85
- ```
86
-
87
- ## Citation
88
-
89
- If you find Chronos models useful for your research, please consider citing the associated [paper](https://arxiv.org/abs/2403.07815):
90
-
91
- ```
92
- @article{ansari2024chronos,
93
- title={Chronos: Learning the Language of Time Series},
94
- 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},
95
- journal={Transactions on Machine Learning Research},
96
- issn={2835-8856},
97
- year={2024},
98
- url={https://openreview.net/forum?id=gerNCVqqtR}
99
- }
100
- ```
101
-
102
- ## Security
103
-
104
- See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.
105
-
106
- ## License
107
-
108
- This project is licensed under the Apache-2.0 License.
 
1
  ---
2
  license: apache-2.0
3
+ pipeline_tag: other
 
 
 
 
 
 
 
4
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
chronos_config.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "low_limit": -15.0,
3
+ "high_limit": 15.0,
4
+ "n_tokens": 4096,
5
+ "n_special_tokens": 2,
6
+ "pad_token_id": 0,
7
+ "eos_token_id": 1,
8
+ "use_eos_token": true,
9
+ "model_type": "seq2seq",
10
+ "context_length": 512,
11
+ "prediction_length": 64,
12
+ "num_samples": 20,
13
+ "temperature": 1.0,
14
+ "top_k": 50,
15
+ "top_p": 1.0
16
+ }
config.json CHANGED
@@ -1,5 +1,7 @@
1
  {
2
- "architectures": ["T5ForConditionalGeneration"],
 
 
3
  "d_ff": 3072,
4
  "d_kv": 64,
5
  "d_model": 768,
@@ -11,7 +13,7 @@
11
  "initializer_factor": 0.05,
12
  "is_encoder_decoder": true,
13
  "is_gated_act": false,
14
- "layer_norm_epsilon": 1e-6,
15
  "model_type": "t5",
16
  "n_positions": 512,
17
  "num_decoder_layers": 12,
@@ -20,27 +22,8 @@
20
  "pad_token_id": 0,
21
  "relative_attention_max_distance": 128,
22
  "relative_attention_num_buckets": 32,
23
- "torch_dtype": "float32",
24
  "transformers_version": "4.31.0",
25
  "use_cache": true,
26
- "vocab_size": 4096,
27
- "chronos_config": {
28
- "tokenizer_class": "MeanScaleUniformBins",
29
- "tokenizer_kwargs": {
30
- "low_limit": -15.0,
31
- "high_limit": 15.0
32
- },
33
- "n_tokens": 4096,
34
- "n_special_tokens": 2,
35
- "pad_token_id": 0,
36
- "eos_token_id": 1,
37
- "use_eos_token": true,
38
- "model_type": "seq2seq",
39
- "context_length": 512,
40
- "prediction_length": 64,
41
- "num_samples": 20,
42
- "temperature": 1.0,
43
- "top_k": 50,
44
- "top_p": 1.0
45
- }
46
  }
 
1
  {
2
+ "architectures": [
3
+ "T5ForConditionalGeneration"
4
+ ],
5
  "d_ff": 3072,
6
  "d_kv": 64,
7
  "d_model": 768,
 
13
  "initializer_factor": 0.05,
14
  "is_encoder_decoder": true,
15
  "is_gated_act": false,
16
+ "layer_norm_epsilon": 1e-06,
17
  "model_type": "t5",
18
  "n_positions": 512,
19
  "num_decoder_layers": 12,
 
22
  "pad_token_id": 0,
23
  "relative_attention_max_distance": 128,
24
  "relative_attention_num_buckets": 32,
25
+ "torch_dtype": "bfloat16",
26
  "transformers_version": "4.31.0",
27
  "use_cache": true,
28
+ "vocab_size": 4096
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  }
figures/main-figure.png DELETED
Binary file (232 kB)
 
model.safetensors → pytorch_model.bin RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:44a2eef44aa13d9048a625ea289beb1ea5d709d7b2044f72134c974132644bf2
3
- size 805530528
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ba0e0e6b96f6463cbcb9a8a58679151b804050bedd11617b17aab507e71f33cc
3
+ size 402838673