-
Notifications
You must be signed in to change notification settings - Fork 5
/
Accuracy_Curve_Loss_curve_Unhappiness_score
83 lines (52 loc) · 1.25 KB
/
Accuracy_Curve_Loss_curve_Unhappiness_score
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# coding: utf-8
# In[1]:
get_ipython().magic(u'matplotlib inline')
# In[41]:
file_out = open("out.txt","r+")
x_epoch=[]
y=[]
accuracy=[]
acq = []
for line in file_out:
if 'Epoch' in line:
m = line.split()
x_epoch.append(int(m[1]))
y.append(float(m[7]))
if 'Accuracy' in line:
acc= line.split()
accuracy.append(float(acc[1])*100.0)
acq.append(acc[1])
print("Unhappiness score of the model is {}".format( sum(y)/545 ))
# In[8]:
import matplotlib.pyplot as plt
plt.plot(x_epoch, 'bo', y,'k')
#plt.axis([0, 600, 0, 80000])
plt.ylabel("loss function score")
plt.xlabel("Number of Epoch")
plt.show()
# In[7]:
import matplotlib.pyplot as plt
plt.plot(x_epoch,accuracy,'.')
#plt.axis([0, 600, 0, 80000])
plt.ylabel("Accuracy Percentage")
plt.xlabel("Number of Epoch")
plt.show()
# In[47]:
fig = plt.figure()
fig.set_size_inches(16, 12)
ax = plt.axes()
plt.ylabel("Accuracy Percentage")
plt.xlabel("Number of Epoch")
ax.plot(x_epoch, accuracy)
plt.show()
fig.savefig('accuracy.png')
# In[48]:
fig = plt.figure()
fig.set_size_inches(16, 12)
ax = plt.axes()
plt.ylabel("loss function score")
plt.xlabel("Number of Epoch")
plt.ylim(1, 1000)
plt.xlim(1, 600)
ax.plot(x_epoch, y)
fig.savefig('loss.png')