Pruning Options
Contents
Policy
The policy of the NetsPresso Model Compressor allows for pruning connected filters or neurons identically using the given pruning criteria while preserving the information.
To calculate the importance score of the connected neurons or filters, “Sum”, “Average”, or “Backward” can be used as policies (for more details, please refer to the following documents).
Layer Norm
The normalization process is necessary to compare the importance score of different layer’s filters or neurons.
Group Policy
The reshape and group convolutional operator should prune the same number of filters for each group to preserve the shape of the weight or arguments.
For this reason, the group policy is used to ensure that the same number of filters are pruned for each group.
Sum
The group policy “sum” calculates its importance score as the summation value of the corresponding filter index of all groups.
Average
The group policy “Average” calculates its importance score as the average value of the corresponding filter index of all groups.
Reshape Channel Axis
Reshape channel axis represents which axis of the reshape operator will be pruned.
Ex. Consider the input of the given reshape operator is batch, 768, 197 and the output of the reshape operator is batch, 12, 64, 197
If the reshape_channel_axis is -1 or 1 when the given pruning ratio is 50%, the output model will contain 32 (64*0.5) channels of the given reshape operator.
If the reshape_channel_axis is -2 or 0 when the given pruning ratio is 50%, the output model will contain 6 (12*0.5) channels of the given reshape operator.