Title: DEEPHOYER: LEARNING SPARSER NEURAL NETWORK WITH DIFFERENTIABLE SCALE-INVARIANT SPARSITY MEASURES

Abstract: In seeking for sparse and efficient neural network models, many previous works investigated on enforcing 1 or 0 regularizers to encourage weight sparsity during training. The 0 regularizer measures the parameter sparsity directly and is invariant to the scaling of parameter values. But it cannot provide useful gradients and therefore requires complex optimization techniques. The 1 regularizer is almost everywhere differentiable and can be easily optimized with gradient descent. Yet it is not scale-invariant and causes the same shrinking rate to all parameters, which is inefficient in increasing sparsity. Inspired by the Hoyer measure (the ratio between 1 and 2 norms) used in traditional compressed sensing problems, we present DeepHoyer, a set of sparsity-inducing regularizers that are both differentiable almost everywhere and scale-invariant. Our experiments show that enforcing DeepHoyer regularizers can produce even sparser neural network models than previous works, under the same accuracy level. We also show that DeepHoyer can be applied to both element-wise and structural pruning. The codes are available at https://github.com/yanghr/DeepHoyer.

1. INTRODUCTION:

The use of deep neural network (DNN) models has been expanded from handwritten digit recognition (LeCun et al., 1998) to real-world applications, such as large-scale image classification (Simonyan & Zisserman, 2014) , self driving (Makantasis et al., 2015) and complex control problems (Mnih et al., 2013) . However, a modern DNN model like AlexNet (Krizhevsky et al., 2012) or ResNet (He et al., 2016) often introduces a large number of parameters and computation load, which makes the deployment and real-time processing on embedded and edge devices extremely difficult (Han et al., 2015b; a; Wen et al., 2016) . Thus, model compression techniques, especially pruning methods that increase the sparsity of weight matrices, have been extensively studied to reduce the memory consumption and computation cost of DNNs (Han et al., 2015b; a; Wen et al., 2016; Guo et al., 2016; Louizos et al., 2017b; Luo et al., 2017; Zhang et al., 2018; Liu et al., 2015) .

Most of the previous works utilize some form of sparsity-inducing regularizer in searching for sparse neural networks. The 1 regularizer, originally proposed by Tibshirani (1996) , can be easily optimized through gradient descent for its convex and almost everywhere differentiable property. Therefore it is widely used in DNN pruning: Liu et al. (2015) directly apply 1 regularization to all the weights of a DNN to achieve element-wise sparsity; Wen et al. (2016; 2017) present structural sparsity via group lasso, which applies an 1 regularization over the 2 norms of different groups of parameters. However, it has been noted that the value of the 1 regularizer is proportional to the scaling of parameters (i.e. ||αW || 1 = |α|•||W || 1 ), so it "scales down" all the elements in the weight matrices with the same speed. This is not efficient in finding sparsity and may sacrifice the flexibility of the trained model. On the other hand, the 0 regularizer directly reflects the real sparsity of weights and is scale invariant (i.e. ||αW || 0 = ||W || 0 , ∀α = 0), yet the 0 norm cannot provide useful gradients. Han et al. (2015b) enforce an element-wise 0 constraint by iterative pruning a fixed percentage of smallest weight elements, which is a heuristic method and therefore can hardly achieve optimal compression rate. Some recent works mitigate the lack of gradient information by integrating 0 regularization with stochastic approximation (Louizos et al., 2017b) or more complex optimization methods (e.g. ADMM) (Zhang et al., 2018) . These additional measures brought overheads to the optimization process, making the use of these methods on larger networks difficult. To achieve even sparser neural networks, we argue to move beyond 0 and 1 regularizers and seek for a sparsity-inducing regularizer that is both almost everywhere differentiable (like 1 ) and scale-invariant (like 0 ).

Beyond the 1 regularizer, plenty of non-convex sparsity measurements have been used in the field of feature selection and compressed sensing (Hurley & Rickard, 2009; Wen et al., 2018) . Some popular regularizers like SCAD (Fan & Li, 2001) , MDP (Zhang et al., 2010) and Trimmed 1 (Yun et al., 2019) use a piece-wise formulation to mitigate the proportional scaling problem of 1 . The piece-wise formulation protects larger elements by having zero penalty to elements greater than a predefined threshold. However, it is extremely costly to manually seek for the optimal trimming threshold, so it is hard to obtain optimal result in DNN pruning by using these regularizers. The transformed 1 regularizer formulated as N i=1

(a+1)|wi| a+|wi| manages to smoothly interpolate between 1 and 0 by tuning the hyperparameter a (Ma et al., 2019) . However, such an approximation is close to 0 only when a approaches infinity, so the practical formulation of the transformed 1 (i.e. a = 1) is still not scale-invariant.

