Update README.md
Browse files
README.md
CHANGED
@@ -2,23 +2,25 @@
|
|
2 |
license: apache-2.0
|
3 |
---
|
4 |
|
5 |
-
# TimesFM
|
6 |
|
7 |
-
TimesFM is a pretrained time-series foundation model developed by Google
|
8 |
-
Research for time-series forecasting.
|
9 |
|
10 |
-
|
11 |
|
12 |
-
|
|
|
|
|
13 |
|
14 |
-
|
15 |
-
inference locally.
|
16 |
|
17 |
This is not an officially supported Google product.
|
18 |
|
19 |
## Installation
|
20 |
|
21 |
-
|
|
|
|
|
22 |
|
23 |
```
|
24 |
conda env create --file=environment.yml
|
@@ -29,7 +31,9 @@ For a CPU setup please use,
|
|
29 |
```
|
30 |
conda env create --file=environment_cpu.yml
|
31 |
```
|
32 |
-
|
|
|
|
|
33 |
|
34 |
```
|
35 |
conda activate tfm_env
|
@@ -45,27 +49,27 @@ Then the base class can be loaded as,
|
|
45 |
import timesfm
|
46 |
|
47 |
tfm = timesfm.TimesFm(
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
```
|
63 |
|
64 |
1. The context_len here can be set as the max context length of the model. You can provide shorter series to the `tfm.forecast()` function and the model will handle it. Currently the model handles a max context length of 512, which can be increased in later releases.
|
65 |
|
66 |
2. The horizon length can be set to anything. We recommend setting it to the largest horizon length you would need in the forecasting tasks for your application. We generally recommend horizon length <= context length but it is not a requirement in the function call.
|
67 |
|
68 |
-
3. We also provide an API to forecast from pandas dataframe. Please look at the documentation of the function `tfm.forecast_on_df()`.
|
69 |
|
70 |
## Benchmarks
|
71 |
|
|
|
2 |
license: apache-2.0
|
3 |
---
|
4 |
|
5 |
+
# TimesFM
|
6 |
|
7 |
+
TimesFM (Time Series Foundation Model) is a pretrained time-series foundation model developed by Google Research for time-series forecasting.
|
|
|
8 |
|
9 |
+
**Resources and Technical Documentation**:
|
10 |
|
11 |
+
* Paper: [A decoder-only foundation model for time-series forecasting](https://arxiv.org/abs/2310.10688), to appear in ICML 2024.
|
12 |
+
* [Google Research blog](https://research.google/blog/a-decoder-only-foundation-model-for-time-series-forecasting/)
|
13 |
+
* [GitHub repo](https://github.com/google-research/timesfm)
|
14 |
|
15 |
+
**Authors**: Google Research
|
|
|
16 |
|
17 |
This is not an officially supported Google product.
|
18 |
|
19 |
## Installation
|
20 |
|
21 |
+
This Hugging Face repo hosts TimesFm checkpoints. Please visit our [GitHub repo](https://github.com/google-research/timesfm) to install the `timesfm` library for model inference.
|
22 |
+
|
23 |
+
We have two environment files. For GPU installation (assuming CUDA 12 has been setup), you can create a conda environment `tfm_env` from the base folder through:
|
24 |
|
25 |
```
|
26 |
conda env create --file=environment.yml
|
|
|
31 |
```
|
32 |
conda env create --file=environment_cpu.yml
|
33 |
```
|
34 |
+
to create the environment instead.
|
35 |
+
|
36 |
+
Follow by
|
37 |
|
38 |
```
|
39 |
conda activate tfm_env
|
|
|
49 |
import timesfm
|
50 |
|
51 |
tfm = timesfm.TimesFm(
|
52 |
+
context_len=<context>,
|
53 |
+
horizon_len=<horizon>,
|
54 |
+
input_patch_len=32,
|
55 |
+
output_patch_len=128,
|
56 |
+
num_layers=20,
|
57 |
+
model_dims=1280,
|
58 |
+
backend=<backend>,
|
59 |
+
per_core_batch_size=<batch_size>,
|
60 |
+
quantiles=<quantiles>,
|
61 |
+
)
|
62 |
+
tfm.load_from_checkpoint(
|
63 |
+
<checkpoint_path>,
|
64 |
+
checkpoint_type=checkpoints.CheckpointType.FLAX,
|
65 |
+
)
|
66 |
```
|
67 |
|
68 |
1. The context_len here can be set as the max context length of the model. You can provide shorter series to the `tfm.forecast()` function and the model will handle it. Currently the model handles a max context length of 512, which can be increased in later releases.
|
69 |
|
70 |
2. The horizon length can be set to anything. We recommend setting it to the largest horizon length you would need in the forecasting tasks for your application. We generally recommend horizon length <= context length but it is not a requirement in the function call.
|
71 |
|
72 |
+
3. We also provide an API to forecast from `pandas` dataframe. Please look at the documentation of the function `tfm.forecast_on_df()`.
|
73 |
|
74 |
## Benchmarks
|
75 |
|