-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchart3.py
More file actions
26 lines (20 loc) · 728 Bytes
/
chart3.py
File metadata and controls
26 lines (20 loc) · 728 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
import numpy as np
import matplotlib.pyplot as plt
import os
def fnorm(arr):
vmax = np.max(arr)
vmin = np.min(arr)
return (arr-vmin)/(vmax-vmin)
file_path = 'importance_score/vgg_16_bn_limit5'
dct = np.load(os.path.join(file_path, 'imp_conv_10.npy'))
# dct = np.load(os.path.join(file_path, 'imp_norm_10.npy'))
# dct = np.load(os.path.join(file_path, 'imp_relu_10.npy'))
rank = np.load(os.path.join(file_path, 'rank_conv_10.npy'))
# rank = np.load(os.path.join(file_path, 'rank_norm_10.npy'))
# rank = np.load(os.path.join(file_path, 'rank_relu_10.npy'))
dct=fnorm(dct)
rank=fnorm(rank)
plt.plot(dct, label='dct')
plt.plot(rank, label='rank')
plt.legend(loc='best', frameon=False, prop = {'size':8})
plt.show()