-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdisplay_all_results.py
163 lines (130 loc) · 4.29 KB
/
display_all_results.py
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 20 20:44:05 2019
@author: RayKMAllen
"""
import pickle
from matplotlib import pyplot as plt
#%%
#Augmentation results:
savepath = 'saves/augmentresults/augresults.pkl'
results = pickle.load(open(savepath + '_prob', 'rb'))
po_results = pickle.load(open(savepath + '_pointonly', 'rb'))
plot_titles = ['Training loss', 'Validation loss', 'Training degree error',
'Validation degree error']
plot_labs = ['None', 'Shift', 'Flip', 'Rotate', 'Cutout', 'All']
for i in range(len(plot_titles)):
for n, j in enumerate(po_results):
plt.plot(j[i], label = plot_labs[n])
plt.xlabel('Epochs')
plt.title(plot_titles[i] + ' (Point only)')
plt.legend()
plt.grid()
plt.show()
for i in range(len(plot_titles)):
for n, j in enumerate(results):
plt.plot(j[i], label = plot_labs[n])
plt.xlabel('Epochs')
plt.title(plot_titles[i] + ' (Probabilistic, k = 5)')
plt.legend()
plt.grid()
plt.show()
for n, r in enumerate(po_results):
plt.plot(r[2], label = 'Training degree error')
plt.plot(r[3], label = 'Validation degree error')
plt.xlabel('Epochs')
plt.title(plot_labs[n] + ' (Point only)')
plt.legend()
plt.grid()
plt.show()
for n, r in enumerate(results):
plt.plot(r[0], label = 'Training loss')
plt.plot(r[1], label = 'Validation loss')
plt.xlabel('Epochs')
plt.title(plot_labs[n] + ' (Probabilistic, k = 5)')
plt.legend()
plt.grid()
plt.show()
for n, r in enumerate(results):
plt.plot(r[2], label = 'Training degree error')
plt.plot(r[3], label = 'Validation degree error')
plt.xlabel('Epochs')
plt.title(plot_labs[n])
plt.legend()
plt.grid()
plt.show()
#%%
#Num components results:
savepath = 'saves/componentresults/compresults.pkl'
results = pickle.load(open(savepath, 'rb'))
components = [1,2,3,4,5,6,8,10,20]
plot_titles = ['Training loss', 'Validation loss', 'Training degree error',
'Validation degree error']
plot_labs = components
for i in range(len(plot_titles)):
for n, j in enumerate(results):
if i % 2 == 0:
plt.plot(j[0][i//2], label = plot_labs[n])
else:
plt.plot(j[1][i//2], label = plot_labs[n])
plt.xlabel('Epochs')
plt.title(plot_titles[i])
plt.legend()
plt.grid()
plt.show()
#%%
#Main results by network:
plot_titles = ['Training loss', 'Validation loss', 'Training degree error',
'Validation degree error']
resolution, version = 112, 0
savepath = 'saves/mainresults/mainresults_{}_{}.pkl'.format(resolution, version)
save_info = pickle.load(open(savepath, 'rb'))
[results, plot_labs, train_times, pred_times, num_params] = save_info
results = results[:5]
for i in range(len(plot_titles)):
for n, j in enumerate(results):
plt.plot(j[i], label = plot_labs[n])
plt.xlabel('Epochs')
plt.title(plot_titles[i] + ' (Probabilistic, k = 10)')
plt.legend()
plt.grid()
plt.show()
for n, r in enumerate(results):
plt.plot(r[0], label = 'Training loss')
plt.plot(r[1], label = 'Validation loss')
plt.xlabel('Epochs')
plt.title(plot_labs[n] + ' (Probabilistic, k = 10)')
plt.legend()
plt.grid()
plt.show()
for n, r in enumerate(results):
plt.plot(r[2], label = 'Training degree error')
plt.plot(r[3], label = 'Validation degree error')
plt.xlabel('Epochs')
plt.title(plot_labs[n])
plt.legend()
plt.grid()
plt.show()
#%%
#Main results by resolution:
resolutions = [32, 64, 112]
version = 0
savepath = 'saves/mainresults/mainresults_{}_{}.pkl'
allresults = []
for res in resolutions:
save_info = pickle.load(open(savepath.format(res, version), 'rb'))
[results, plot_labs, train_times, pred_times, num_params] = save_info
results = results[:5]
allresults.append(results)
vallosses = []
for i in range(5):
for j in range(3):
lab = resolutions[j]
if lab == 112 and i == 4:
lab = 149
plt.plot(allresults[j][i][1], label = lab)
plt.xlabel('Epochs')
plt.title(plot_labs[i])
plt.legend()
plt.grid()
plt.show()