-
Notifications
You must be signed in to change notification settings - Fork 1
/
results.py
34 lines (22 loc) · 1.14 KB
/
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
import pickle
def print_results(results_path, topx=100):
with open(results_path + '_retrieval.pickle', 'rb') as f:
results = pickle.load(f)
# print("Retrieval top-1", 100 * results['cifar10']['raw_precision'][0])
map_c = 100 * results['cifar10']['map']
top50_c = 100 * results['cifar10']['raw_precision'][topx-1]
with open(results_path + '_retrieval_e.pickle', 'rb') as f:
results = pickle.load(f)
map_e = 100 * results['cifar10']['map']
top50_e = 100 * results['cifar10']['raw_precision'][topx-1]
line = ' mAP (e) = %3.2f, mAP (c) = %3.2f, top-100 pr. (e) = %3.2f, top-100 pr. (c) = %3.2f' % (map_e, map_c, top50_e, top50_c)
print(line)
if __name__ == '__main__':
print("Teacher CIFAR10:")
print_results(results_path='./results/scores/teacher_baseline_cifar10')
print("Auxiliary CIFAR10:")
print_results(results_path='./results/scores/auxiliary_cifar10')
print("Student CIFAR10:")
print_results(results_path='./results/scores/student_baseline_cifar10')
print("InDistill-CLS CIFAR10:")
print_results(results_path='./results/scores/student_cifar10_indistill_pkt_cls')