Particularly, we are interested in the Hoyer regularizer (Hoyer, 2004) , which estimates the sparsity of a vector with the ratio between its 1 and 2 norms. Comparing to other sparsity-inducing regularizers, Hoyer regularizer achieves superior performance in the fields of non-negative matrix factorization (Hoyer, 2004) , sparse reconstruction (Esser et al., 2013; Tran et al., 2018) and blend deconvolution (Krishnan et al., 2011; Repetti et al., 2015) . We note that Hoyer regularizer is both almost everywhere differentiable and scale invariant, satisfying the desired property of a sparsityinducing regularizer. We therefore propose DeepHoyer, which is the first Hoyer-inspired regularizers for DNN sparsification. Specifically, the contributions of this work include:

• Hoyer-Square (HS) regularizer for element-wise sparsity: We enhance the original Hoyer regularizer to the HS regularizer and achieve element-wise sparsity by applying it in the training of DNNs. The HS regularizer is both almost everywhere differentiable and scale invariant. It has the same range and minima structure as the 0 norm. Thus, the HS regularizer presents the ability of turning small weights to zero while protecting and maintaining those weights that are larger than an induced, gradually adaptive threshold; • Group-HS regularizer for structural sparsity, which is extended from the HS regularizer;

• Generating sparser DNN models: Our experiments show that the proposed regularizers beat state-of-the-arts in both element-wise and structural weight pruning of modern DNNs.

2. RELATED WORK ON DNN PRUNING:

It is well known that high redundancy pervasively exists in DNNs. Consequently, pruning methods have been extensively investigated to identify and remove unimportant weights. Some heuristic pruning methods (Han et al., 2015b; Guo et al., 2016) simply remove weights in small values to generate sparse models. These methods usually require long training time without ensuring the optimality, due to the lack of theoretical understanding and well-formulated optimization (Zhang et al., 2018) . Some works formulate the problem as a sparsity-inducing optimization problem, such as 1 regularization (Liu et al., 2015; Park et al., 2016) that can be optimized using standard gradientbased algorithms, or 0 regularization (Louizos et al., 2017b; Zhang et al., 2018) 2017) incorporate both Lasso regression and reconstruction error into the optimization problem. Bayesian optimization methods have also been applied for neuron pruning (Louizos et al., 2017a; Neklyudov et al., 2017) , yet these methods are not applicable in large-scale problems like ImageNet. We further advance the DeepHoyer to learn structured sparsity (such as reducing filters and channels) with the newly proposed "Group-HS" regularization. The Group-HS regularizer further improves the computation reduction of the LeNet-5 model by 8.8% from the 1 based method (Wen et al., 2016) , and by 110.6% from the 0 based method (Louizos et al., 2017b) . Experiments on ResNet models reveal that the accuracy-speedup tradeoff induced by Group-HS constantly stays above the Pareto frontier of previous methods. More detailed results can be found in Section 5.

3. MEASURING SPARSITY WITH THE HOYER MEASURE:

Sparsity measures provide tractable sparsity constraints for enforcement during problem solving and therefore have been extensively studied in the compressed sensing society. In early non-negative matrix factorization (NMF) research, a consensus was that a sparsity measure should map a ndimensional vector X to a real number S ∈ [0, 1], such that the possible sparsest vectors with only one nonzero element has S = 1, and a vector with all equal elements has S = 0 (Hoyer, 2004) . Unders the assumption, the Hoyer measure was proposed as follows

EQUATION

It can be seen that

EQUATION

Thus, the normalization in Equation ( 1) fits the measure S(X) into the [0, 1] interval. According to the survey by Hurley & Rickard (2009) , among the six desired heuristic criteria of sparsity measures, the Hoyer measure satisfies five, more than all other commonly applied sparsity measures. Given its success as a sparsity measure in NMF, the Hoyer measure has been applied as a sparsity-inducing regularizer in optimization problems such as blind deconvolution (Repetti et al., 2015) and image deblurring (Krishnan et al., 2011) . Without the range constraint, the Hoyer regularizer in these works adopts the form R(X)

= i |xi| √ i x 2 i

directly, as the ratio of the 1 and 2 norms.

Figure 1 compares the Hoyer regularizer and the 1 regularizer. Unlike the the 1 norm with a single minimum at the origin, the Hoyer regularizer has minima along axes, the structure of which is very similar to the 0 norm's. Moreover, the Hoyer regularizer is scale-invariant, i.e. R(αX) = R(X), because both the 1 norm and the 2 norm are proportional to the scale of X. The gradients of the Hoyer regularizer are purely radial, leading to "rotations" towards the nearest axis. These features make the Hoyer regularizer outperform the 1 regularizer on various tasks (Esser et al., 2013; Tran et al., 2018; Krishnan et al., 2011; Repetti et al., 2015) . The theoretical analysis by Yin et al. (2014) also proves that the Hoyer regularizer has a better guarantee than the 1 norm on recovering sparse solutions from coherent and redundant representations.

4. MODEL COMPRESSION WITH DEEPHOYER REGULARIZERS:

Inspired by the Hoyer regularizer, we propose two types of DeepHoyer regularizers: the Hoyer-Square regularizer (HS) for element-wise pruning and the Group-HS regularizer for structural pruning.

4.1. HOYER-SQUARE REGULARIZER FOR ELEMENT-WISE PRUNING:

