Methods for training a machine learning model

The method addresses underrepresentation of parameters in machine learning models by component-wise averaging non-zero gradients, enhancing training efficiency and model performance in control tasks.

DE102023204151A1Pending Publication Date: 2024-11-07ROBERT BOSCH GMBH LIMITS HAFTUNG 70469 +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
DE102023204151
Authority / Receiving Office
DE · DE
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-05-04
Publication Date
2024-11-07

AI Technical Summary

Technical Problem

Existing machine learning models struggle to adapt parameters that are underrepresented in training data due to averaging gradients over a large number of training elements, leading to inadequate training for rare but critical situations.

Method used

A method that determines gradients for each training data element, component-wise averages non-zero gradients above a threshold, and adjusts the model directionally based on the overall gradient, ensuring underrepresented parameters are effectively trained.

Benefits of technology

Enhances training efficiency by focusing on relevant parameters, even if they are underrepresented, improving model performance in scenarios like driving stability programs and control tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

According to various embodiments, a method for training a machine learning model is provided, comprising determining, for each of a plurality of training data elements, a gradient of an objective function, wherein the gradient has a component for each of a plurality of parameters of the machine learning model, generating an overall gradient by component-wise averaging the determined gradients by summing, for each component, the values ​​of the determined gradients for that component and dividing a resulting sum for the component by the number of determined gradients for which the component is above a predetermined threshold, and adjusting the machine learning model in a direction given by the overall gradient.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] The present disclosure relates to methods for training a machine learning model.

[0002] Many types of machine learning models are trained by determining the gradient of an objective function (e.g., a loss or a reward), which indicates the dependence of the objective function value on parameters of the respective machine learning model (e.g., the weights of a neural network). Depending on whether the objective function should be maximized or minimized, the parameters of the machine learning model are then adjusted in the direction of the gradient or in the opposite direction. The gradient is typically averaged over a large number of training data elements; this means that the adjustment is not performed per training data element, but typically across batches of training data elements.However, it may happen that the objective function value depends on a specific parameter only for a few training data elements, and the corresponding gradient component becomes so small due to averaging that the machine learning model is practically not adapted for such an underrepresented gradient component, even though it would be necessary for some situations (which are only represented by the few training data elements). Adaptation could be particularly important for such situations, for example, because they correspond to extreme, but therefore rarely occurring, traffic situations.

[0003] Therefore, approaches that improve training for parameters underrepresented in training data are desirable.

[0004] According to various embodiments, a method for training a machine learning model is provided, comprising determining, for each of a plurality of training data elements, a gradient of a target function, wherein the gradient has a component for each of a plurality of parameters of the machine learning model, generating an overall gradient by component-wise averaging the determined gradients by summing the values ​​of the determined gradients for each component and dividing a resulting sum for the component by the number of determined gradients for which the component lies above a predetermined threshold, and adapting the machine learning model in a direction given by the overall gradient.

[0005] The method described above allows parameters of a machine learning model to be trained appropriately, even if they are underrepresented in the training data, i.e., the output of the machine learning model does not depend on these parameters for most training data elements. In other words, it prevents the training data elements relevant for training such parameters from being "diluted" by the large number of training data elements that are not relevant for training these parameters.

[0006] Various examples of implementation are given below.

[0007] Embodiment 1 is a method for controlling a robot as described above.

[0008] Embodiment 2 is a method according to Embodiment 1, wherein the objective function depends on rewards contained in the training data items and specify rewards for state transitions caused by outputs of the machine learning model.

[0009] In other words, the machine learning model can be trained for a control task using reinforcement learning. Especially in such a context, the approach described above achieves more efficient training.

[0010] Embodiment 3 is a method according to embodiment 1 or 2, wherein the predetermined threshold value is zero (e.g. within the scope of the calculation accuracy).

[0011] For each component, a gradient value is only included in the averaging if it actually represents a dependency on the respective parameter. This prevents dilution of training data elements relevant for underrepresented parameters by training data elements that are not relevant for these parameters.

[0012] Embodiment 4 is a method according to one of the embodiments 1 to 3, wherein the machine learning model is configured and trained to receive information about the kinematic state of a vehicle as input and to output control information for the vehicle for a driving stability program (e.g. ABS, ESP).

[0013] Especially in such a control scenario, parameters of the machine learning model are often underrepresented, since in most cases the driving is “normal”, i.e. there is no special situation in which, for example, an ESP or ABS must intervene.

