From 52f8e0e67a7bdf5c5ead8a8def9f2da654334966 Mon Sep 17 00:00:00 2001 From: vmlaker Date: Mon, 14 May 2018 08:56:58 -0700 Subject: [PATCH 1/3] Add Python requirements file. --- requirements.txt | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..76f3d93 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +matplotlib==2.2.2 +numpy==1.14.3 +pillow==5.1.0 +tensorflow==1.8.0 From 33f6f0fcf25693072258709975ae44e448ee30bb Mon Sep 17 00:00:00 2001 From: vmlaker Date: Mon, 14 May 2018 08:57:08 -0700 Subject: [PATCH 2/3] Add the makefile. --- Makefile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e16f8d0 --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +all: examples + +venv: requirements.txt + test -d venv || virtualenv -p python3 venv + . venv/bin/activate && pip install -r requirements.txt + +examples: venv + ./venv/bin/python ./test_input_csv.py + ./venv/bin/python ./test_input_array.py + ./venv/bin/python ./train_csv.py + ./venv/bin/python ./train_array.py + ./venv/bin/python ./train_lstm.py + ./venv/bin/python ./train_lstm_multivariate.py + +clean: + rm -rf venv *.jpg From 600da9f6f104ca5bd42a5bbadbd9f6791c4c187d Mon Sep 17 00:00:00 2001 From: vmlaker Date: Mon, 14 May 2018 09:07:28 -0700 Subject: [PATCH 3/3] Fix image filenames to reflect naming in img/ directory. --- test_input_array.py | 2 +- train_array.py | 4 ++-- train_csv.py | 2 +- train_lstm.py | 2 +- train_lstm_multivariate.py | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test_input_array.py b/test_input_array.py index 47f9c12..2a75cc3 100644 --- a/test_input_array.py +++ b/test_input_array.py @@ -12,7 +12,7 @@ noise = np.random.uniform(-0.2, 0.2, 1000) y = np.sin(np.pi * x / 100) + x / 200. + noise plt.plot(x, y) -plt.savefig('timeseries_y.jpg') +plt.savefig('test_input_timeseries_y.jpg') data = { tf.contrib.timeseries.TrainEvalFeatures.TIMES: x, diff --git a/train_array.py b/train_array.py index 1049cde..1899354 100644 --- a/train_array.py +++ b/train_array.py @@ -13,7 +13,7 @@ def main(_): noise = np.random.uniform(-0.2, 0.2, 1000) y = np.sin(np.pi * x / 100) + x / 200. + noise plt.plot(x, y) - plt.savefig('timeseries_y.jpg') + plt.savefig('array_timeseries_y.jpg') data = { tf.contrib.timeseries.TrainEvalFeatures.TIMES: x, @@ -47,7 +47,7 @@ def main(_): plt.xlabel('time_step') plt.ylabel('values') plt.legend(loc=4) - plt.savefig('predict_result.jpg') + plt.savefig('array.jpg') if __name__ == '__main__': diff --git a/train_csv.py b/train_csv.py index 18c89dc..05354a9 100644 --- a/train_csv.py +++ b/train_csv.py @@ -40,7 +40,7 @@ def main(_): plt.xlabel('time_step') plt.ylabel('values') plt.legend(loc=4) - plt.savefig('predict_result.jpg') + plt.savefig('csv.jpg') if __name__ == '__main__': diff --git a/train_lstm.py b/train_lstm.py index 3bfcee3..9024687 100644 --- a/train_lstm.py +++ b/train_lstm.py @@ -196,4 +196,4 @@ def _exogenous_input_step( predicted_lines = plt.plot(predicted_times, predicted, label="prediction", color="r") plt.legend(handles=[observed_lines[0], evaluated_lines[0], predicted_lines[0]], loc="upper left") - plt.savefig('predict_result.jpg') + plt.savefig('lstm.jpg') diff --git a/train_lstm_multivariate.py b/train_lstm_multivariate.py index 7686ac5..dd4eec3 100644 --- a/train_lstm_multivariate.py +++ b/train_lstm_multivariate.py @@ -187,4 +187,4 @@ def _exogenous_input_step( predicted_lines = plt.plot(predicted_times, predicted, label="prediction", color="r") plt.legend(handles=[observed_lines[0], evaluated_lines[0], predicted_lines[0]], loc="upper left") - plt.savefig('predict_result.jpg') + plt.savefig('lstm_multivariate.jpg')