Since the process of the element-wise pruning is equivalent to regularizing each layer's weight with the 0 norm, it is intuitive to configure the sparsity-inducing regularizer to have a similar behavior as the 0 norm. As shown in Inequality ( 2), the value of the original Hoyer regularizer of a Ndimensional nonzero vector lies between 1 and √ N , while its 0 norm is within the range of [1, N ]. Thus we propose to apply the square of Hoyer regularizer, namely Hoyer-Square (HS), to the weights W of a layer, like

EQUATION

The proposed HS regularizer behaves as a differentiable approximation to the 0 norm. First, both regularizers now have the same range of

[1, N ]. Second, H S is scale invariant as H S (αW ) = H S (W )

holds for ∀α = 0, so as the 0 norm. Moreover, as the squaring operator monotonously increases in the range of [1,

√ N ], the Hoyer-Square regularizer's minima remain along the axes as the Hoyer regularizer's do (see Figure 1 ). In other words, they have similar minima structure as the 0 norm. At last, the Hoyer-Square regularizer is also almost everywhere differentiable and Equation ( 4) formulates the gradient of H S w.r.t. an element w j in the weight matrix W :

EQUATION

Very importantly, this formulation induces a trimming effect: when H S (W ) is being minimized through gradient descent, w j moves towards 0 if |w j |< i w 2 i i |wi| , otherwise moves away from 0. In other words, unlike the 1 regularizer which tends to shrink all elements, our Hoyer-Square regularizer will turn weights in small value to zero meanwhile protecting large weights. Traditional trimmed regularizers (Fan & Li, 2001; Zhang et al., 2010; Yun et al., 2019) usually define a trimming threshold as a fixed value or percentage. Instead, the HS regularizer can gradually extend the scope of pruning as more weights coming close to zero. This behavior can be observed in the gradient descent path shown in Figure 2 .

4.2. GROUP-HS REGULARIZER FOR STRUCTURAL PRUNING:

Beyond element-wise pruning, structural pruning is often more preferred because it can construct the sparsity in a structured way and therefore achieve higher computation speed-up on general computation platforms (Wen et al., 2016) . The structural pruning is previously empowered by the group lasso (Yuan & Lin, 2006; Wen et al., 2016) , which is the sum (i.e. 1 norm) of the 2 norms of all the groups within a weight matrix like

EQUATION

)

where ||W || 2 = i w 2 i represents the 2 norm, w (g) is a group of elements in the weight matrix W which consists of G such groups.

Following the same approach in Section 4.1, we use the Hoyer-Square regularizer to replace the 1 regularizer in the group lasso formulation and define the Group-HS (G H ) regularizer in Equation ( 6): Note that the second equality holds when and only when the groups cover all the elements of W without overlapping with each other. Our experiments in this paper satisfy this requirement. However, the Group-HS regularizer can always be used in the form of the first equality when overlapping exists across groups. The gradient and the descent path of the Group-HS regularizer are very similar to those of the Hoyer-Square regularizer, and therefore we omit the detailed discussion here. The derivation of the Group-HS regularizer's gradient shall be found in Appendix A.

EQUATION

)

4.3. APPLY DEEPHOYER REGULARIZERS IN DNN TRAINING:

The deployment of the DeepHoyer regularizers in DNN training follows the common layer-based regularization approach (Wen et al., 2016; Liu et al., 2015) . For element-wise pruning, we apply the Hoyer-Square regularizer to layer weight matrix W (l) for all L layers, and directly minimize it alongside the DNN's original training objective L(W (1:L) ). The 2 regularizer can also be added to the objective if needed. Equation ( 7) presents the training objective with H S defined in Equation (3).

Here, α and β are pre-selected weight decay parameters for the regularizers.

min

EQUATION

For structural pruning, we mainly focus on pruning the columns and rows of fully connected layers and the filters and channels of convolutional layers. More specific, we group a layer in filter-wise and channel-wise fashion as proposed by Wen et al. (2016) and then apply the Group-HS regularizer to the layer. The resulted optimization objective is formulated in Equation ( 8).

min

W (1:L) L(W (1:L) ) + L l=1 (α n ( N l n l =1 ||w (l) n l ,:,:,: || 2 ) 2 ||W (l) || 2 2 + α c ( C l c l =1 ||w (l) :,c l ,:,: || 2 ) 2 ||W (l) || 2 2 + β||W (l) || 2 ). (8)

Here N l is the number of filters and C l is the number of channels in the l th layer if it is a convolutional layer. If the l th layer is fully connected, then N l and C l is the number of rows and columns respectively. α n , α c and β are pre-selected weight decay parameters for the regularizers.

The recent advance in stochastic gradient descent (SGD) method provides satisfying results under large-scale non-convex settings (Sutskever et al., 2013; Kingma & Ba, 2014) , including DNNs with non-convex objectives (Auer et al., 1996) . So we can directly optimize the DeepHoyer regularizers with the same SGD optimizer used for the original DNN training objective, despite their nonconvex formulations. Our experiments show that the tiny-bit nonconvexity induced by DeepHoyer does not affect the performance of DNNs.