[0014] Embodiment 5 is a method for controlling a technical system, comprising training a machine learning model according to one of embodiments 1 to 4, supplying information about states of the technical system to the machine learning model, and controlling the technical system according to outputs of the trained machine learning model in response to the supplied information.

[0015] Embodiment 6 is a device configured to perform a method according to any one of embodiments 1 to 5.

[0016] Embodiment 7 is a computer program including instructions that, when executed by a processor, cause the processor to perform a method according to any one of embodiments 1 to 5.

[0017] Embodiment 8 is a computer-readable medium storing instructions that, when executed by a processor, cause the processor to perform a method according to any one of embodiments 1 to 5.

[0018] In the drawings, like reference characters generally refer to the same parts throughout the several views. The drawings are not necessarily to scale, emphasis instead generally being placed upon illustrating the principles of the invention. In the following description, various aspects are described with reference to the following drawings. Fig. 1 shows a vehicle. Fig. 2 shows a flowchart illustrating a method for training a machine learning model according to one embodiment.

[0019] The following detailed description refers to the accompanying drawings, which, by way of illustration, show specific details and aspects of this disclosure in which the invention may be practiced. Other aspects may be utilized, and structural, logical, and electrical changes may be made without departing from the scope of the invention. The various aspects of this disclosure are not necessarily mutually exclusive, as some aspects of this disclosure may be combined with one or more other aspects of this disclosure to form new aspects.

[0020] Various examples are described in more detail below.

[0021] Fig. 1 shows a vehicle 101.

[0022] In the example of Fig. 1, a vehicle 101, for example a car or truck, is provided with a vehicle control device 102.

[0023] The vehicle control device 102 has data processing components, e.g., a processor (e.g., a CPU (central processing unit)) 103 and a memory 104 for storing control software according to which the vehicle control device 102 operates and data processed by the processor 103.

[0024] For example, the stored control software (computer program) includes instructions that, when executed by the processor, cause the processor 103 to implement a machine learning model 105.

[0025] The vehicle control device 102 can perform various control tasks ranging from driver assistance functions to fully autonomous driving. The vehicle control device 102 determines the respective control actions using the machine learning model 105 (i.e., the learning model 105 implements a control strategy).

[0026] For example, according to one embodiment, the vehicle control device 102 is a control device for an anti-lock braking system (ABS), i.e., it generates a desired brake pressure (also referred to as input (wheel) brake pressure) for a brake 106, and is optimized using model-based learning. For example, data about the behavior of the vehicle is determined using a model (in this case, for example, pairs of input (i.e., desired) brake pressure (over several time steps) and the resulting speed profile), and this data can then be used as training data for the vehicle control device 102. The vehicle control device 102 is trained, for example, using reinforcement learning (RL).The training of the vehicle control device 102 can consist in the machine learning model 105 being trained on an external device (training device or training (computer) system) and then being loaded onto the vehicle control device 102, e.g. by means of simulations (alternatively, the vehicle 101 itself can be implemented as a simulated vehicle in a simulation environment and the vehicle control device 102 can thus be trained).

[0027] In reinforcement learning, an attempt is made to train an agent (or a control strategy that the agent follows), in the above example the vehicle control device 102 (or the machine learning model 105) in such a way that a certain reward is as large as possible (in the above example, for example, depending on how successfully braking was carried out).

[0028] Rewards are typically accumulated over time steps and / or episodes (i.e., control runs), so that the agent must maximize a cumulative reward. This is typically done by adjusting the agent's parameters in the direction of the gradient of the cumulative reward or by gradient descent, i.e., in the opposite direction to the gradient, in the case of using a loss to be minimized instead of a reward to be maximized.

[0029] A typical RL algorithm follows a data-driven approach and considers an additive objective function (hereafter a loss function to be minimized) over the parameters θ of the control strategy to be trained based on N available transitions τ (from a simulation or experiments) of the controlled system (e.g., the controlled device and its environment) in a data set D (e.g., in a replay buffer): L(θ)=1N∑τ∈Dl(θ,τ) Typical loss terms ℓ are based either on Monte Carlo estimates of rewards (or utility, reward or return) or on a critical function that evaluates the performance of the actions selected by the strategy (given by the parameters θ) under parameters.

[0030] The above additive loss leads to a (total) gradient ∇θ=1N∑τ∈D∇l(θ,τ) which is the average gradient over the dataset.

