Skip to content

Commit

Permalink
Update net.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Yihui He 何宜晖 authored Sep 24, 2017
1 parent 3a2dae7 commit 78a8bf5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/net.py
Original file line number Diff line number Diff line change
Expand Up @@ -1340,7 +1340,7 @@ def setConv(c, d):
rank = rankdic[conv]
d_prime = rank
if d_c < rank: d_c = rank
'''VH'''
'''spatial decomposition'''
if True:
t.tic()
weights = self.param_data(conv)
Expand Down Expand Up @@ -1369,11 +1369,11 @@ def setConv(c, d):
print("V", V.shape)
print("H", H.shape)

t.toc('VH')
t.toc('spatial_decomposition')

self.insert(conv, conv_H)

'''ITQ'''
'''channel decomposition'''
if True:# and conv != 'conv3_3':
t.tic()
feats_dict, _ = self.extract_features(names=conv, points_dict=self._points_dict, save=1)
Expand All @@ -1394,9 +1394,9 @@ def setConv(c, d):

self.insert(conv_H, conv_P, pad=0, kernel_size=1, bias=True, stride=1)

t.toc('ITQ')
t.toc('channel_decomposition')

'''CR'''
'''channel pruning'''
if dcfgs.dic.vh and (conv in alldic or conv in pooldic) and (convnext in self.convs):
t.tic()
#if conv.startswith('conv4'):
Expand All @@ -1420,7 +1420,7 @@ def setConv(c, d):
self.WPQ[(key,1)] = self.WPQ[(key,1)][idxs]
self.set_conv(key, num_output=sum(idxs))

t.toc('CR')
t.toc('channel_pruning')
# setup V
H_params = {'bias':True}
H_params.update(self.infer_pad_kernel(self.WPQ[(conv_H, 0)], conv))
Expand Down

0 comments on commit 78a8bf5

Please sign in to comment.