Meta-learning Multiple Transportation Pattern for Traffic Demand Prediction
Please refer to the files under preprocess/.
conda create -n $ENV_NAME$ python=3.7
conda activate $ENV_NAME$
# Install compatible PyTorch 1.11.0, for example, for CUDA 11.3
pip install torch==1.11.0+cu113 --extra-index-url https://download.pytorch.org/whl/cu113
# Or, CUDA 10.2
pip install torch==1.11.0+cu102 --extra-index-url https://download.pytorch.org/whl/cu102
pip install -r requirements.txt
You can download our trained meta auto-encoder models and demand prediction model. Place them under the directory results/saved_models/
costnet/
results/saved_models/
MLAEN_1/
bike_drop.pth
bike_pickup.pth
taxi_drop.pth
taxi_pickup.pth
Ours_best/
best.pth
preprocess/
costnet/
...
python train.py --model AutoEncoder --trainer MLAE --ddir ../datasets/ --dname multi-nyc-ae --config MLAE_config
python train.py --model Ours --trainer CoSTNet --ddir ../datasets/ --dname multi-nyc-lstm --config Ours_config
You can also train the baseline models, by just changing the arguments model
. Delte the argument trainer
. Similarly, the code loads $MODEL_NAME$_config.py
by default. Below lists the available baseline models.
- MLP
- ConvLSTM
- STResNet
python test.py --model Ours --trainer CoSTNet --ddir ../datasets/ --dname multi-nyc-lstm --config Ours_config --ckpt ../results/saved_models/Ours_best/best.pth
Similarly, you can also test the baseline models, by just changing the arguments.
python train.py --model AutoEncoder --ddir ../datasets/ --dname multi-nyc-ae
python train.py --model CoSTNet --ddir ../datasets/ --dname multi-nyc-lstm
python test.py --model CoSTNet --ddir ../datasets/ --dname multi-nyc-lstm --ckpt $CKPT_PATH$