Method and device for deep neural network compression
AssigneeAcer Incorporated
InventorsJuinn-Dar Huang, Ya-Chu Chang, Wei-Chen Lin
Life of this patent
Estimating the term…
Abstract
A method for deep neural network compression is provided. The method includes: using at least one weight of a deep neural network (DNN), setting a value of a P parameter, and combining every P weights in groups, and perform branch pruning and retraining, so that only one of each group has a non-zero weight, and the remaining weights are 0, wherein the remaining weights are evenly divided into branches to adjust a compression rate of the DNN and to adjust a reduction rate of the DNN.
Claims18
A method for deep neural network compression, comprising:
- obtaining, by a processor, at least one weight of a deep neural network (DNN), setting a value of a P parameter, and combining every P weights in groups, wherein P is a number, the at least one weight is placed between two network layers corresponding to an input layer and an output layer adjacent to each other in the deep neural network, the processor comprising input layer storage units having nodes, wherein the processor further comprises a multiplexer, wherein input values of the nodes of the input layer are multiplied at the multiplexer by respective weights in one of the groups to generate first output values, the first output values accumulated into a final output value which is equal to an output value of one of plural nodes of the output layer;
- setting, by the processor, a loop parameter L so that a branch pruning and retraining is performed on each group of P weights from the first loop to the Lth loop, setting a threshold T corresponding to each loop, wherein the threshold T increases gradually from a first threshold T1 to an L threshold TL, the first threshold T1 is used at the beginning of the first loop, and the L threshold TL is used in the Lth loop;
- for each loop, setting, by the processor, the weights less than the threshold T to 0 and retaining the weights greater than the threshold T when obtaining the weights of the same group in the same loop according to the threshold T, wherein when all of the weights of the same group in the same loop are less than the threshold T, only the largest weight is retained, and remaining weights are set to 0;
- and
- performing, by the processor, the branch pruning and retraining until the Lth loop, so that only one weight of each group is non-zero and the remaining weights are 0.
A device for deep neural network compression, comprising:
- a processor, configured to execute the following tasks:
- obtaining at least one weight of a deep neural network (DNN), setting a value of a P parameter, and combining every P weights in groups, wherein P is a number, the at least one weight is placed between two network layers corresponding to an input layer and an output layer adjacent to each other in the deep neural network, the processor comprising input layer storage units having nodes, wherein the processor further comprises a multiplexer, wherein input values of the nodes of the input layer are multiplied at the multiplexer by respective weights in one of the groups to generate first output values;
- the first output values accumulated into a final output value which is equal to an output value of one of plural nodes of the output layer;
- setting a loop parameter L so that a branch pruning and retraining is performed on each group of P weights from the first loop to the Lth loop, setting a threshold T corresponding to each loop, wherein the threshold T increases gradually from a first threshold T1 to an L threshold TL, the first threshold T1 is used at the beginning of the first loop, and the L threshold TL is used in the Lth loop;
- for each loop, setting the weights less than the threshold T to 0 and retaining the weights greater than the threshold T when obtaining the weights of the same group in the same loop according to the threshold T, wherein when all of the weights of the same group in the same loop are less than the threshold T, only the largest weight is retained, and remaining weights are set to 0;
- and
- performing the branch pruning and retraining until the Lth loop of the last loop, so that only one weight of each group is non-zero and the remaining weights are 0.
Dependencies are inferred from the claim text.