Optimized quantization for reduced resolution neural networks
AssigneeRobert Bosch GmbH
InventorsAkshay Malhotra, Thomas Rocznik, Christian Peters
Life of this patent
Estimating the term…
Abstract
A system and method for generating and using fixed-point operations for neural networks includes converting floating-point weighting factors into fixed-point weighting factors using a scaling factor. The scaling factor is defined to minimize a cost function and the scaling factor is derived from a set of multiples of a predetermined base. The set of possible scaling function is defined to reduce the computational effort for evaluating the cost function for each of a number of possible scaling factors. The system and method may be implemented in one or more controllers that are programmed to execute the logic.
Claims19
A machine learning system comprising:
- at least one controller including a hardware processor, wherein the at least one controller is programmed to convert floating-point weighting factors for a neural network into fixed-point weighting factors using a scaling factor that is a multiple of a predetermined base, b, and that minimizes a cost function that is a mean square error between the floating-point weighting factors and a product of candidate scaling factors and corresponding fixed-point weighting factors, and, after a predetermined number of iterations during a training stage, change the scaling factor.
A method comprising:
- selecting a predetermined number of candidate scaling factors that are multiples of two;
- evaluating, for each of the candidate scaling factors, a cost function that is a mean square error between a predetermined set of floating-point weighting factors for a neural network and a product of a candidate scaling factors being evaluated and fixed-point weighting factors defined by the candidate scaling factor being evaluated;
- selecting a scaling factor as a one of the candidate scaling factors that results in a minimum value of the cost function;
- generating a set of fixed-point weighting factors by scaling each of the floating-point weighting factors by the scaling factor;
- and
- implementing the neural network using the set of fixed-point weighting factors.
A method for converting floating-point weighting factors to fixed-point weighting factors for a neural network, the method comprising:
- selecting a predetermined number of candidate scaling factors that are multiples of a predetermined base, wherein the predetermined number of candidate scaling factors includes a greater number of candidates having a value that exceeds a mean value of an absolute value of the floating-point weighting factors;
- evaluating each of the candidate scaling factors in a cost function;
- selecting a scaling factor as a one of the candidate scaling factors that results in a minimum value of the cost function;
- generating the fixed-point weighting factors by scaling the floating-point weighting factor using the scaling factor;
- and
- implementing the neural network using the fixed-point weighting factors.
A method for converting floating-point weighting factors to fixed-point weighting factors for a neural network, the method comprising:
- selecting a predetermined number of candidate scaling factors that are multiples of a predetermined base, wherein the predetermined number of candidate scaling factors includes only one candidate that is less than a mean value of absolute values of the floating-point weighting factors associated;
- evaluating each of the candidate scaling factors in a cost function;
- selecting a scaling factor as a one of the candidate scaling factors that results in a minimum value of the cost function;
- generating the fixed-point weighting factors by scaling the floating-point weighting factor using the scaling factor;
- and
- implementing the neural network using the fixed-point weighting factors.
A method for converting floating-point weighting factors to fixed-point weighting factors for a neural network, the method comprising:
- selecting a predetermined number of candidate scaling factors that are multiples of a predetermined base;
- evaluating each of the candidate scaling factors in a cost function;
- selecting a scaling factor as a one of the candidate scaling factors that results in a minimum value of the cost function;
- generating the fixed-point weighting factors by scaling the floating-point weighting factor using the scaling factor, wherein the cost function is a mean square error between the floating-point weighting factors and a product of the candidate scaling factors and corresponding fixed-point weighting factors;
- and
- implementing the neural network using the fixed-point weighting factors.
Dependencies are inferred from the claim text.