Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
matplotlib==2.2.2
numpy==1.14.3
pillow==5.1.0
tensorflow==1.8.0
2 changes: 1 addition & 1 deletion test_input_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions train_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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__':
Expand Down
2 changes: 1 addition & 1 deletion train_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__':
Expand Down
2 changes: 1 addition & 1 deletion train_lstm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
2 changes: 1 addition & 1 deletion train_lstm_multivariate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')