PyTorch 实现 ESG
This is PyTorch implementation of ESG in the following paper:
Learning the Evolutionary and Multi-scale Graph Structure for Multivariate Time Series Forecasting
Dependency can be installed using the following command:
pip install -r requirements.txtSolar-Energy, Electricity, Exchange-rate datasets can be obtained from https://github.com/laiguokun/multivariate-time-series-data. Uncompress them , turn them into *.h5 files and move them to the data/h5data folder.
Wind dataset can be obtained from https://www.kaggle.com/sohier/30-years-of-european-wind-generation. Delete the CY column (All values are 0.) , and sum up the values of 24 hours per day to obtain the daily estimates of an area’s energy potential.
For convenience, you can directly download the *.h5 files of above datasets from the Google Drive or Baidu Yun, and move the h5data folder into the data folder.
Download NYC-Bike and NYC-Taxi datasets from Google Drive or Baidu Yun . Move *.h5 files into the data/h5data/ folder and put nyc-bike and nyc-taxi folders which contain train/test/val datasets into the data/ folder.
You can also run the following commands to generate train/test/val dataset at data/{nyc-bike,nyc-taxi}/{train,val,test}.npz by using *.h5 files.
cd data
# NYC-Bike
python gen_npz.py --h5_name nyc-bike
# NYC-Taxi
python gen_npz.py --h5_name nyc-taxipython train_single_step.py --data solar-energy --expid --num_nodes 137 --batch_size 16 --dy_embedding_dim 20 --runs 10 --horizon 3 python train_single_step.py --data electricity --expid --num_nodes 321 --batch_size 4 --dy_embedding_dim 20 --runs 10 --horizon 3 python train_single_step.py --data exchange-rate --expid --num_nodes 8 --batch_size 4 --dy_embedding_dim 16 --runs 10 --horizon 3 python train_single_step.py --data wind --expid --num_nodes 28 --batch_size 32 --dy_embedding_dim 20 --runs 10 --horizon 3 python train_multi_step.py --data nyc-bike --expid --num_nodes 250 --batch_size 16 --dy_embedding_dim 20 --runs 10python train_multi_step.py --data nyc-taxi --expid --num_nodes 266 --batch_size 16 --dy_embedding_dim 20 --runs 10You can run the following command to evaluate the test datasets using the trained model.
#Solar-Energy
python test_single.py --data solar-energy --horizon 24 --expid only_test
#Electricity
python test_single.py --data electricity --horizon 24 --expid only_test
#Exchange Rate
python test_single.py --data exchange-rate --horizon 24 --expid only_test
#wind
python test_single.py --data wind --horizon 24 --expid only_test
#NYC-Bike
python test_multi.py --data nyc-bike --expid only_test
#NYC-Taxi
python test_multi.py --data nyc-taxi --expid only_test
The implementation of ESG relies on resources from the following repository, we thank the original authors for open-sourcing their work.
https://github.com/nnzhan/MTGNN
Please consider citing if you find this code useful to your research.
…暂无开放 Issues,或尚未同步最近议题。