-
Download the data: Go to the IARAI website to download the traffic4cast 2019 competition data, upack it.
-
Train or download models:
-
If necessary, update the data paths in
model_training/unet_config.pyandmodel_training/graphnets_config.py -
run
model_training/unet_training.py,kipfdepth1_training.py,model_training/kipfdepth2_training.pyandmodel_training/graphresnet_training.pyfrom within the main directory (e.g.,python ./model_training/unet_training.py) to train the models (pretrained models are available here).
-
-
Run the generalization experiment:
- If necessary, update the data paths in
experiment/generalization_config.py - If you want to test your own models, update
config['model_tuple_list'] - run
experiment/generalization.pyto test all models on all cities.
- If necessary, update the data paths in
-
Plot:
- To reproduce the plot
output/performance_nb_params.pdfrunexperiment/plot_performance_vs_nbparams.py
- To reproduce the plot
All scripts should be executed in the root folder of the repository. E.g., python experiment/generalization.py
- Code:
-
experiment
generalization.py: This script runs the main experiment and calculates the loss for all Moscow trained models on Istanbul and Berlin. The results are stored inoutput/data_generalization.p'as a dictionary. -
model_training All scripts and configuration files necessary for the model training
*_training.pyfiles are used to train the corresponding networksgraphnets_config.pyhas all necessary configurations for the training of the different graph networksunet_config.pyhas all necessary configurations for the training of the different U-Nets- All training results are stored in
/runs/graphnetsor/runs/unetsrespectively
-
models
graph_models.pyandunet.pycontain the definitions for the different models used in this paper.
-
utils Helper functions for graph image-transformations and neural network training
-
- Data and results:
-
data Default directory for the raw data. Raw data has to be downloaded from the IARAI website.
-
images Graphs used in the paper
-
output
data_generalization.ppickle file with the results of the generalization experimentperformance_nb_params.pdfFigure 4 from theGraph-ResNets for short-term traffic forecasts in almost unknown citiespaper.
-
runs Folder that stores the tensorboard logs and the corresponding trained models. The trained models used in the paper are stored in
PMLR_netsall newly trained UNets are stored in theunetsfolder and all newly trained graph networks are stored in thegraphnetsfolder. Pretrained networks have to be downloaded from here
-
- We use PyTorch geometric to implement graph neural networks
- For reliable results the batch-size for graph networks must be set to 1