A bit-depth optimization engine reduces the hardware cost of a neural network. When training data is applied to a neural network during training routines, accuracy cost and hardware costs are generated. A hardware complexity cost generator generates costs for weights near bit-depth steps where the number of binary bits required to represent a weight decreases, such as from 2N to 2N−1, where one less binary bit is required. Gradients are generated from costs for each weight, and weights near bit-depth steps are easily selected since they have a large gradient, while weights far away from a bit-depth step have near-zero gradients. The selected weights are reduced during optimization. Over many cycles of optimization, a low-bit-depth neural network is generated that uses fewer binary bits per weight, resulting in lower hardware costs when the low-bit-depth neural network is manufactured on an Application-Specific Integrated Circuit (ASIC).
Drawings
Claims20
An Integrated Circuit process (IC) manufacturing process comprising:
applying an initial set of weights to a neural network, the weights specifying connections among nodes in the neural network;
(a) applying training data to the neural network to generate neural network results;
(b) generating an accuracy cost from the neural network results;
(c) generating hardware complexity costs for the weights, wherein the hardware complexity cost for a weight is generated from a number of binary bits required to represent the weight;
(d) selecting weights for reduction by preferentially selecting weights near bit-depth steps;
wherein a number of binary bits required to represent a weight that is located near a bit-depth step is reduced by one binary bit while a number of binary bits required to represent a weight that is not located near a bit-depth step is not reduced for a weight reduction;
(e) reducing each of the selected weights to generate updated weights;
(f) applying the updated weights to the neural network and repeating steps (a) to (f) until a target is reached;
when the target is reached, generating a low-bit-depth neural network by modifying the neural network to include the updated weights;
converting the low-bit-depth neural network and the updated weights to a manufacturing control file;
inputting the manufacturing control file into a computer-controlled manufacturing machine;
manufacturing an IC product with the low-bit-depth neural network using a manufacturing process that includes using the computer-controlled manufacturing machine that receives the manufacturing control file specifying IC product with the low-bit-depth neural network,
whereby the IC product has the low-bit-depth neural network generated by preferentially selecting weights for reduction that are near the bit-depth steps.
10 more elements
A computer-implemented process to convert a neural network into a low-bit-depth neural network comprising:
applying an initial set of weights to the neural network, a weight having a weight value that indicates a strength of a connection between nodes within the neural network, the neural network having at least a thousand weights;
(a) inputting training data into the neural network while training routines are being executed;
(b) generating outputs from the neural network after the training data is being input while the training routines are being executed;
(c) comparing the outputs from the neural network to expected outputs to generate an accuracy cost for a current iteration of the training routines;
(d) generating a hardware cost for each weight in the neural network during the current iteration, wherein the hardware cost is a function of a number of binary bits required to represent the weight;
(e) generating a gradient of the hardware cost for each weight, the gradient having a large value when the weight is near a bit-depth step;
wherein the number of binary bits required to represent a weight that is located near a bit-depth step is reduced while a number of binary bits required to represent a weight that is not located near a bit-depth step is not reduced for a weight reduction;
(f) using a computer to identify selected weights from among the weights having the large values of the gradient;
(g) reducing each of the selected weights so that each selected weight requires one less binary bit to represent the weight;
(h) generating updated weights that include the selected weights that are reduced;
(i) comparing the accuracy cost and an aggregate of the hardware costs to a target, and applying the updated weights to the neural network and repeating steps (a) to (i) for another iteration when the target is not reached;
and
when the target is reached, applying the updated weights to the neural network to generate the low-bit-depth neural network;
whereby the low-bit-depth neural network has a lower aggregate hardware cost than the neural network before iterations of the training routines.
11 more elements
A non-transitory computer-readable medium for storing computer-executable instructions, the computer-executable instructions when executed by a processor implementing a method comprising:
applying initial weights to connections between nodes in a neural network, a weight specifying a strength of a connection between nodes in the neural network;
(a) executing training routines that apply training data to inputs of the neural network;
(b) examining outputs of the neural network to generate error measurements;
(c) generating a hardware complexity cost from the weights applied to the neural network;
(d) generating an error gradient for weights from the error measurements;
(e) generating a hardware complexity cost gradient for a weight from the hardware complexity cost for the weight;
wherein the hardware complexity cost gradient has a value above a gradient threshold when a reduction in the weight causes the weight to require one less binary bit for representation;
wherein the hardware complexity cost gradient has a value below the gradient threshold when the reduction in the weight causes the weight to require a same number of binary bits for representation;
(f) selecting weights having a hardware complexity cost gradient above the gradient threshold as selected weights;
(g) reducing each of the selected weights to generate updated weights;
applying the updated weights to the neural network and performing additional iterations of steps (a) to (g) when a target endpoint has not been reached;
and
when the target endpoint has been reached, outputting the neural network with the updated weights as a low-bit-depth neural network that is specified by a design file;
wherein the design file is a computer-readable file that specifies the low-bit-depth neural network.
15/415,810Filed 25 Jan 2017 · us provisional application
Priority
16 Mar 2016
Published
US 2017/0270408 A121 Sep 2017
Granted
31 Aug 2021
Term ends
4 Jul 2040Estimated · howhide20 years from earliest known nonprovisional domestic filing plus recorded patent term adjustment, including 1,256 days of adjustment. Maintenance-fee lapses, terminal disclaimers and statutory extensions have not been checked. The continuity chain may be incomplete; this is not an enforceability determination.
Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons: using electronic means
Life of this patent
About 13 years 8 months of term left · ends 4 Jul 2040 (estimated)
Priority16 Mar 2016
Filed25 Jan 2017
Granted31 Aug 2021
Today12 Oct 2026
Term ends4 Jul 2040
Priority16 Mar 2016
Granted31 Aug 2021
Term ends4 Jul 2040
Priority claimedParent application 62/309,239
Application filedUS 15/415,810
Assigned to Hong Kong Applied Science and Technology Research Institute Company, Limited.assignment of assignor's interest
PublishedUS 2017/0270408 A1
GrantedUS 11,106,973 B2
TodayWithin its term
Term endsEstimated, includes 1,256 days of adjustment
Description6,661 words
Summary1,115 words
#This invention relates to Neural Networks, and more particularly to optimization of weight sizes.
#Artificial Neural Networks are especially useful for processing large amounts of data in complex ways that are hard to define using traditional computer programs. Instead of being programmed with instructions, training data is input to a neural network and compared to the expected output, then adjustments are made within the neural network and the training data is again processed and outputs compared to generate further adjustments to the neural network. After many such training cycles, the neural network is altered to efficiently process data similar to the training data and expected outputs. Neural networks are an example of machine learning, since the neural network learns how to generate the expected outputs for the training data. Real data similar to the training data can then be input to the neural network to process live data.
#FIG. 1 illustrates a prior art neural network. Input nodes 102, 104, 106, 108 receive input data I1, I2, I3, . . . I4, while output nodes 103, 105, 107, 109 output the result of the neural network's operations, output data O1, O2, O3, . . . O4. Three layers of operations are performed within this neural network. Nodes 110, 112, 114, 116, 118, each take inputs from one or more of input nodes 102, 104, 106, 108, perform some operation, such as addition, subtraction, multiplication, or more complex operations, and send and output to nodes in the second layer. Second-layer nodes 120, 122, 124, 126, 128, 129 also receive multiple inputs, combines these inputs to generate an output, and sends the outputs on to third-level nodes 132, 134, 136, 138, 139, which similarly combine inputs and generate outputs.
#FIG. 2 shows a neural network used for facial recognition.
#FIG. 3 shows a neural network implementing an image recognition processor.
Detailed description5,421 words
#The present invention relates to an improvement in neural networks. The following description is presented to enable one of ordinary skill in the art to make and use the invention as provided in the context of a particular application and its requirements. Various modifications to the preferred embodiment will be apparent to those with skill in the art, and the general principles defined herein may be applied to other embodiments. Therefore, the present invention is not intended to be limited to the particular embodiments shown and described, but is to be accorded the widest scope consistent with the principles and novel features herein disclosed.
#The inventors have discovered that the size or bit depths of weights in a neural network can be reduced to reduce the complexity, cost, and size of the neural network while still optimizing accuracy. Specifically, a bit-depth complexity penalty is added during optimization to urge a neural network towards a smaller weights memory. A numerical gradient of the size of the weights is used during optimization iterations. The inventors reduce the number of bits required for weights in a neural network through a training process, which can then be deployed in dedicated hardware such as in an ASIC. The smaller optimized neural network reduces the cost and size of the ASIC.
#FIG. 4 shows a neural network optimizer. Neural network 36 can be a neural network generated by design engineers for a particular application, or a generic neural network that is adjusted for a particular application. For example, the number of intermediate or hidden layers in the neural network may be adjusted for a particular application, and the type of operations performed in nodes and the connectivity among nodes may be adjusted for certain applications or problems to be solved. For example, a generic neural network might be expanded to 10 layers for the facial recognition application of FIGS. 2, or to 16 layers for the image processing application of FIG. 3.