[0031] This gradient can be used with any gradient-based optimization algorithm such as gradient descent or ADAM to adjust the parameters of the control strategy (or a model, e.g., a neural network, that implements it).

[0032] The calculation of average gradients according to (1) and a fitting of parameters corresponding to these gradients works well for training neural networks, but has difficulties with more localized methods such as look-up tables or linear control strategies π(s) = θ T ϕ(s), where ϕ(s) are features of the current system state s (e.g., radial basis function features).

[0033] In these cases, most parameter gradients are zero, since the actions are only influenced by a subset of the parameters. Therefore, gradient averaging as in equation (1) averages mainly over zero entries, which causes problems when some parameters are rarely active (i.e., when they rarely influence actions).

[0034] Therefore, according to various embodiments, a gradient component is only included in the averaging if a gradient is present for the respective parameter (ie this gradient component is not zero or is above a minimum value ε; e.g. a (small) value ε is used to allow a tolerance around zero within the scope of the calculation accuracy).

[0035] Thus, for each gradient component (i.e., for each parameter of the control strategy), an average of the values ​​above the minimum value is determined. This improves training performance in practice.

[0036] Instead of averaging according to (1), the total gradient is determined according to various embodiments by ∇θ=∑τ∈D∇l(θ,τ)∑τ∈D1∇l(θ,τ)>ϵ, where 1 |∇ℓ(θ,τ)|>εis the element-wise indicator function that yields a vector that is zero everywhere and is one for a gradient component only if the absolute value of the gradient component (which is a scalar) of the scalar gradient entry is greater than ε. That is, the i-th entry is one if |(∇ℓ(θ, τ)) i | > ε and otherwise zero. The division of the two vectors of equation (2) is element-wise (i.e., the i-th component of the numerator by the i-th component of the denominator yields the i-th component of the result). The threshold value ε can be zero (as explained above as a small tolerance, e.g., ε=10 -6 ) can be selected.

[0037] For a control strategy implemented with a lookup table (i.e. each component of θ is an entry of a lookup table that specifies the action to be performed for a given state), this equation is equivalent to ∇θ=∑τ∈D∇l(θ,τ)select(θ,τ)

[0038] Here, select (;) returns a vector of all zeros, except for the lookup table entries selected for one of the transitions from D. For such an entry, the vector contains the number of transitions for which the entry was selected.

[0039] By averaging according to equations (2) and (3), parameters of the machine learning model 105 are better taken into account during training, even if they are underrepresented in the training dataset. As a simple example, the machine learning model 105 has two parameters θ1 and θ2, and in dataset D, θ1 is active for 90% of the training data elements (i.e., transitions) and θ2 for the other 10%.

[0040] So (for simplicity, only training data elements for ten transitions are present in the data set D) the gradients ∇ℓ(θ, τ) according to a very simple example are (1; 0), (1; 0), (1; 0), (1; 0), (1; 0), (1; 0), (1; 0), (1; 0), (1; 0), (0; 1), where the first component belongs to θ1 and the second to θ2.

[0041] An averaging according to (1) would yield (0.9; 0.1).

[0042] Thus, the gradient component for θ1 is nine times larger than that for θ2 when averaging according to equation (1). This makes it difficult to choose a learning rate that works for both parameters, since the effective updates for θ1 are also nine times larger.

[0043] However, an averaging according to (2) (or (3)) yields (1; 1), whereby the machine learning model 105 is also adapted to the underrepresented parameter θ2.

[0044] As described above, this approach can be used for vehicle stability control systems (ESP (electronic stability program), ABS, etc.). However, it can be applied to any other control strategy for a technical system that is parameterized by local policies, such as lookup tables. Furthermore, the approach described above can be applied not only to reinforcement learning but also to the training of machine learning models in other contexts (e.g., classification tasks, etc.).

[0045] In summary, according to various embodiments, a method is provided as described in Fig. 2 shown.

[0046] Fig. 2 shows a flowchart 200 illustrating a method for training a machine learning model according to one embodiment.

[0047] In 201, for each of a plurality of training data elements (e.g., a training batch), a gradient of an objective function is determined, wherein the gradient has a component for each of a plurality of parameters of the machine learning model (e.g., for each weight of a neural network). The objective function is, for example, a loss function or reward function. Determining the gradient means that the gradient is determined for the respective input to the machine learning model, which specifies the training data element.

