We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent df7ae09 commit 4d66785Copy full SHA for 4d66785
pruning/methods.py
@@ -32,7 +32,6 @@ def prune_one_filter(model, masks):
32
kernel weights
33
arXiv:1611.06440
34
'''
35
-
36
NO_MASKS = False
37
# construct masks if there is not yet
38
if not masks:
@@ -52,6 +51,9 @@ def prune_one_filter(model, masks):
52
51
# find the scaled l2 norm for each filter this layer
53
value_this_layer = np.square(p_np).sum(axis=1).sum(axis=1)\
54
.sum(axis=1)/(p_np.shape[1]*p_np.shape[2]*p_np.shape[3])
+ # normalization (important)
55
+ value_this_layer = value_this_layer / \
56
+ np.sqrt(np.square(value_this_layer).sum())
57
min_value, min_ind = arg_nonzero_min(list(value_this_layer))
58
values.append([min_value, min_ind])
59
0 commit comments