From f45b45e2441854f1d026b0e1b030ff6b057cb70b Mon Sep 17 00:00:00 2001 From: chengxingyi Date: Fri, 6 Jan 2017 19:46:49 +0800 Subject: [PATCH] A traffic prediction demo for ASC17 --- demo/traffic_prediction/data/get_data.sh | 4 ++-- demo/traffic_prediction/dataprovider.py | 4 ++-- demo/traffic_prediction/gen_result.py | 2 +- demo/traffic_prediction/predict.sh | 2 +- demo/traffic_prediction/train.sh | 5 +---- demo/traffic_prediction/trainer_config.py | 4 ++-- 6 files changed, 9 insertions(+), 12 deletions(-) diff --git a/demo/traffic_prediction/data/get_data.sh b/demo/traffic_prediction/data/get_data.sh index 716faac76f..f2fa548d47 100755 --- a/demo/traffic_prediction/data/get_data.sh +++ b/demo/traffic_prediction/data/get_data.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2016 Baidu, Inc. All Rights Reserved +# Copyright (c) 2016 PaddlePaddle Authors, Inc. All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ cd $DIR #download the dataset echo "Downloading traffic data..." -wget http://paddlepaddle.bj.bcebos.com/demo/traffic/traffic_data.tar.gz +wget http://paddlepaddle.cdn.bcebos.com/demo/traffic/traffic_data.tar.gz #extract package echo "Unzipping..." diff --git a/demo/traffic_prediction/dataprovider.py b/demo/traffic_prediction/dataprovider.py index 19719350f2..c7883b6950 100644 --- a/demo/traffic_prediction/dataprovider.py +++ b/demo/traffic_prediction/dataprovider.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Baidu, Inc. All Rights Reserved +# Copyright (c) 2016 PaddlePaddle Authors, Inc. All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ from paddle.trainer.PyDataProvider2 import * import sys import numpy as np TERM_NUM = 24 -FORECASTING_NUM = 25 +FORECASTING_NUM = 24 LABEL_VALUE_NUM = 4 diff --git a/demo/traffic_prediction/gen_result.py b/demo/traffic_prediction/gen_result.py index d6c1b03370..3da70b3031 100644 --- a/demo/traffic_prediction/gen_result.py +++ b/demo/traffic_prediction/gen_result.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Baidu, Inc. All Rights Reserved +# Copyright (c) 2016 PaddlePaddle Authors, Inc. All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/demo/traffic_prediction/predict.sh b/demo/traffic_prediction/predict.sh index 2cc709f109..cec35dce11 100755 --- a/demo/traffic_prediction/predict.sh +++ b/demo/traffic_prediction/predict.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2016 Baidu, Inc. All Rights Reserved +# Copyright (c) 2016 PaddlePaddle Authors, Inc. All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/demo/traffic_prediction/train.sh b/demo/traffic_prediction/train.sh index bd1a1036b8..48dfc5604f 100755 --- a/demo/traffic_prediction/train.sh +++ b/demo/traffic_prediction/train.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2016 Baidu, Inc. All Rights Reserved +# Copyright (c) 2016 PaddlePaddle Authors, Inc. All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ set -e cfg=trainer_config.py -#TRAINER_BIN="./paddle_trainer" paddle train \ --config=$cfg \ --save_dir=./output \ @@ -25,6 +24,4 @@ paddle train \ --num_passes=10 \ --use_gpu=false \ --show_parameter_stats_period=3000 \ - --test_wait=1 - #--test_all_data_in_one_period=1 \ 2>&1 | tee 'train.log' diff --git a/demo/traffic_prediction/trainer_config.py b/demo/traffic_prediction/trainer_config.py index bb6a4ac987..52d678624a 100755 --- a/demo/traffic_prediction/trainer_config.py +++ b/demo/traffic_prediction/trainer_config.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Baidu, Inc. All Rights Reserved +# Copyright (c) 2016 PaddlePaddle Authors, Inc. All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ define_py_data_sources2( train_list=trn, test_list=tst, module="dataprovider", obj=process) ################################### Parameter Configuaration ####################################### TERM_NUM = 24 -FORECASTING_NUM = 25 +FORECASTING_NUM = 24 emb_size = 16 batch_size = 128 if not is_predict else 1 settings( -- GitLab