[0048] In 202, a total gradient (or "averaged" gradient) is determined by component-wise averaging the determined gradients by summing, for each component, the values ​​of the determined gradients for that component and dividing a resulting sum for the component by the number of determined gradients for which the component is above a predetermined threshold (the result of this division is then the value of the component of the total gradient).

[0049] In 203, the machine learning model is adapted in a direction given by the overall gradient (in the direction it points if the objective function is to be maximized (reward), or in the opposite direction if it is to be minimized (loss)).

[0050] The procedure of Fig.2 can be performed by one or more computers having one or more data processing units. The term “data processing unit” can be understood as any type of entity that enables the processing of data or signals. The data or signals can, for example, be handled according to at least one (i.e., one or more than one) specific function performed by the data processing unit. A data processing unit can include or be formed from an analog circuit, a digital circuit, a logic circuit, a microprocessor, a microcontroller, a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processor (DSP), a programmable gate array (FPGA) integrated circuit, or any combination thereof.Any other way of implementing the respective functions described in more detail herein may also be understood as a data processing unit or logic circuit arrangement. One or more of the method steps described in detail herein may be performed (e.g., implemented) by a data processing unit through one or more specific functions performed by the data processing unit.

[0051] According to various embodiments, the method is therefore particularly computer-implemented.

[0052] After training, the machine learning model can be applied to sensor data obtained from at least one sensor. The output of the machine learning model thus provides a result about a physical state of an environment of the at least one sensor and / or the at least one sensor itself, or the method can include using the output of the trained machine learning model, which it provides in response to an input of sensor data, as such a result.

[0053] In other words, the method may comprise inferring or predicting the physical state of an existing real object from measurements of physical properties (i.e., sensor data concerning the object) by means of the trained machine learning model (i.e., its output in response to the sensor data).

[0054] For example, after training, the machine learning model is used to generate a control signal for a robotic device by feeding it with sensor data regarding the robotic device and / or its environment. The term "robotic device" can be understood as referring to any technical system (with a mechanical part whose movement is controlled), such as a computer-controlled machine, one or more vehicles, a household appliance, a power tool, a manufacturing machine, a personal assistant, or an access control system.

[0055] Various embodiments can receive and use sensor signals from various sensors, such as video, radar, LiDAR, ultrasound, motion, thermal imaging, etc., for example, to obtain sensor data regarding states of the respective technical system and configurations and scenarios. The processing of the sensor data by the machine learning model can include classifying the sensor data or performing semantic segmentation on the sensor data, for example, to detect the presence of objects (in the environment in which the sensor data was obtained). Embodiments can be used to train a machine learning system and control a robot, e.g., autonomously by robot manipulators, to achieve various manipulation tasks under different scenarios. In particular, embodiments are applicable to controlling and monitoring the execution of manipulation tasks, e.g.,in assembly lines.

Claims

[1] A method for training a machine learning model (105), comprising: determining, for each of a plurality of training data items, a gradient of an objective function, the gradient having a component for each of a plurality of parameters of the machine learning model (105); Generating an overall gradient by component-wise averaging the determined gradients by summing the values ​​of the determined gradients for each component and dividing a resulting sum for the component by the number of determined gradients for which the component lies above a predetermined threshold; and Adapting the machine learning model (105) in a direction given by the overall gradient. [2] The method of claim 1, wherein the objective function depends on rewards contained in the training data items and specify rewards for state transitions caused by outputs of the machine learning model (105). [3] A method according to claim 1 or 2, wherein the predetermined threshold value is zero. [4] Method according to one of claims 1 to 3, wherein the machine learning model (105) is configured and trained to receive information about the kinematic state of a vehicle (101) as input and to output control information for the vehicle (101) for a driving stabilization program. [5] Method for controlling a technical system, comprising: Training a machine learning model (105) according to one of claims 1 to 4; Supplying information about states of the technical system to the machine learning model (105); and Controlling the technical system according to outputs of the trained machine learning model (105) in response to the supplied information. [6] Device arranged to carry out a method according to one of claims 1 to 5. [7] A computer program comprising instructions which, when executed by a processor (103), cause the processor (103) to perform a method according to any one of claims 1 to 5. [8] A computer-readable medium storing instructions which, when executed by a processor (103), cause the processor (103) to perform a method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method and device for monitoring the driving stability of a vehicle on a driving route ahead

    DE102017209258A1