US 12,450,490 B2
Neural network construction method and apparatus having average quantization mechanism
Yu-Che Kao, Hsinchu (TW)
Assigned to REALTEK SEMICONDUCTOR CORPORATION, Hsinchu (TW)
Filed by REALTEK SEMICONDUCTOR CORPORATION, Hsinchu (TW)
Filed on Jun. 2, 2022, as Appl. No. 17/830,827.
Claims priority of application No. 110136791 (TW), filed on Oct. 1, 2021.
Prior Publication US 2023/0114610 A1, Apr. 13, 2023
Int. Cl. G06N 3/082 (2023.01); G06N 3/0495 (2023.01)
CPC G06N 3/082 (2013.01) [G06N 3/0495 (2023.01)] 6 Claims
OG exemplary drawing
 
1. A neural network construction method having average quantization mechanism, comprising:
retrieving a weight combination comprised in each of network layers of a neural network, wherein the weight combination comprises a plurality of floating-point weights;
generating a loss function according to the weight combination of all the network layers and a plurality of target values, wherein the loss function is a first function of the weight combination and the target values;
corresponding to each of the network layers, calculating a Gini coefficient of the weight combination and accumulating the Gini coefficient of each of the network layers as a regularized correction term, wherein the regularized correction term is a second function of the weight combination;
merging the loss function and the regularized correction term to generate a regularized loss function to perform training on the neural network according to the regularized loss function to keep modifying the floating-point weights in the weight combination, so as to generate a trained weight combination of each of the network layers;
performing quantization on the trained weight combination of each of the network layers to generate a quantized neural network, in which each of the network layers of the quantized neural network comprises the quantization weight combination, wherein the quantization weight combination comprises a plurality of integer weights, and a first distribution of the floating-point weights in the trained weight combination is even such that a second distribution of the integer weights in the quantization weight combination is even; and
implementing the quantized neural network by an embedded system chip.