-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanalysis.py
More file actions
39 lines (33 loc) · 885 Bytes
/
analysis.py
File metadata and controls
39 lines (33 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"""
This file is based on the TensorFlow tutorials
"""
"""
### Import TensorFlow
"""
import matplotlib.pyplot as plt
import pandas as pd #we will use this to save the training log
"""
We first load the training log
"""
history = pd.read_csv('rnn-training-history.csv')
"""
### We can see the training accuracy and testing accuracy as follows.
"""
plt.plot(history['accuracy'], label='accuracy')
plt.plot(history['val_accuracy'], label = 'val_accuracy')
plt.xlabel('Epoch')
plt.ylabel('Accuracy')
plt.ylim([0.5, 1])
plt.legend(loc='lower right')
plt.savefig('accuracy-plot.png')
plt.clf()
"""
### We can see the training and testing error as follows.
"""
plt.plot(history['loss'], label='Training Error')
plt.plot(history['val_loss'], label = 'Testing Error')
plt.xlabel('Epoch')
plt.ylabel('Loss')
#plt.ylim([0.5, 1])
plt.legend(loc='lower right')
plt.savefig('loss-plot.png')