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).
Please help me write a proper abstract based on the patent claims. CLAIM: 1. An Integrated Circuit (IC) product produced by a process of: 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; generating an accuracy cost from the neural network results; 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; selecting weights for reduction by preferentially selecting weights near bit-depth steps, wherein reducing a weight near a bit-depth step reduces a number of binary bits required to represent the weight by one binary bit; wherein reducing a weight that is not near a bit-depth step produces no change in the number of binary bits required to represent the weight; updating the weights to generate updated weights, wherein the updated weights include the weights selected for reduction that are near the bit-depth steps; applying the updated weights to the neural network and repeating from (a) 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 the 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. 2. The IC product of claim 1 wherein manufacturing the IC product further comprises: converting the IC product with the low-bit-depth neural network and the updated weights to a design file for use by a photomask writing machine; using the photomask writing machine under control of the design file to write images of the IC product to a plurality of photomasks, the images including images of the low-bit-depth neural network; and using the plurality of photomasks to print the images onto a semiconductor substrate during steps in an IC manufacturing process to build a plurality of dice of the IC product onto the semiconductor substrate, 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. 3. The IC product of claim 1 further comprising: generating a hardware complexity cost gradient for weights, the hardware complexity cost gradient having a larger value when the weight is nearer the bit-depth step than when the weight is farther from the bit-depth step. 4. The IC product of claim 3 wherein selecting weights for reduction by preferentially selecting weights near bit-depth steps further comprises: examining the hardware complexity cost gradients and selecting weights for reduction having larger hardware complexity cost gradients than weights not selected for reduction; wherein an average of the hardware complexity cost gradients for the weights selected for reduction is larger than an average of the hardware complexity cost gradients for weights that are not selected for reduction. 5. The IC product of claim 4 wherein an average of the hardware complexity cost gradients for the weights selected for reduction is at least twice as large as an average of the hardware complexity cost gradients for weights that are not selected for reduction. 6. The IC product of claim 4 wherein a change of one binary bit required to represent the weight produces a high hardware complexity cost gradient, while a low hardware complexity cost gradient is generated when the number of binary bits required to represent the weight does not change when the weight is changed. 7. The IC product of claim 1 wherein the target is a combination of the accuracy cost and the hardware complexity cost. 8. 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; generating outputs from the neural network after the training data is being input while the training routines are being executed; comparing the outputs from the neural network to expected outputs to generate an accuracy cost for a current iteration of the training routines; 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; 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 the weight decreases by one binary bit, the gradient having a small value when the weight is not near a bit-depth step; wherein the large value of the gradient is larger than the small value; using a computer to identify selected weights from among the weights having the large values of the gradient; reducing each of the selected weights so that each selected weight requires one less binary bit to represent the weight; generating updated weights that include the selected weights that are reduced; 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 from (a) 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. 9. The computer-implemented process of claim 8 wherein the large value of the gradient is at least double the small value, and wherein the large value occurs when the weight is within 10% of the bit-depth step. 10. The computer-implemented process of claim 8 further comprising: generating an accuracy cost for each weight in the neural network during the current iteration, wherein the accuracy cost is a measure of a loss in accuracy of the neural network when the weight is decreased; generating a gradient of the accuracy cost for each weight, the gradient having a value determined by an amount that the weight changes the accuracy by when the weight is reduced. 11. The computer-implemented process of claim 10 wherein using a computer to identify selected weights from among the weights having the large values of the gradient of the hardware cost further comprises selecting weights also having a low value of the gradient of the accuracy cost. 12. 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; executing training routines that apply training data to inputs of the neural network; examining outputs of the neural network to generate error measurements; generating a hardware complexity cost from the weights applied to the neural network; generating an error gradient for weights from the error measurements; 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; selecting weights having a hardware complexity cost gradient above the gradient threshold as selected weights; updating the selected weights by the reduction in the weight to generate updated weights; applying the updated weights to the neural network and performing additional iterations 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. 13. The computer-readable medium of claim 12 wherein the method further comprises: converting the design file into a plurality of mask image files; wherein the plurality of mask image files are computer-readable by a mask-making machine that generates a plurality of masks; wherein the plurality of masks control printing of images specified in the plurality of mask image files onto a semiconductor substrate during a semiconductor manufacturing process to build an Integrated Circuit (IC) that has the low-bit-depth neural network. 14. The computer-readable medium of claim 12 wherein at least 80% of the weights are able to be represented by 8 to 16 binary bits. 15. The computer-readable medium of claim 12 wherein generating the hardware complexity cost comprises summing, over all weights, a number of bits required to represent the weight, wherein the hardware complexity cost is an aggregate sum of bit-depths for weights. 16. The computer-readable medium of claim 12 wherein the method further comprises: signaling the target endpoint being reached when a pre-defined combination of the error measurements and a sum of the hardware complexity cost for all weights is below a target value. 17. The computer-readable medium of claim 12 wherein the method further comprises: removing weights having an error gradient above an error threshold from the selected weights, whereby weights with high error gradients are not reduced. 18. The computer-readable medium of claim 12 wherein the method further comprises: generating other regularization costs from the neural network and the weights applied to the neural network; generating other regularization gradients from the other regularization costs; using the hardware complexity cost gradient to refine selection of the weights selected as the selected weights. 19. The computer-readable medium of claim 18 wherein generating other regularization costs comprises generating a sparsity cost. 20. The computer-readable medium of claim 12 wherein the neural network has at least one hundred thousand weights.