The pruning is conducted by following the common three-stage operations: (1) train the DNN with the DeepHoyer regularizer, (2) prune all the weight elements smaller than a predefined small threshold, and (3) finetune the model by fixing all the zero elements and removing the DeepHoyer regularizer. 

5. EXPERIMENT RESULT:

The proposed DeepHoyer regularizers are first tested on the MNIST benchmark using the LeNet-300-100 fully connected model and the LeNet-5 CNN model (LeCun et al., 1998) . We also conduct tests on the CIFAR-10 dataset (Krizhevsky & Hinton, 2009) with ResNet models (He et al., 2016) in various depths, and on ImageNet ILSVRC-2012 benchmark (Russakovsky et al., 2015) with the AlexNet model (Krizhevsky et al., 2012) and the ResNet-50 model (He et al., 2016) . All the models are implemented and trained in the PyTorch deep learning framework (Paszke et al., 2017) , where we match the model structure and the benchmark performance with those of previous works for the fairness of comparison. The experiment results presented in the rest of this section show that the proposed DeepHoyer regularizers consistently outperform previous works in both element-wise and structural pruning. Detailed information on the experiment setups and the parameter choices of our reported results can be found in Appendix B. the compression rate by 21.3×. This result is the highest among all methods, even better than the ADMM method (Zhang et al., 2018) which requires two additional Lagrange multipliers and involves the optimization of two objectives. Considering that the optimization of the Hoyer-Square regularizer can be directly realized on a single objective without additional variables, we conclude that the Hoyer-Square regularizer can achieve a sparse DNN model with a much lower cost. A more detailed layer-by-layer sparsity comparison of the compressed model can be found in Appendix C.2.

5.1. ELEMENT-WISE PRUNING:

We perform the ablation study for performance comparison between the Hoyer-Square regularizer and the original Hoyer regularizer. The results in Tables 1, 2 and 3 all show that the Hoyer-Square regularizer always achieves a higher compression rate than the original Hoyer regularizer. The layer-wise compression results show that the Hoyer-Square regularizer emphasizes more on the layers with more parameters (i.e. FC1 for the MNIST models). This corresponds to the fact that the value of the Hoyer-Square regularizer is proportional to the number of non-zero elements in the weight. These observations validate our choice to use the Hoyer-Square regularizer for DNN compression.

5.2. STRUCTURAL PRUNING:

This section reports the effectiveness of the Group-HS regularizer in structural pruning tasks. Here we mainly focus on the number of remaining neurons (output channels for convolution layers and rows for fully connected layers) after removing the all-zero channels or rows in the weight matrices.

The comparison is then made based on the required float-point operations (FLOPs) to inference with the remaining neurons, which indeed represents the potential inference speed of the pruned model. As shown in Table 4 , training with the Group-HS regularizer can reduce the number of FLOPs by 16.2× for the LeNet-300-100 model with a slight accuracy drop. This is the highest speedup among all existing methods achieving the same testing accuracy. Table 5 shows that the Group-HS regularizer can reduce the number of FLOPs of the LeNet-5 model by 12.4×, which outperforms most of the existing work-an 8.8% increase from the 1 based method (Wen et al., 2016 ) and a 110.6% increase from the 0 based method (Louizos et al., 2017b) . Only the Bayesian compression (BC) method with the group-horseshoe prior (BC-GHS) (Louizos et al., 2017a) achieves a slightly higher speedup on the LeNet-5 model. However, the complexity of high dimensional Bayesian inference limits BC's capability. It is difficult to apply BC to ImageNet-level problems and large DNN models like ResNet. Sparse VD (Molchanov et al., 2017) 99.0% 660.2k (28.79%) 14-19-242-131 GL (Wen et al., 2016) 99.0% 201.8k (8.80%) 3-12-192-500 SBP (Neklyudov et al., 2017) 99.1% 212.8k (9.28%) 3-18-284-283 BC-GNJ (Louizos et al., 2017a) 99.0% 282.9k (12.34%) 8-13-88-13 BC-GHS (Louizos et al., 2017a) 99.0% 153.4k (6.69%) 5-10-76-16 0 hc (Louizos et al., 2017b) 99.0% 390.7k (17.04%) 9-18-26-25 Bayes 1trim (Yun et al., 2019) 99.0% 334.0k (14.57%) 8-17-53-19

Group-HS 99.0% 169.9k (7.41%) 5-12-139-13 In contrast, the effectiveness of the Group-HS regularizer can be easily extended to deeper models and larger datasets, which is demonstrated by our experiments. We apply the Group-HS regularizer to ResNet models (He et al., 2016) on the CIFAR-10 and the ImageNet datasets. Pruning ResNet has long been considered difficult due to the compact structure of the ResNet model. Since previous works usually report the compression rate at different accuracy, we use the "accuracy-#FLOPs" plot to represent the tradeoff. The tradeoff between the accuracy and the FLOPs are explored in this work by changing the strength of the Group-HS regularizer used in training. Figure 3 shows the performance of DeepHoyer constantly stays above the Pareto frontier of previous methods.

