Open hunterkun opened 5 years ago
This part is used to adjust alpha
to reach the desired pruning ratio for the current layer.
yeah, i have knew that it is used to adjust alpha
, but wonder the way you did comes from what kind of algorithm. i'm not clearly understand why left and right of alpha are adjusted like that.
The pruning ratio changes monotonically w.r.t. the value of alpha
, so we do a bi-search to determine which alpha
can give us the desired pruning ratio.
Thanks for your instant reply. I have one more question, what is the intention of getting around the case abs(left - right) <= right * 0.1
and the way you adjust lbound
, rbound
and left
.
elif abs(left - right) <= right * 0.1:
if lbound > 1:
lbound = lbound - 1
if rbound < c_in:
rbound = rbound + 1
left = left / 1.2
right = right * 1.2
@psyyz10 Can you take a look at this?
The following code snippet makes me puzzled. I know it is used to select
c_new
channels from c_in. WHY the lbound, rbound for channels and left, right foralpha
are adjusted as you write. The original paper seems not talk about how to adjust those to find thec_new
. https://github.com/Tencent/PocketFlow/blob/master/learners/channel_pruning/channel_pruner.py#L549-L565