Upload 5 files
Browse files- .gitattributes +35 -35
- README.md +156 -1
- config.json +38 -0
- model.safetensors +3 -0
- pytorch_model.bin +3 -0
.gitattributes
CHANGED
@@ -1,35 +1,35 @@
|
|
1 |
-
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
-
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
-
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
-
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
-
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
-
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
-
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
-
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
-
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
-
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
-
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
-
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
-
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
-
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
-
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
-
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
-
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
-
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
-
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
-
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
-
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
-
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
-
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
-
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
-
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
-
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
-
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
-
*.tar filter=lfs diff=lfs merge=lfs -text
|
29 |
-
*.tflite filter=lfs diff=lfs merge=lfs -text
|
30 |
-
*.tgz filter=lfs diff=lfs merge=lfs -text
|
31 |
-
*.wasm filter=lfs diff=lfs merge=lfs -text
|
32 |
-
*.xz filter=lfs diff=lfs merge=lfs -text
|
33 |
-
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
-
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
-
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
@@ -1,3 +1,158 @@
|
|
1 |
---
|
2 |
-
license:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
license: mit
|
3 |
+
datasets:
|
4 |
+
- AutonLab/Timeseries-PILE
|
5 |
+
metrics:
|
6 |
+
- accuracy
|
7 |
+
- mse
|
8 |
+
- mae
|
9 |
+
- f1
|
10 |
+
tags:
|
11 |
+
- time series
|
12 |
+
- forecasting
|
13 |
+
- classification
|
14 |
+
- anomaly detection
|
15 |
+
- imputation
|
16 |
+
- transformers
|
17 |
+
- pretrained models
|
18 |
+
- foundation models
|
19 |
+
- time-series
|
20 |
+
pipeline_tag: time-series-forecasting
|
21 |
---
|
22 |
+
# MOMENT-Large
|
23 |
+
|
24 |
+
MOMENT is a family of foundation models for general-purpose time-series analysis. The models in this family (1) serve as a building block for diverse **time-series analysis tasks** (e.g., forecasting, classification, anomaly detection, and imputation, etc.), (2) are effective **out-of-the-box**, i.e., with no (or few) task-specific exemplars (enabling e.g., zero-shot forecasting, few-shot classification, etc.), and (3) are **tunable** using in-distribution and task-specific data to improve performance.
|
25 |
+
|
26 |
+
For details on MOMENT models, training data, and experimental results, please refer to the paper [MOMENT: A Family of Open Time-series Foundation Models](https://arxiv.org/pdf/2402.03885.pdf).
|
27 |
+
|
28 |
+
MOMENT-1 comes in 3 sizes: [Small](https://huggingface.co/AutonLab/MOMENT-1-small), [Base](https://huggingface.co/AutonLab/MOMENT-1-base), and [Large](https://huggingface.co/AutonLab/MOMENT-1-large).
|
29 |
+
|
30 |
+
# Usage
|
31 |
+
|
32 |
+
**Recommended Python Version:** Python 3.11 (support for additional versions is expected soon).
|
33 |
+
|
34 |
+
You can install the `momentfm` package using pip:
|
35 |
+
```bash
|
36 |
+
pip install momentfm
|
37 |
+
```
|
38 |
+
Alternatively, to install the latest version directly from the GitHub repository:
|
39 |
+
```bash
|
40 |
+
pip install git+https://github.com/moment-timeseries-foundation-model/moment.git
|
41 |
+
```
|
42 |
+
|
43 |
+
|
44 |
+
To load the pre-trained model for one of the tasks, use one of the following code snippets:
|
45 |
+
|
46 |
+
**Forecasting**
|
47 |
+
```python
|
48 |
+
from momentfm import MOMENTPipeline
|
49 |
+
|
50 |
+
model = MOMENTPipeline.from_pretrained(
|
51 |
+
"AutonLab/MOMENT-1-large",
|
52 |
+
model_kwargs={
|
53 |
+
'task_name': 'forecasting',
|
54 |
+
'forecast_horizon': 96
|
55 |
+
},
|
56 |
+
)
|
57 |
+
model.init()
|
58 |
+
```
|
59 |
+
|
60 |
+
**Classification**
|
61 |
+
```python
|
62 |
+
from momentfm import MOMENTPipeline
|
63 |
+
|
64 |
+
model = MOMENTPipeline.from_pretrained(
|
65 |
+
"AutonLab/MOMENT-1-large",
|
66 |
+
model_kwargs={
|
67 |
+
'task_name': 'classification',
|
68 |
+
'n_channels': 1,
|
69 |
+
'num_class': 2
|
70 |
+
},
|
71 |
+
)
|
72 |
+
model.init()
|
73 |
+
```
|
74 |
+
|
75 |
+
**Anomaly Detection, Imputation, and Pre-training**
|
76 |
+
```python
|
77 |
+
from momentfm import MOMENTPipeline
|
78 |
+
|
79 |
+
model = MOMENTPipeline.from_pretrained(
|
80 |
+
"AutonLab/MOMENT-1-large",
|
81 |
+
model_kwargs={"task_name": "reconstruction"},
|
82 |
+
)
|
83 |
+
mode.init()
|
84 |
+
```
|
85 |
+
|
86 |
+
**Representation Learning**
|
87 |
+
```python
|
88 |
+
from momentfm import MOMENTPipeline
|
89 |
+
|
90 |
+
model = MOMENTPipeline.from_pretrained(
|
91 |
+
"AutonLab/MOMENT-1-large",
|
92 |
+
model_kwargs={'task_name': 'embedding'},
|
93 |
+
)
|
94 |
+
```
|
95 |
+
|
96 |
+
### Tutorials
|
97 |
+
Here is the list of tutorials and reproducibile experiments to get started with MOMENT for various tasks:
|
98 |
+
- [Forecasting](https://github.com/moment-timeseries-foundation-model/moment/blob/main/tutorials/forecasting.ipynb)
|
99 |
+
- [Classification](https://github.com/moment-timeseries-foundation-model/moment/blob/main/tutorials/classification.ipynb)
|
100 |
+
- [Anomaly Detection](https://github.com/moment-timeseries-foundation-model/moment/blob/main/tutorials/anomaly_detection.ipynb)
|
101 |
+
- [Imputation](https://github.com/moment-timeseries-foundation-model/moment/blob/main/tutorials/imputation.ipynb)
|
102 |
+
- [Representation Learning](https://github.com/moment-timeseries-foundation-model/moment/blob/main/tutorials/representation_learning.ipynb)
|
103 |
+
- [Real-world Electrocardiogram (ECG) Case Study](https://github.com/moment-timeseries-foundation-model/moment/blob/main/tutorials/ptbxl_classification.ipynb) -- This tutorial also shows how to fine-tune MOMENT for a real-world ECG classification problem, performing training and inference on multiple GPUs and parameter efficient fine-tuning (PEFT).
|
104 |
+
|
105 |
+
## Model Details
|
106 |
+
|
107 |
+
### Model Description
|
108 |
+
|
109 |
+
- **Developed by:** [Auton Lab](https://autonlab.org/), [Carnegie Mellon University](https://www.cmu.edu/)
|
110 |
+
- **Model type:** Time-series Foundation Model
|
111 |
+
- **License:** MIT License
|
112 |
+
|
113 |
+
### Model Sources
|
114 |
+
|
115 |
+
<!-- Provide the basic links for the model. -->
|
116 |
+
|
117 |
+
- **Repository:** https://github.com/moment-timeseries-foundation-model/ (Pre-training and research code coming out soon!)
|
118 |
+
- **Paper:** https://arxiv.org/abs/2402.03885
|
119 |
+
- **Demo:** https://github.com/moment-timeseries-foundation-model/moment/tree/main/tutorials
|
120 |
+
|
121 |
+
|
122 |
+
## Environmental Impact
|
123 |
+
|
124 |
+
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
125 |
+
|
126 |
+
We train multiple models over many days resulting in significant energy usage and a sizeable carbon footprint. However, we hope that releasing our models will ensure that future time-series modeling efforts are quicker and more efficient, resulting in lower carbon emissions.
|
127 |
+
|
128 |
+
We use the Total Graphics Power (TGP) to calculate the total power consumed for training MOMENT models, although the total power consumed by the GPU will likely vary a little based on the GPU utilization while training our model. Our calculations do not account for power demands from other sources of our compute. We use 336.566 Kg C02/MWH as the standard value of CO2 emission per megawatt hour of energy consumed for [Pittsburgh](https://emissionsindex.org/).
|
129 |
+
|
130 |
+
- **Hardware Type:** NVIDIA RTX A6000 GPU
|
131 |
+
- **GPU Hours:** 404
|
132 |
+
- **Compute Region:** Pittsburgh, USA
|
133 |
+
- **Carbon Emission (tCO2eq):**
|
134 |
+
|
135 |
+
#### Hardware
|
136 |
+
|
137 |
+
All models were trained and evaluated on a computing cluster consisting of 128 AMD EPYC 7502 CPUs, 503 GB of RAM, and 8 NVIDIA RTX A6000 GPUs each with 49 GiB RAM. All MOMENT variants were trained on a single A6000 GPU (with any data or model parallelism).
|
138 |
+
|
139 |
+
## Citation
|
140 |
+
|
141 |
+
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
142 |
+
|
143 |
+
**BibTeX:**
|
144 |
+
If you use MOMENT please cite our paper:
|
145 |
+
|
146 |
+
```bibtex
|
147 |
+
@inproceedings{goswami2024moment,
|
148 |
+
title={MOMENT: A Family of Open Time-series Foundation Models},
|
149 |
+
author={Mononito Goswami and Konrad Szafer and Arjun Choudhry and Yifu Cai and Shuo Li and Artur Dubrawski},
|
150 |
+
booktitle={International Conference on Machine Learning},
|
151 |
+
year={2024}
|
152 |
+
}
|
153 |
+
```
|
154 |
+
|
155 |
+
**APA:**
|
156 |
+
|
157 |
+
Goswami, M., Szafer, K., Choudhry, A., Cai, Y., Li, S., & Dubrawski, A. (2024).
|
158 |
+
MOMENT: A Family of Open Time-series Foundation Models. In International Conference on Machine Learning. PMLR.
|
config.json
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{"task_name": "reconstruction",
|
2 |
+
"model_name": "MOMENT",
|
3 |
+
"transformer_type": "encoder_only",
|
4 |
+
"d_model": null,
|
5 |
+
"seq_len": 512,
|
6 |
+
"patch_len": 8,
|
7 |
+
"patch_stride_len": 8,
|
8 |
+
"device": "cpu",
|
9 |
+
"transformer_backbone": "google/flan-t5-large",
|
10 |
+
"model_kwargs": {},
|
11 |
+
"t5_config": {
|
12 |
+
"architectures": [
|
13 |
+
"T5ForConditionalGeneration"
|
14 |
+
],
|
15 |
+
"d_ff": 2816,
|
16 |
+
"d_kv": 64,
|
17 |
+
"d_model": 1024,
|
18 |
+
"decoder_start_token_id": 0,
|
19 |
+
"dropout_rate": 0.1,
|
20 |
+
"eos_token_id": 1,
|
21 |
+
"feed_forward_proj": "gated-gelu",
|
22 |
+
"initializer_factor": 1.0,
|
23 |
+
"is_encoder_decoder": true,
|
24 |
+
"layer_norm_epsilon": 1e-06,
|
25 |
+
"model_type": "t5",
|
26 |
+
"n_positions": 512,
|
27 |
+
"num_decoder_layers": 24,
|
28 |
+
"num_heads": 16,
|
29 |
+
"num_layers": 24,
|
30 |
+
"output_past": true,
|
31 |
+
"pad_token_id": 0,
|
32 |
+
"relative_attention_max_distance": 128,
|
33 |
+
"relative_attention_num_buckets": 32,
|
34 |
+
"tie_word_embeddings": false,
|
35 |
+
"use_cache": true,
|
36 |
+
"vocab_size": 32128
|
37 |
+
}
|
38 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a56928052ac6f5d09b97c3834bea6ce3aef9f02b513b5fac98954e7377801572
|
3 |
+
size 1385501256
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:52f5ee65c80790c7f6dab8736243368e193fcc04d2d642d9f69c89dd644bd199
|
3 |
+
size 1385575757
|