6. CONCLUSIONS:

In this work, we propose DeepHoyer, a set of sparsity-inducing regularizers that are both scaleinvariant and almost everywhere differentiable. We show that the proposed regularizers have similar range and minima structure as the 0 norm, so it can effectively measure and regularize the sparsity of the weight matrices of DNN models. Meanwhile, the differentiable property enables the proposed regularizers to be simply optimized with standard gradient-based methods, in the same way as the 1 regularizer is. In the element-wise pruning experiment, the proposed Hoyer-Square regularizer achieves a 38% sparsity increase on the LeNet-300-100 model and a 63% sparsity increase on the LeNet-5 model without accuracy loss comparing to the state-of-the-art. A 21.3× model compression rate is achieved on AlexNet, which also surpass all previous methods. In the structural pruning experiment, the proposed Group-HS regularizer further reduces the computation load by 24.4% from the state-of-the-art on LeNet-300-100 model. It also achieves a 8.8% increase from the 1 based method and a 110.6% increase from the 0 based method of the computation reduction rate on the LeNet-5 model. For CIFAR-10 and ImageNet dataset, the accuracy-FLOPs tradeoff achieved by training ResNet models with various strengths of the Group-HS regularizer constantly stays above the Pareto frontier of previous methods. These results prove that the DeepHoyer regularizers are effective in achieving both element-wise and structural sparsity in deep neural networks, and can produce even sparser DNN models than previous works.

A DERIVATION OF DEEPHOYER REGULARIZERS' GRADIENTS:

In this section we provide detailed derivation of the gradient of the Hoyer-Square regularizer and the Group-GS regularizer w.r.t. an element w j in the weight matrix W .

The gradient of the Hoyer-Square regularizer is shown in Equation ( 9). The formulation shown in Equation ( 4) is achieved at the end of the derivation.

EQUATION

The gradient of the Group-HS regularizer is shown in Equation ( 10). For simplicity we use the form shown in the second equality of Equation ( 6), where there is no overlapping between the groups.

Here we assume that w j belongs to group w (ĝ) . Both the LeNet-300-100 model and the LeNet-5 model are firstly pretrained without the sparsityinducing regularizer, where they achieve the testing accuracy of 98.4% and 99.2% respectively. Then the models are further trained for 250 epochs with the DeepHoyer regularizers applied in the objective. The weight decay parameters (αs in Equation ( 7) and ( 8)) are picked by hand to reach the best result. In the last step, we prune the weight of each layer with threshold proportional to the standard derivation of each layer's weight. The threshold/std ratio is chosen to achieve the highest sparsity without accuracy loss. All weight elements with a absolute value smaller than the threshold 9 and Table 10 .

EQUATION

C ADDITIONAL EXPERIMENT RESULTS:



C.1 WEIGHT DISTRIBUTION AT DIFFERENT STAGES:

Here we demonstrate how will the weight distribution change in each layer at different stages of our element-wise pruning process. Since most of the weight elements will be zero in the end, we only plot the histogram of nonzero weight elements for better observation. The histogram of each layer of the LeNet-300-100 model and the LeNet-5 model are visualized in Figure 4 and Figure 5 respectively. It can be seen that majority of the weights will be concentrated near zero after applying the H S regularizer during training, while rest of the weight elements will spread out in a wide range. The weights close to zero are then set to be exactly zero, and the model is finetuned with zero weights fixed. The resulted histogram shows that most of the weights are pruned away, only a small amount of nonzero weights are remaining in the model. 

C.3 DETAILED RESULTS OF THE RESNET EXPERIMENTS:

In this section we list the data used to plot Figure 3 . Table 8 shows the result of pruning ResNet-50 model on ImageNet, Table 9 shows the result of pruning ResNet-56 model on CIFAR-10 and Table 10 shows the result of pruning ResNet-110 model on CIFAR-10. For all the tables, the results of previous works are listed on the top, and are ordered based on publication year. Results achieved with the Group-HS regularizer are listed below, marked with the regularization strength used for the training. (Luo et al., 2017) 72.04% 90.67% 1.58× ThiNet-50 (Luo et al., 2017) 71.01% 90.02% 2.26× ThiNet-30 (Luo et al., 2017) 68.42% 88.30% 3.51× SSS (Huang & Wang, 2018) 74.18% 91.91% 1.45× SFP (He et al., 2018a) 74.61% 92.06% 1.72× CFP (Singh et al., 2018) 73.4% 91.4% 1.98× Autopruner (Luo & Wu, 2018) 74.76% 92.15% 2.05× GDP (Lin et al., 2018) 71.89% 90.71% 2.05× DCP (Zhuang et al., 2018) 74.95% 92.32% 2.26× SSR-L2 (Lin et al., 2019) 71.47% 90.19% 2.26× C-SGD-70 (Ding et al., 2019) 75.27% 92.46% 1.58× C-SGD-50 (Ding et al., 2019) 74.93% 92.27% 1.86× C-SGD-30 (Ding et al., 2019) 74.54% 92.09% 2.26× CNN-FCF-A (Li et al., 2019) 76.50% 93.13% 1.41× CNN-FCF-B (Li et al., 2019) 75.68% 92.68% 1.85× CNN-FCF-C (Li et al., 2019) 74.55% 92.18% 2.33× CNN-FCF-D (Li et al., 2019) 73 

