-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot-together.py
More file actions
29 lines (23 loc) · 867 Bytes
/
plot-together.py
File metadata and controls
29 lines (23 loc) · 867 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
from lib.util import read_list
import matplotlib.pyplot as plt
path = 'prediction/validation/IBM1/VI/VALIDATION/'
savepath = path
names = ['random-init-1', 'random-init-2', 'random-init-3', 'uniform-init', 'pretrained-init']
labels = ['random-1', 'random-2', 'random-3', 'uniform', 'pretrained']
# labels = ['EM', 'VI']
# names = ['EM-10k', 'VI-10k']
handles = []
for i, name in enumerate(names):
aers = read_list(path + name + '/AERs')
ax = plt.plot(range(len(aers[0:14])), aers[0:14], label=labels[i])
handles.extend(ax)
plt.legend(handles, labels)
plt.savefig(savepath + 'AERs-together.pdf')
plt.clf()
handles = []
for i, name in enumerate(names):
aers = read_list(path + name + '/likelihoods')
ax = plt.plot(range(len(aers[0:14])), aers[0:14], label=labels[i])
handles.extend(ax)
plt.legend(handles, labels)
plt.savefig(savepath + 'likelihoods.pdf')