witgaw commited on
Commit
eb23642
·
verified ·
1 Parent(s): 00133cb

Upload STGFORMER_PRETRAIN model trained on METR-LA

Browse files
README.md ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - traffic-forecasting
4
+ - time-series
5
+ - graph-neural-network
6
+ - stgformer_pretrain
7
+ datasets:
8
+ - metr-la
9
+ ---
10
+
11
+ # Spatial-Temporal Graph Transformer (Pretrain) - METR-LA
12
+
13
+ Spatial-Temporal Graph Transformer (Pretrain) (STGFORMER_PRETRAIN) trained on METR-LA dataset for traffic speed forecasting.
14
+
15
+ ## Model Description
16
+
17
+ STGFormer with masked node pretraining (curriculum: per-timestep -> per-node)
18
+
19
+
20
+
21
+ ## Dataset
22
+
23
+ **METR-LA**: Traffic speed data from highway sensors.
24
+
25
+ ## Usage
26
+
27
+ ```python
28
+ from utils.stgformer import load_from_hub
29
+
30
+ # Load model from Hub
31
+ model, scaler = load_from_hub("METR-LA", hf_repo_prefix="STGFORMER_PRETRAIN")
32
+
33
+ # Get predictions
34
+ from utils.stgformer import get_predictions
35
+ predictions = get_predictions(model, scaler, test_dataset)
36
+ ```
37
+
38
+ ## Training
39
+
40
+ Model was trained using the STGFORMER_PRETRAIN implementation with default hyperparameters.
41
+
42
+ ## Citation
43
+
44
+ If you use this model, please cite the original STGFORMER_PRETRAIN paper:
45
+
46
+ ```bibtex
47
+ @inproceedings{lan2022stgformer,
48
+ title={STGformer: Spatial-Temporal Graph Transformer for Traffic Forecasting},
49
+ author={Lan, Shengnan and Ma, Yong and Huang, Weijia and Wang, Wanwei and Yang, Hui and Li, Peng},
50
+ booktitle={IEEE Transactions on Neural Networks and Learning Systems},
51
+ year={2022}
52
+ }
53
+ ```
54
+
55
+ ## License
56
+
57
+ This model checkpoint is released under the same license as the training code.
config.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "num_nodes": 207,
3
+ "in_steps": 12,
4
+ "out_steps": 12,
5
+ "input_dim": 1,
6
+ "output_dim": 1,
7
+ "steps_per_day": 288,
8
+ "input_embedding_dim": 24,
9
+ "tod_embedding_dim": 24,
10
+ "dow_embedding_dim": 0,
11
+ "spatial_embedding_dim": 0,
12
+ "adaptive_embedding_dim": 80,
13
+ "num_heads": 4,
14
+ "num_layers": 3,
15
+ "dropout_a": 0.3,
16
+ "use_mixed_proj": true,
17
+ "model_dim": 128,
18
+ "dataset": "METR-LA",
19
+ "graph_mode": "learned",
20
+ "lambda_hybrid": 0.5,
21
+ "sparsity_k": null,
22
+ "propagation_mode": "power",
23
+ "temporal_mode": "transformer",
24
+ "mamba_d_state": 16,
25
+ "mamba_d_conv": 4,
26
+ "mamba_expand": 2,
27
+ "tcn_num_layers": 3,
28
+ "tcn_kernel_size": 3,
29
+ "tcn_dilation_base": 2,
30
+ "tcn_dropout": 0.1,
31
+ "use_zero_init": true
32
+ }
hub_metadata.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "dataset": "METR-LA",
3
+ "metrics": {},
4
+ "framework": "PyTorch",
5
+ "hf_repo_prefix": "STGFORMER_PRETRAIN",
6
+ "implementation": "internal"
7
+ }
metadata.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "dataset": "METR-LA",
3
+ "upload_date": "2025-12-07T20:12:44.070342",
4
+ "metrics": {},
5
+ "framework": "PyTorch",
6
+ "model_type": "STGFORMER_PRETRAIN"
7
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7bc3b7dbba0b56513a78ded78ffbedaa87b9810f06136daaf40974c12c7d2d0f
3
+ size 7231112
pretrained_checkpoint/hub_metadata.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "dataset": "METR-LA",
3
+ "checkpoint_type": "pretrained",
4
+ "framework": "PyTorch",
5
+ "hf_repo_prefix": "STGFORMER_PRETRAINED"
6
+ }
pretrained_checkpoint/imputation_head.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dad72f93fc148ecdd1897ad4b92e8cc347adc38bbdc2ebcae7fa1b6d1ddd3890
3
+ size 652
pretrained_checkpoint/metadata.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "dataset": "METR-LA",
3
+ "upload_date": "2025-12-07T19:53:28.410992",
4
+ "metrics": {},
5
+ "framework": "PyTorch",
6
+ "model_type": "PRETRAINED"
7
+ }
pretrained_checkpoint/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:545fe5933952da9b4be422274667c7e590360565596b6ed5cf1bf328231411b8
3
+ size 7231112
pretrained_checkpoint/pretrain_config.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "dataset_name": "METR-LA",
3
+ "pretrain_config": {
4
+ "stage1_epochs": 5,
5
+ "stage1_mask_ratio": 0.15,
6
+ "stage2_epochs": 5,
7
+ "stage2_mask_ratio": 0.1,
8
+ "pretrain_window": 24,
9
+ "learning_rate": 0.001,
10
+ "save_to": "STGFORMER_PRETRAINED"
11
+ },
12
+ "model_dim": 128,
13
+ "num_nodes": 207
14
+ }
scaler.json ADDED
The diff for this file is too large to render. See raw diff