Model:

Base acc Acc gain #FLOPs reduction Pruning-A (Li et al., 2016) 93.04% +0.06% 1.12× Pruning-B (Li et al., 2016) 93.04% +0.02% 1.38× Channel pruning (He et al., 2017) 92.8% -1.0% 2.00× NISP-56 (Yu et al., 2018) N/A -0.03% 1.77× SFP (He et al., 2018a) 93.59% +0.19% 1.70× AMC (He et al., 2018b) 92.8% -0.9% 2.00× C-SGD-5/8 (Ding et al., 2019) 93.39% +0.23% 2.55× CNN-FCF-A (Li et al., 2019) 93.14% +0.24% 1.75× CNN-FCF-B (Li et al., 2019) 93 (Li et al., 2016) 93.53% -0.23% 1.62× NISP-110 (Yu et al., 2018) N/A -0.18% 1.78× SFP (He et al., 2018a) 93.68% +0.18% 1.69× C-SGD-5/8 (Ding et al., 2019) 94.38% +0.03% 2.56× CNN-FCF-A (Li et al., 2019) 93.58% +0.09% 1.76× CNN-FCF-B (Li et al., 2019) 93.58% -0.62%

3.42×:

Group-HS 7e-5 93.62% +0.44% 2.30× Group-HS 1e-4 93.62% +0.18% 3.09× Group-HS 1.5e-4 93.62% -0.08% 4.38× Group-HS 2e-4 93.62% -0.65% 5.84×

:

We implement the transformed 1 regularizer in(Ma et al.,

2019) ourselves because the experiments in the original paper are under different settings. Implementation details can be found in Appendix B.

Figures and Tables:

Figure 1: Comparing the 1 and the Hoyer regularizer of a 2-D vector. Their contours are shown in the left 2 subplots (darker color corresponds to a lower value). The right 2 subplots compare their negative gradients.

Figure 2: Minimization path of Hoyer-Square regularizer during gradient descent, with W ∈ R 20 initialized as i.i.d. N (0, 1). The figure shows the path of each element w i during the minimization, with the black dash line showing the induced trimming threshold.

Figure 3: Comparisons of accuracy-#FLOPs tradeoff on ImageNet and CIFAR-10, black dash lines mark the Pareto frontiers. The exact data for the points are listed in Appendix C.3.

(LeCun et al., 1998) is a well known handwritten digit dataset consists of greyscale images with the size of 28 × 28 pixels. We use the dataset API provided in the "torchvision" python package to access the dataset. In our experiments we use the whole 60,000 training set images for the training and the whole 10,000 testing set images for the evaluation. All the accuracy results reported in the paper are evaluated on the testing set. Both the training set and the testing set are normalized to have zero mean and variance one. Adam optimizer(Kingma & Ba, 2014) with learning rate 0.001 is used throughout the training process. All the MNIST experiments are done with a single TITAN XP GPU.

Figure 4: Histogram of nonzero weight elements of each layer in the LeNet-300-100 model. From top to bottom corresponds to layer FC1, FC2, FC3 respectively. The original pretrained model is shown in column 1, column 2 shows the model achieved after H S regularization, column 3 shows the final model after pruning and finetuning.

Figure 5: Histogram of nonzero weight elements of each layer in the LeNet-5 model. From top to bottom corresponds to layer CONV1, CONV2, FC1, FC2 respectively. The original pretrained model is shown in column 1, column 2 shows the model achieved after H S regularization, column 3 shows the final model after pruning and finetuning.

Element-wise pruning results on LeNet-300-100 model @ accuracy 98.4%

