{"id":20517246,"url":"https://github.com/trustagi-lab/mtgode","last_synced_at":"2025-04-14T00:54:10.421Z","repository":{"id":41655598,"uuid":"509086754","full_name":"TrustAGI-Lab/MTGODE","owner":"TrustAGI-Lab","description":"[TKDE 2022] The official PyTorch implementation of the paper \"Multivariate Time Series Forecasting with Dynamic Graph Neural ODEs\".","archived":false,"fork":false,"pushed_at":"2022-11-10T02:29:40.000Z","size":117,"stargazers_count":81,"open_issues_count":0,"forks_count":27,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-27T14:55:26.733Z","etag":null,"topics":["graph-neural-networks","neural-odes","spatial-temporal-data","spatial-temporal-forecasting","time-series","time-series-forecasting"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TrustAGI-Lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-30T13:13:35.000Z","updated_at":"2025-03-25T15:24:55.000Z","dependencies_parsed_at":"2022-08-30T02:20:55.862Z","dependency_job_id":null,"html_url":"https://github.com/TrustAGI-Lab/MTGODE","commit_stats":null,"previous_names":["trustagi-lab/mtgode"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrustAGI-Lab%2FMTGODE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrustAGI-Lab%2FMTGODE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrustAGI-Lab%2FMTGODE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrustAGI-Lab%2FMTGODE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TrustAGI-Lab","download_url":"https://codeload.github.com/TrustAGI-Lab/MTGODE/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248804784,"owners_count":21164131,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graph-neural-networks","neural-odes","spatial-temporal-data","spatial-temporal-forecasting","time-series","time-series-forecasting"],"created_at":"2024-11-15T21:34:33.697Z","updated_at":"2025-04-14T00:54:10.399Z","avatar_url":"https://github.com/TrustAGI-Lab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MTGODE\n\n[![Arxiv link](https://img.shields.io/static/v1?label=arXiv\u0026message=MTGODE\u0026color=blue\u0026logo=arxiv)](https://arxiv.org/pdf/2202.08408.pdf)\n\nThis is the official PyTorch implementation of the paper \"[Multivariate Time Series Forecasting with Dynamic Graph Neural ODEs](https://arxiv.org/pdf/2202.08408.pdf)\", accepted to IEEE Transactions on Knowledge and Data Engineering (TKDE), 2022.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"./figures/MTGODE.png\" width=\"1200\"\u003e\n\u003c/p\u003e\n\n## Dependencies\n\n```\nnumpy==1.19.2\nscipy==1.5.4\ntorch==1.7.1\ntorchdiffeq==0.2.3\n```\nTo install all dependencies:\n```\npip install -r requirements.txt\n```\n\n## Download datasets\n\n+ You can download the datasets from [here](https://drive.google.com/drive/folders/1dPy46cXUO_fjKSLqa1mWtkwbkGsMO4PG?usp=sharing).\n\n+ Please put all dataset files under the ```./data``` directory.\n\n## Reproducibility\nHere we provide two examples (i.e., METR-LA and Electricity)\n### In terminal\n+ Option 1. Run the shell scripts (i.e., ```eleltricity.sh``` and ```metr-la.sh```)\n```\ncd run\nbash metr-la.sh\n```\n+ Option 2. Run the python files\n  + To run on METR-LA:\n  ```\n  python run_multi_step.py --data ./data/METR-LA --buildA_true True --expid 0 --runs 1 --device cuda:0 --save_preds False --num_nodes 207 --epochs 200 --batch_size 64 --learning_rate 0.001 --weight_decay 0.0001 --lr_decay True --lr_decay_steps 100 --lr_decay_rate 0.1 --dropout 0.3 --node_dim 40 --subgraph_size 20 --num_split 1 --tanhalpha 3 --conv_channels 64 --end_channels 128 --solver_1 euler --time_1 1.0 --step_1 0.25 --solver_2 euler --time_2 1.0 --step_2 0.25 --alpha 2.0 --rtol 1e-4 --atol 1e-3 --adjoint False --perturb False\n  ```\n  + To run on Electricity (horizon=3):\n  ```\n  python run_single_step.py --data ./data/electricity.txt --expid 0 --runs 1 --device cuda:0 --save_preds False --num_nodes 321 --horizon 3 --epochs 60 --batch_size 4 --lr 0.001 --weight_decay 0.0001 --lr_decay True --lr_decay_steps '20,40' --lr_decay_rate 0.5 --dropout 0.3 --node_dim 40 --subgraph_size 20 --num_split 1 --tanhalpha 3 --conv_channels 64 --end_channels 64 --solver_1 euler --time_1 1.0 --step_1 0.2 --solver_2 euler --time_2 1.0 --step_2 0.5 --alpha 1.0 --rtol 1e-4 --atol 1e-3 --adjoint False --perturb False\n  ```\n\n### Results\nHere we provide the results of the above two examples\n+ METR-LA\n```\nTraining finished\nThe valid loss on best model is 2.6909\nEvaluate best model on test data for horizon 1, Test MAE: 2.2302, Test MAPE: 0.0539, Test RMSE: 3.8937\nEvaluate best model on test data for horizon 2, Test MAE: 2.4785, Test MAPE: 0.0620, Test RMSE: 4.6105\nEvaluate best model on test data for horizon 3, Test MAE: 2.6491, Test MAPE: 0.0682, Test RMSE: 5.0816\nEvaluate best model on test data for horizon 4, Test MAE: 2.7805, Test MAPE: 0.0732, Test RMSE: 5.4578\nEvaluate best model on test data for horizon 5, Test MAE: 2.8886, Test MAPE: 0.0775, Test RMSE: 5.7657\nEvaluate best model on test data for horizon 6, Test MAE: 2.9818, Test MAPE: 0.0812, Test RMSE: 6.0234\nEvaluate best model on test data for horizon 7, Test MAE: 3.0659, Test MAPE: 0.0845, Test RMSE: 6.2481\nEvaluate best model on test data for horizon 8, Test MAE: 3.1410, Test MAPE: 0.0873, Test RMSE: 6.4417\nEvaluate best model on test data for horizon 9, Test MAE: 3.2070, Test MAPE: 0.0899, Test RMSE: 6.6087\nEvaluate best model on test data for horizon 10, Test MAE: 3.2681, Test MAPE: 0.0924, Test RMSE: 6.7568\nEvaluate best model on test data for horizon 11, Test MAE: 3.3243, Test MAPE: 0.0946, Test RMSE: 6.8920\nEvaluate best model on test data for horizon 12, Test MAE: 3.3835, Test MAPE: 0.0968, Test RMSE: 7.0258\n```\n+ Electricity (horizon=3)\n```\nfinal test rse 0.0728 | test rae 0.0415 | test corr 0.9431\n```\n\n## Cite us\n\nIf you use this code in your research, please cite the following article:\n\n```\n@article{jin2022multivariate,\n  title={Multivariate Time Series Forecasting with Dynamic Graph Neural ODEs},\n  author={Jin, Ming and Zheng, Yu and Li, Yuan-Fang and Chen, Siheng and Yang, Bin and Pan, Shirui},\n  journal={IEEE Transactions on Knowledge and Data Engineering (TKDE)},\n  year={2022}\n}\n```\n\n## Acknowledgement\nOur implementation adapts the code [here](https://github.com/nnzhan/MTGNN) as the code base and extensively adapts it to our purpose. We thank the authors for sharing their code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrustagi-lab%2Fmtgode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrustagi-lab%2Fmtgode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrustagi-lab%2Fmtgode/lists"}