Method and apparatus for training a quantization classifier
Patent Information
- Application Number
- CN202110924172.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2020-08-13
- Filing Date
- 2021-08-12
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2041-08-12
AI Technical Summary
[0030]此外,分类器的权重以及分类器的计算所需要的存储需求可以有利地被减少,其方式是对权重进行量化并且存储经量化的权重。
Smart Images

Figure CN114139592B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to methods for training quantization classifiers, methods for running quantization classifiers, methods for manipulating actuators or display devices, computer programs, and machine-readable storage media. Background Technology
[0002] A method for training a classifier based on quantization is known from DE 10 2020 203 998.4, which has never been pre-published.
[0003] Advantages of the invention Classifiers are used in a variety of ways, especially when classifying image or audio data. For classification, a classifier typically includes weights that can be adapted to the desired set of data during training, so that the desired output is determined when the classifier classifies the data in the set. Neural networks are a specific example of classifiers utilizing this approach.
[0004] The use of classifiers typically involves a trade-off between the classifier's classification ability (i.e., performance) and the energy consumption and / or storage requirements of the classifier. Here, performance can be understood as rate or accuracy at which the classifier determines the expected class for the input data fed to it.
[0005] Especially when using classifiers on embedded hardware, the following situation typically arises: the classifier requires low power consumption and low storage requirements. To still achieve adequate performance, so-called quantization methods have proven particularly suitable. These methods can reduce the number of bits required to compute the classifier.
[0006] To further reduce energy consumption and / or storage requirements while maintaining appropriate performance, DE 10 2020203 998.4 discloses a method that allows quantization of classifier parameters for different quantization types, i.e., especially for different numbers of bits, without significantly changing the classifier's performance.
[0007] The method with the features of independent claim 1 according to the invention has the advantage that the classifier can be trained such that the computational operations of the classifier can be quantized for different quantization types while maintaining appropriate performance. For training, the classifier can advantageously be built on top of another training prior to this training using another quantization type, whereby fewer parameters of the classifier must be adapted. Thus, this method can advantageously train the classifier in a shorter time compared to the prior art because fewer parameters of the classifier are changed. Conversely, this means that with the same time expenditure, more data can be used to train the classifier, and thus better performance can be obtained. Summary of the Invention
[0008] In a first aspect, the present invention relates to a computer-implemented method for training a classifier, wherein the classifier is configured to determine an output for input data, wherein the output characterizes a classification of the input data and the classifier includes a plurality of weights, the output being determined based on the weights, wherein at least one of the plurality of weights is quantized to a pre-given first number of first values, wherein two successive first values are respectively separated by a distance value, and further wherein, for training, the distance value is adapted, but the plurality of weights are not adapted.
[0009] Classifiers, in particular, can be constructed to accept sensor data from one or more sensors as input data.
[0010] For example, a classifier can be constructed to classify image data. In this case, the classifier can, for example, assign at least one category to an image, which characterizes the content of the image. In particular, classification can also be object detection. In this case, the classification can characterize the presence of an object and its location in the image. Another typical form of classification is semantic segmentation. Here, the pixels of the image are assigned to categories. For example, on an image of street conditions, pixels can be sorted into categories such as street, street participants, or street signs based on which object they belong to in the image.
[0011] Alternatively or additionally, a classifier can be constructed to classify audio data. For example, the classifier can determine, for instance, whether an audio signal contains a pre-given audio event. For example, the classifier can be used as part of a vehicle that is at least partially autonomous, whereby the classifier is used to classify audio signals from the vehicle's environment. The classifier can then, for example, determine whether the siren of a patrol car can be heard in the vehicle's environment, and if so, maneuver the vehicle so that it does not obstruct the patrol car's lane.
[0012] Alternatively or additionally, the classifier can be configured to classify sensor signals that are not present in the form of image or audio data. For example, the classifier can be used as part of a building control system. For instance, it is conceivable that the classifier accepts sensor signals from a temperature sensor and an air humidity sensor as input data and determines an output that characterizes a control signal for an air conditioning unit. The air conditioning unit can then be controlled accordingly using the output.
[0013] To determine the output, the classifier uses weights that it includes. These weights can be understood as a weight-mapping function that the classifier uses to determine the output from the input data passed to it.
[0014] In particular, when, for example, the classifier includes a neural network and the neural network includes weights, the weights can be arranged, for example, in successive layers. For example, a layer can receive input data or the output of a layer of the classifier, i.e., the layer output, as input. Based on the input and the weights included in the layer, the layer can then be arranged, for example, according to the formula... To determine the layer output, where s is the layer output. It is a matrix of layer weights, and This is the input to the layer. Alternatively, and conceivably, the layer performs discrete convolutions, where the layer includes weights in the form of at least one filter of the discrete convolutions.
[0015] Then, for example, the output of the last layer of the classifier can be used as the output of the classifier.
[0016] The weights of a classifier can be represented as binary numbers within the computer running or training the classifier, for example, as binary floating-point numbers according to the IEEE 754 standard. To make the classifier energy efficient, the resolution of the weights can be reduced. Resolution can be understood as the number of possible values that can be used as weights.
[0017] This reduction in resolution is also commonly known as quantization. The purpose of quantization is to reduce the number of possible values needed to compute the output to a small number. With this small number, computational operations such as multiplication or addition can then be performed very efficiently via, for example, lookup tables.
[0018] Therefore, classifier quantization can be understood as the quantization of classifier weights. Classifier quantization results in the classifier being able to be executed on computational units with a resolution corresponding to the quantization, which typically consume less energy than computational units with higher resolution.
[0019] Advantageously, the desired reduced resolution is included in the training of the classifier, since post-quantization of a classifier trained without quantization results in a significant performance loss.
[0020] Similarly, a classifier quantized at a pre-given resolution during training should be run at the same resolution during inference time, i.e., during the runtime of the classifier after training is complete, because otherwise a huge performance loss will also occur.
[0021] For example, isometric quantization can be chosen for quantization. Isometric quantization can be understood as quantization where the first values are equidistant. However, other distances between the first values are also conceivable. For example, the distance between the first values can follow a logarithmic function. Alternatively, it is equally conceivable that the distance between two successive first values can be freely chosen separately.
[0022] According to the formula The weights are quantized, where ∙ is the rounding function to the next smaller or equal integer, and w is the weight that should be quantized. This is the quantized value, which is known as the step size. Here, is the sign function, and q(w) is the quantized weight. Thus, for example, such quantized weights can be used to determine the layer output.
[0023] If the weight w is less than the value xmin, then typically the weight w is set to the value xmin; or if the weight is greater than the value xmax, then the weight w is set to the value xmax. This can be achieved from a resolution in bits. and step length The interval between xmin and xmax is determined by the following relationship: .
[0024] Preferably, xmax and xmin can be selected such that the quantization is centered as close to the value of 0 as possible. For example, xmax can be determined according to the formula... Selected, and xmin then according to Selected.
[0025] The quantization type can be characterized by a pre-defined resolution and a pre-defined stride. Quantizing a classifier according to its quantization type can thus be understood as quantizing the classifier using the resolution and stride.
[0026] In the method used for training, the first quantity can be understood as the resolution of the quantization type, and the second value can be understood as the step size of the quantization type, with the classifier being trained using the step size.
[0027] Imagine that multiple weights of the classifier are determined and provided to the classifier for training during pre-training, prior to actual training. For example, one could imagine that the weights are initially determined through pre-training without quantization. The term "without quantization" should be understood in this case as meaning that the weights are not quantized to a pre-given resolution during training, but rather trained based on their initial resolution.
[0028] In training immediately following pre-training, the desired resolution of the quantization type can be pre-given while maintaining the weights determined in pre-training, and the distance values can be trained so that the classifier quantized using that quantization type achieves the best possible performance.
[0029] Because only the second value needs to be adapted, the advantage of this approach is that the classifier can determine the appropriate second value very quickly through training for different resolutions. Given the same amount of time available, this means that more data can be used to train the classifier, thereby improving its performance.
[0030] Furthermore, the weights of the classifier and the storage requirements for classifier computation can be advantageously reduced by quantizing the weights and storing the quantized weights.
[0031] Alternatively, the weights can be stored unquantized and quantized only during classifier runtime. In the case of a classifier trained using the above methods, this offers the advantage that the classifier can be quantized at different resolutions during runtime (also inference time) while maintaining adequate performance.
[0032] For example, it can be advantageous if a battery-powered system running a classifier selects the quantization type based on the battery's state of charge. With a high battery charge, a quantization type with high (and therefore energy-intensive from a classification perspective) resolution can be used to quantize the classifier, while with a low charge, a quantization type with low resolution can be chosen.
[0033] Furthermore, it is conceivable that the quantization type could be selected based on the workload (Schwere) of the classification task. The workload of the classification task can be determined, for example, by using a dataset containing data characterizing the classification task. For instance, the performance of the classifier on the dataset can characterize the workload of the dataset.
[0034] For example, it's conceivable that detecting distant and correspondingly small objects is far more difficult than detecting nearby objects. It's conceivable that for distant objects, a high-resolution quantization type must be chosen to achieve the desired performance. Furthermore, it's conceivable that low-resolution quantization types can be chosen for simple classification tasks to achieve the corresponding desired performance. For example, it's conceivable that a classifier that should determine whether it's day or night based on image data can already achieve moderate performance using very low-resolution quantization types.
[0035] Furthermore, it is conceivable that at least some of the weights of the classifier are based on pre-training provided prior to training.
[0036] Therefore, the weights of the classifier can be determined during pre-training, making it possible to use these weights as the basis for many different quantization types.
[0037] Furthermore, it is conceivable that, during pre-training, at least a portion of the multiple weights is determined based on a first value that quantizes at least a portion of the multiple weights to a pre-given second number.
[0038] This implementation can be understood as using a different quantization type for pre-training than for subsequent training. This results in the classifier being given multiple weights applicable to multiple different quantization types. To quantize the classifier according to one of the multiple quantization types, the step size of the desired quantization type can simply be used as a second value.
[0039] This has the following advantages: the weights of the classifier can be quantized for different resolution quantization types, where the classifier's performance remains appropriate despite quantization to different resolutions.
[0040] Furthermore, it is conceivable to use a dataset of input data for training, where there is a desired output for at least one input data, wherein the classifier determines the output for the input data, and then adapts the distance value based on the difference between the determined output and the desired output.
[0041] Furthermore, it is conceivable to use a classifier and determine the desired output based on weights determined during pre-training.
[0042] The advantage of this implementation is that the desired output does not need to be determined manually; instead, it can be automatically determined by the classifier using weights determined during pre-training. This automation allows for the determination of multiple desired outputs in significantly less time compared to what would be possible manually. Therefore, a much larger dataset can be determined for training the classifier. With this larger dataset, more data can be used to train the classifier, thereby further improving performance. Attached Figure Description
[0043] Embodiments of the present invention will now be described in more detail with reference to the accompanying drawings. In the drawings: Figure 1 The method for training a classifier is illustrated schematically in the form of a flowchart; Figure 2 The structure of a control system for manipulating actuators is schematically shown. Figure 3 An embodiment for controlling a robot that is at least partially autonomous is schematically illustrated; Figure 4 An embodiment for controlling a production system is illustrated schematically; Figure 5 An embodiment for a control access system is illustrated schematically; Figure 6 An embodiment for controlling and monitoring systems is illustrated schematically; Figure 7 An embodiment for controlling a personal assistant is illustrated schematically; Figure 8 An embodiment for controlling a medical imaging system is illustrated schematically; Figure 9 The training system used to train the classifier is illustrated schematically. Detailed Implementation
[0044] Figure 1 A flowchart illustrating a method for training a classifier is shown. In this embodiment, the classifier is provided by a neural network. The neural network includes weights arranged in layers.
[0045] In the first step (1), the neural network is trained by adapting the weights of the neural network. In this embodiment, gradient descent is used to adapt the weights. In this embodiment, the weights are binary floating-point numbers in IEEE 754 format.
[0046] To determine the multiple gradients required for gradient descent, multiple input data from a first training data set are fed into a neural network, where for each input data there exists a desired output corresponding to the input data. The neural network determines the output for each input data. To determine the output, the corresponding computation is quantized according to a pre-given first quantization type. In this embodiment, an 8-bit resolution for the first quantization type is chosen. In alternative embodiments, other resolutions may also be chosen.
[0047] In this embodiment, the step size is adapted during training to determine an appropriate step size for the first quantization type. In an alternative embodiment, it is also conceivable to set the step size to a fixed value. In this embodiment, the same step size is used to quantize the weights. In an alternative embodiment, it is also conceivable to use different step sizes for different weights.
[0048] The desired output is then compared with the output determined by the neural network via a loss function, where the loss function determines a loss value that characterizes the deviation between the determined output and the desired output. Here, the negative log-likelihood function can be used as the loss function in particular. Multiple gradients with respect to multiple weights and the loss value are then determined based on the loss function, and the weights are adapted according to their negative gradients. A gradient with respect to the step size of the loss function is also determined, and the step size is adapted according to the negative gradients.
[0049] To determine the gradient, a so-called backward pass is performed on the loss value through the neural network. During the backward pass, the weights of the neural network are not quantized. In this embodiment, the weights of the neural network are stored in IEEE 754 format during training.
[0050] In an alternative embodiment, the first step (1) is repeated iteratively until a pre-given number of iterations has been reached or the determined loss value is below a pre-given threshold. In each iteration, multiple new input data can be randomly determined from the training data set, thereby training the neural network. Alternatively, the weights can be determined based on the gradients of all training data.
[0051] In the second step (2), the neural network trained in the first step (1) is then used to determine the output for each of the multiple input data in the second training data set. The output determined for the input data is provided as the desired output in the training data set used for that input data. In an alternative embodiment, it is also conceivable that the desired output is determined manually rather than by means of a neural network.
[0052] In the third step (3), the neural network is adapted so that it can achieve suitable performance for the second quantization type. In this embodiment, a 4-bit resolution is selected for the second quantization type. However, in alternative embodiments, other resolutions may also be selected here. For training in the third step (3), the neural network uses the weights determined in the first step (1). For training in the third step (3), the weights are not adapted, and the second step size of the second quantization type is determined such that the second step size achieves the best possible performance with respect to the second training data set determined in the second step when using the second quantization type.
[0053] To this end, the neural network is provided with multiple input data sets and a second training data set, each corresponding to a set of desired outputs. The neural network then determines multiple outputs for the multiple input data sets, wherein the weights are quantized according to a second quantization type to determine the outputs.
[0054] Subsequently, a loss function is used to determine the loss value, which characterizes the difference between multiple expected outputs and multiple determined outputs. The same loss function used in the first step (1) can be used here as the loss function. The gradient with respect to the loss value is then determined for a second step, and the second step is adapted according to the negative gradient.
[0055] In an alternative embodiment, step (3) is repeated iteratively until a predetermined number of iterations is reached or the determined loss value is below a predetermined threshold. In each iteration, multiple new input data can be randomly determined from the second training data set, thereby training the neural network. Alternatively, the weights can be determined based on the gradients of all training data.
[0056] After training, the trained neural network and a second step size are provided as the training result, after which the training method ends.
[0057] Figure 2 Showing the use in Figure 1 The classifier (60) described in the embodiments is used in the control system of the actuator (10) in the manipulating environment (20). The environment (20) is detected in sensors (30), especially imaging sensors, such as video sensors, at preferably regular time intervals. These sensors can also be provided by multiple sensors, such as a stereo camera. The sensor signals (S) of the sensors (30) – or each sensor signal (S) in the case of multiple sensors – are transmitted to the control system (40). The control system (40) thus receives the sequence of sensor signals (S). The control system (40) determines the manipulation signal (A) from it, which is transmitted to the actuator (10).
[0058] The control system (40) receives a sequence of sensor signals (S) from the sensor (30) in an optional receiving unit (50), which converts the sequence of sensor signals (S) into a sequence of input images (x) (alternatively, the sensor signals (S) can also be directly taken as input images (x)). For example, the input image (x) can be a fragment of the sensor signals (S) or further processed. The input image (x) includes individual frames of a video recording. In other words, the input image (x) is determined based on the sensor signals (S). The sequence of input images (x) is then fed to a classifier (60).
[0059] The classifier (60) is preferably configured by parameters. The parameters are parameterized, including weights and a second step size, and are stored in and provided by the parameter memory (P).
[0060] The classifier (60) determines the output (y) from the input image (x), wherein the computational operations required to determine the output (y) are quantized based on a second step size and a second quantization type resolution. The output (y) is fed to an optional transformation unit (80), from which a control signal (A) is determined, which is then fed to an actuator (10) to control the actuator (10) accordingly. In this embodiment, the classifier (60) is configured to detect objects in the input image (x), and the output (y) includes information about the objects detected by the sensor (30).
[0061] The actuator (10) receives the control signal (A), is controlled accordingly, and performs a corresponding action. In this case, the actuator (10) may include (not necessarily structurally integrated) control logic circuitry that determines a second control signal from the control signal (A) and then uses the control signal to control the actuator (10).
[0062] In another embodiment, the control system (40) includes a sensor (30). In yet another embodiment, the control system (40) may alternatively or additionally include an actuator (10).
[0063] In another preferred embodiment, the control system (40) includes at least one processor (45) and at least one machine-readable storage medium (46) on which instructions are stored, which, if executed on at least one processor (45), cause the control system (40) to perform the method according to the invention.
[0064] In an alternative implementation, a display unit (10a) is provided instead of or attached to the actuator (10).
[0065] Figure 3 This demonstrates how a control system (40) can be used to control at least partially autonomous robots, and here at least partially autonomous motor vehicles (100).
[0066] The sensor (30) may be, for example, a video sensor preferably arranged in a motor vehicle (100).
[0067] A classifier (60) is set up to identify objects from the input image (x).
[0068] The actuator (10) preferably arranged in the motor vehicle (100) can be, for example, the brake, drive or steering mechanism of the motor vehicle (100). Thus, the control signal (A) can be determined to cause the actuator (10) to be controlled so that the motor vehicle (100) avoids, for example, collision with an object identified by the classifier (60), especially when the object is of a specific category, such as a pedestrian.
[0069] Alternatively, the at least partially autonomous robot may also be other mobile robots (not shown), such as those that move forward by flying, swimming, diving, or walking. The mobile robot may also be, for example, a lawnmower or a cleaning robot that is at least partially autonomous. Even in these cases, the control signal (A) may be determined to cause the drive and / or steering mechanisms of the mobile robot to be manipulated to prevent the at least partially autonomous robot from colliding with objects identified by the classifier (60), for example.
[0070] Alternatively or additionally, the display unit (10a) can be controlled using the control signal (A) and, for example, displayed an input image (x) and objects detected by the classifier (60) on the input image (x). For example, in the case of a motor vehicle (100) with a non-automatic steering system, it is possible that the display unit (10a) is controlled using the control signal (A) such that when it is determined that the motor vehicle (100) is about to collide with one of the reliably identified objects, the display unit outputs an optical or acoustic warning signal.
[0071] Figure 4 One embodiment is shown in which a control system (40) is used to operate the production machine (11) of the production system (200) by manipulating the actuator (10) that controls the production machine (11). The production machine (11) may be, for example, a machine for stamping, sawing, drilling and / or cutting.
[0072] The sensor (30) can then be, for example, an optical sensor that detects, for instance, the characteristics of the manufactured products (12a, 12b). It is possible that these manufactured products (12a, 12b) are movable. It is possible that the actuator (10) controlling the production machine (11) is manipulated according to the detected allocation of the manufactured products (12a, 12b) so that the production machine (11) accordingly performs the correct subsequent processing steps in the manufactured products (12a, 12b). It is also possible that by identifying the correct characteristics of the same manufactured products (12a, 12b) (i.e., no misallocation), the production machine (11) is accordingly adapted to the same production steps for processing subsequent manufactured products.
[0073] Figure 5 One embodiment is shown in which a control system (40) is used to control an access system (300). The access system (300) may include a physical access controller, such as a door (401). A video sensor (30) is set up to detect people. The detected image can be interpreted by means of a classifier (60). If multiple people are detected simultaneously, their identities can be determined particularly reliably, for example, by assigning them to each other (i.e., objects), such as by analyzing their movements. An actuator (10) may be a lock that releases or de-releases the access controller according to a control signal (A), such as opening or closing the door (401). For this purpose, the control signal (A) can be selected based on object detection by the classifier (60), such as based on the determined identity of the person. Instead of a physical access controller, a logical access controller may also be provided.
[0074] Figure 6 An embodiment is shown in which a control system (40) is used to control a monitoring system (400). This embodiment is similar to... Figure 5 The embodiment shown differs in that, instead of an actuator (10), a display unit (10a) is provided, which is controlled by a control system (40). For example, the identity of an object recorded by a classifier (60) can be reliably determined by the classifier (60) so as to infer, for example, which become suspicious, and thus an operation signal (A) can be selected so that the object is represented by the display unit 10a in a color-highlighted manner.
[0075] Figure 7 One embodiment is shown in which a control system (40) is used to control a personal assistant (250). The sensor (30) is preferably an optical sensor that receives an image of a user's (249) gesture.
[0076] Based on the signal from the sensor (30), the control system (40) determines the control signal (A) for the personal assistant (250), for example, by a classifier (60) performing gesture recognition. The determined control signal (A) is then transmitted to the personal assistant (250) and the personal assistant is thus controlled accordingly. The determined control signal (A) can be selected, in particular, such that the control signal corresponds to a desired control inferred by the user (249). The desired control can be determined based on the gesture recognized by the artificial neural network (60). The control system (40) can then select the control signal (A) to transmit to the personal assistant (250) based on the desired control and / or select the control signal (A) to transmit to the personal assistant based on the desired control (250).
[0077] The corresponding operation may include, for example, a personal assistant (250) retrieving information from a database and reproducing the information to the user (249) in an acceptable manner.
[0078] Instead of the personal assistant (250), household appliances (not shown), especially washing machines, stoves, ovens, microwaves, or dishwashers, can also be set up so that they can be controlled accordingly.
[0079] Figure 8 One embodiment is shown in which a control system (40) is used to control a medical imaging system (500), such as an MRT, X-ray, or ultrasound device. A sensor (30) may be provided, for example, via an imaging sensor, to manipulate a display unit (10a) via the control system (40). For example, a classifier (60) may determine whether an area recorded by the imaging sensor is conspicuous, and then a manipulation signal (A) may be selected such that the area is represented by the display unit (10a) in a color-highlighted manner.
[0080] Figure 9 An embodiment of a training system (140) is shown, which is configured for, for example, according to Figure 1 The method shown trains the classifier (60). For training, the training data unit (150) accesses a computer-implemented database (St2), wherein the database (St2) includes at least one training data set (T), wherein the training data set (T) includes multiple sensor records (x... i ), where for sensor recording (x) i ), which exist in the training data set respectively with the sensor records (x) i The corresponding expected output (y) i ).
[0081] The model parameter memory (St1) provides parameters to the classifier (60). ), where the parameters ( This includes multiple weights and quantization types of step sizes for the neural network (60).
[0082] The training data unit (150) determines at least one sensor record (x) from the training data set (T). i ) and its corresponding expected output (y) i ), and record the data from the sensor (x) i The data is transmitted to the classifier (60). The classifier (60) is based on the sensor record (x). i Determine the output In order to determine the output The classifier is quantized using a pre-defined resolution and a step size.
[0083] Expected output (y) i ) and the determined output It is transferred to the change unit (180).
[0084] Based on the determined output and the expected output (y) i Therefore, the new parameters are determined by changing the unit (180). ), where the new parameters ( ) includes the initial parameters ( The same weights are applied, and the step size is changed. To this end, the unit (180) is modified by using a loss function to determine the output. With the expected output (y) i The comparison is performed. The loss function determines the loss value, which characterizes the determined output. Deviation from expected output (y) i How far is it?
[0085] The changing unit (180) determines new parameters based on the determined loss value. In this embodiment, this is achieved by means of gradient descent, preferably stochastic gradient descent or Adam.
[0086] The determined new model parameters ( The parameters are stored in the model parameter memory (St1).
[0087] In other embodiments, the described training iteratively is repeated for a predefined number of iterations, or iteratively repeated until the metric falls below a predefined threshold. In at least one iteration, new parameters determined in the previous iteration ( ) used as parameters of the neural network ).
[0088] Furthermore, the training system (140) may include at least one processor (145) and at least one machine-readable storage medium (146) containing instructions that, when executed by the processor (145), cause the training system (140) to perform a training method according to one aspect of the invention.
[0089] The term "computer" includes any device used to process pre-given computational rules. These computational rules can exist in the form of software, hardware, or a hybrid of software and hardware.
Claims
1. A computer-implemented method for training a classifier (60), wherein the classifier (60) is configured to determine an output (y) for input data (x), wherein the output (y) characterizes the classification of the input data (x), and the classifier (60) includes a plurality of weights for determining the output (y) based on the weights, wherein at least a portion of the plurality of weights of the classifier (60) is provided based on pre-training prior to training, wherein at least one of the plurality of weights is quantized to a pre-given first number of first values, wherein two successive first values differ by a distance value, further wherein, for training, the distance values are adapted such that the classifier quantized using this quantization type achieves the best possible performance, and the plurality of weights are not adapted. The weights are stored in an unquantized manner and are only quantized during classifier runtime, so that the classifier is quantized for different resolutions during runtime.
2. The method of claim 1, wherein during pre-training, at least a portion of the plurality of weights is determined based on a first value that quantizes at least a portion of the plurality of weights to a pre-given second number.
3. The method of claim 2, wherein the pre-given second quantity is different from the pre-given first quantity.
4. The method according to any one of claims 1 to 3, wherein input data (x) is used. i The data set is used for training, wherein for at least one input data (x) i There exists a desired output (y) i ), wherein the classifier for the input data (x) i Determine the output And then based on the determined output and the expected output (y) i The difference between the distance values is used to adapt the distance values.
5. The method of claim 3, wherein the desired output (y) is determined by means of the classifier (60) and based on weights determined during pre-training. i ).
6. A computer-implemented method for running a classifier (60), the method comprising the steps of: • The classifier (60) shall be trained according to any one of claims 1 to 5; • Determine the input data (x); • The classifier (60) determines the output (y) for the input data (x).
7. The method of claim 6, wherein the actuator (10) and / or display device (10a) are controlled based on the output (y).
8. A computer program product having a computer program configured to perform the method according to any one of claims 1 to 7.
9. A machine-readable storage medium (46, 146) having a computer program stored thereon, the computer program being configured to perform the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method and apparatus for learning low-precision neural network
CN109754063A