Table content: <table><tr><td/><td/><td/><td/><td colspan="3">Nonzero wights left after pruning</td></tr><tr><td>Method</td><td/><td>Total</td><td/><td>FC1</td><td/><td>FC2</td><td>FC3</td></tr><tr><td>Orig</td><td/><td>266.2k</td><td/><td colspan="2">235.2k</td><td>30k</td><td>1k</td></tr><tr><td colspan="2">(Han et al., 2015b)</td><td colspan="2">21.8k (8%)</td><td colspan="2">18.8k (8%)</td><td>2.7k (9%)</td><td>260 (26%)</td></tr><tr><td colspan="4">(Zhang et al., 2018) 11.6k (4.37%)</td><td colspan="2">9.4k (4%)</td><td>2.1k (7%)</td><td>120 (12%)</td></tr><tr><td>(Lee et al., 2019)</td><td/><td colspan="2">13.3k (5.0%)</td><td colspan="3">Not reported in (Lee et al., 2019)</td></tr><tr><td>(Ma et al., 2019) 1</td><td/><td colspan="2">6.4k (2.40%)</td><td colspan="3">5.0k (2.11%) 1.2k (4.09%) 209 (20.90%)</td></tr><tr><td>Hoyer</td><td/><td colspan="2">6.0k (2.27%)</td><td colspan="3">5.3k (2.25%) 672 (2.24%)</td><td>82 (8.20%)</td></tr><tr><td>Hoyer-Square</td><td/><td colspan="5">4.6k (1.74%) 3.7k (1.57%) 768 (2.56%) 159 (15.90%)</td></tr><tr><td colspan="7">Table 2: Element-wise pruning results on LeNet-5 model @ accuracy 99.2%</td></tr><tr><td/><td/><td/><td/><td colspan="3">Nonzero wights left after pruning</td></tr><tr><td>Method</td><td/><td>Total</td><td colspan="2">CONV1</td><td colspan="2">CONV2</td><td>FC1</td><td>FC2</td></tr><tr><td>Orig</td><td/><td>430.5k</td><td/><td>500</td><td>25k</td><td>400k</td><td>5k</td></tr><tr><td>(Han et al., 2015b)</td><td/><td>36k (8%)</td><td colspan="2">330 (66%)</td><td colspan="2">3k (12%)</td><td>32k (8%)</td><td>950 (19%)</td></tr><tr><td colspan="3">(Zhang et al., 2018) 6.1k (1.4%)</td><td colspan="2">100 (20%)</td><td colspan="2">2k (8%)</td><td>3.6k (0.9%)</td><td>350 (7%)</td></tr><tr><td>(Lee et al., 2019)</td><td colspan="2">8.6k (2.0%)</td><td/><td colspan="3">Not reported in (Lee et al., 2019)</td></tr><tr><td>(Ma et al., 2019) 1</td><td colspan="2">5.4k (1.3%)</td><td colspan="4">100 (20%) 690 (2.8%) 4.4k (1.1%) 203 (4.1%)</td></tr><tr><td>Hoyer</td><td colspan="6">4.0k (0.9%) 53 (10.6%) 613 (2.5%) 3.2k (0.8%) 136 (2.7%)</td></tr><tr><td>Hoyer-Square</td><td colspan="6">3.5k (0.8%) 67 (13.4%) 848 (3.4%) 2.4k (0.6%) 234 (4.7%)</td></tr></table>

Table 2 summarize the performance of the proposed Hoyer-square regularizer on the MNIST benchmark, with comparisons against state of the art (SOTA) element-wise pruning methods.

Table content: <table><tr><td>Without losing the testing accuracy, training with the Hoyer-Square regularizer reduces the number of</td></tr><tr><td>nonzero weights by 54.5× on the LeNet-300-100 model and by 122× on the LeNet-5 model. Among</td></tr><tr><td>all the methods, ours achieves the highest sparsity: it is a 38% improvement on the LeNet-300-100</td></tr><tr><td>model and a 63% improvement on the LeNet-5 model comparing to the best available methods.</td></tr><tr><td>Additional results in Appendix C.1 further illustrates the effect of the Hoyer-Square regularizer on</td></tr><tr><td>each layer's weight distribution during the training process.</td></tr></table>

Element-wise pruning results on AlexNet model.

Table content: <table><tr><td>Method</td><td colspan="4">Top-5 error increase #Parameters Percentage left</td></tr><tr><td>Orig</td><td colspan="2">+0.0%</td><td>60.9M</td><td>100%</td></tr><tr><td>(Han et al., 2015b)</td><td colspan="2">-0.1%</td><td>6.7M</td><td>11.0%</td></tr><tr><td>(Guo et al., 2016)</td><td colspan="2">+0.2%</td><td>3.45M</td><td>5.67%</td></tr><tr><td>(Dai et al., 2017)</td><td colspan="2">-0.1%</td><td>3.1M</td><td>6.40%</td></tr><tr><td>(Ma et al., 2019) 1</td><td colspan="2">+0.0%</td><td>3.05M</td><td>5.01%</td></tr><tr><td>(Zhang et al., 2018)</td><td colspan="2">+0.0%</td><td>2.9M</td><td>4.76%</td></tr><tr><td>Hoyer</td><td colspan="2">+0.0%</td><td>3.62M</td><td>5.94%</td></tr><tr><td>Hoyer-Square</td><td colspan="2">+0.0%</td><td>2.85M</td><td>4.69%</td></tr><tr><td colspan="5">Table 4: Structural pruning results on LeNet-300-100 model</td></tr><tr><td>Method</td><td/><td>Accuracy</td><td>#FLOPs</td><td>Pruned structure</td></tr><tr><td>Orig</td><td/><td>98.4%</td><td>266.2k</td><td>784-300-100</td></tr><tr><td colspan="2">Sparse VD (Molchanov et al., 2017)</td><td>98.2%</td><td>67.3k (25.28%)</td><td>512-114-72</td></tr><tr><td colspan="2">BC-GNJ (Louizos et al., 2017a)</td><td>98.2%</td><td>28.6k (10.76%)</td><td>278-98-13</td></tr><tr><td colspan="2">BC-GHS (Louizos et al., 2017a)</td><td>98.2%</td><td>28.1k (10.55%)</td><td>311-86-14</td></tr><tr><td colspan="2">0 hc (Louizos et al., 2017b)</td><td>98.2%</td><td>26.6k (10.01%)</td><td>266-88-33</td></tr><tr><td colspan="2">Bayes 1trim (Yun et al., 2019)</td><td>98.3%</td><td>20.5k (7.70%)</td><td>245-75-25</td></tr><tr><td>Group-HS</td><td/><td>98.2%</td><td>16.5k (6.19%)</td><td>353-45-11</td></tr></table>

Structural pruning result on LeNet-5 model

Table content: <table><tr><td>Method</td><td>Accuracy</td><td>#FLOPs</td><td>Pruned structure</td></tr><tr><td>Orig</td><td>99.2%</td><td>2293k</td><td>20-50-800-500</td></tr></table>

Element-wise pruning results on AlexNet without accuracy loss. Refer to Table3for the full reference of the mentined methods.

Table content: <table><tr><td>Layer</td><td/><td colspan="4">Nonzero wights left after pruning</td><td/></tr><tr><td/><td colspan="4">Baseline Han et al. Zhang et al. Ma et al.</td><td>Hoyer</td><td>HS</td></tr><tr><td>CONV1</td><td>34.8K</td><td>29.3K</td><td>28.2K</td><td>24.2K</td><td>21.3K</td><td>31.6K</td></tr><tr><td colspan="2">CONV2 307.2K</td><td>116.7K</td><td>61.4K</td><td>109.9K</td><td>77.2K</td><td>148.4K</td></tr><tr><td colspan="2">CONV3 884.7K</td><td>309.7K</td><td>168.1K</td><td>241.2K</td><td colspan="2">192.0K 299.3K</td></tr><tr><td colspan="2">CONV4 663.5K</td><td>245.5K</td><td>132.7K</td><td>207.4K</td><td colspan="2">182.6K 275.6K</td></tr><tr><td colspan="2">CONV5 442.2K</td><td>163.7K</td><td>88.5K</td><td>134.7K</td><td colspan="2">116.6K 197.1K</td></tr><tr><td>FC1</td><td>37.7M</td><td>3.40M</td><td>1.06M</td><td colspan="3">0.763M 1.566M 0.781M</td></tr><tr><td>FC2</td><td>16.8M</td><td>1.51M</td><td>0.99M</td><td colspan="3">1.070M 0.974M 0.650M</td></tr><tr><td>FC3</td><td>4.10M</td><td>1.02M</td><td>0.38M</td><td colspan="3">0.505M 0.490M 0.472M</td></tr><tr><td>Total</td><td>60.9M</td><td>6.8M</td><td>2.9M</td><td>3.05M</td><td>3.62M</td><td>2.85M</td></tr></table>

Structural pruning result of the ResNet-50 model on imageNet.

Table content: <table><tr><td>Model</td><td colspan="3">Top-1 acc Top-5 acc #FLOPs reduction</td></tr><tr><td>Orig</td><td>76.15%</td><td>92.87%</td><td>1.00×</td></tr><tr><td>Channel pruning (He et al., 2017)</td><td>N/A</td><td>90.80%</td><td>2.00×</td></tr><tr><td>ThiNet-70</td><td/><td/><td/></tr></table>

Structural pruning result of the ResNet-56 model on CIFAR-10.

Table content: <table/>

Structural pruning result of the ResNet-110 model on CIFAR-10.

Table content: <table><tr><td/><td>.14%</td><td>-1.22%</td><td>3.44×</td></tr><tr><td>Group-HS 2e-4</td><td>93.14%</td><td>+0.44%</td><td>2.38×</td></tr><tr><td>Group-HS 2.5e-4</td><td>93.14%</td><td>+0.31%</td><td>3.07×</td></tr><tr><td>Group-HS 3e-4</td><td>93.14%</td><td>-0.24%</td><td>3.52×</td></tr><tr><td>Group-HS 5e-4</td><td>93.14%</td><td>-0.91%</td><td>5.63×</td></tr><tr><td>Model</td><td colspan="3">Base acc Acc gain #FLOPs reduction</td></tr><tr><td>Pruning-A (Li et al., 2016)</td><td>93.53%</td><td>-0.02%</td><td>1.19×</td></tr><tr><td>Pruning-B</td><td/><td/><td/></tr></table>

Peer review (iclr2020):
To enforce sparsity in neural networks, the paper proposes a scale-invariant regularizer (DeepHoyer) inspired by the Hoyer measure. It is simply the ratio between l1 and l2 norm, which is almost everywhere differentiable, and enforces element-wise sparsity. It further proposes the Hoyer measure to quantify sparsity and applies the DeepHoyer in DNN training to train pruned models. The extension of Hoyer-Square is also straightforward. I generally enjoy simple yet effective ideas. The idea is very straightforward and well intuitive. The paper is well written and easy the follow. The discussion on the Hoyer measure is inspiring and the empirical studies on various different network architecture/datasets compared to several competitive baselines verify the effectiveness of the DeepHoyer model. Therefore I*m leaning to accept it.