Model calculating unit and control unit for selectively calculating an RBF model, a gaussian process model and an MLP model
11537090 · 2022-12-27
Assignee
Inventors
- Andre Guntoro (Weil der Stadt, DE)
- Ernst Kloppenburg (Ditzingen, DE)
- Heiner Markert (Stuttgart, DE)
- Martin Schiegg (Korntal-Muenchingen, DE)
Cpc classification
G06N7/01
PHYSICS
F02P5/15
MECHANICAL ENGINEERING; LIGHTING; HEATING; WEAPONS; BLASTING
International classification
Abstract
A model calculating unit for the selective calculation of an RBF model or of a neural layer of a multilayer perceptron model having a hardwired processor core designed in hardware for calculating a fixedly specified computing algorithm in coupled function blocks. The processor core is designed to calculate an output variable for an RBF model as a function of one or multiple input variables of an input variable vector, of supporting points, of length scales, of parameters specified for each supporting point, the processor core furthermore being designed to calculate an output variable for each neuron for the neural layer of the multilayer perceptron model having a number of neurons as a function of the one or the multiple input variables of the input variable vector, of a weighting matrix having weighting factors and an offset value specified for each neuron.
Claims
1. A control unit, comprising: a microprocessor; and one or multiple model calculating units for selectively calculating an RBF model or a neural layer of a multilayer perceptron model, each of the model calculating units including a hardwired processor core configured completely in hardware to calculate a definitely specified computing algorithm in coupled functional blocks, the processor core being configured to calculate an output variable for an RBF model as a function of: (i) one or multiple input variables of an input variable vector, (ii) supporting points, (iii) length scales, and (iv) parameters specified for each of the supporting points, the processor core furthermore being configured to calculate an output variable for each neuron of a neural layer of a multilayer perceptron model having a number of neurons as a function of: (i) the one or the multiple input variables of the input variable vector, (ii) a weighting matrix having weighting factors, and (iii) an offset value specified for each of the neurons; wherein each of the one or more model calculating units is hardwired, is formed completely in hardware, and is not capable of executing software code; wherein each processor core is configured to perform, based on a selection variable, a selection between (i) the calculation of the output variable for the RBF model, and (ii) the calculation of each output variable for each neuron of the neural layer of the multilayer perceptron model; wherein the control unit is configured to receive detected sensor signals from a sensor system in an internal combustion engine as the input variable vector, and to control the internal combustion engine as a function of the calculated output variable.
2. The control unit as recited in claim 1, wherein for calculating the RBF model, the output variable is formed in the processor core as a sum of a value calculated for each of the supporting points, the value being a product of a parameter associated with the respective supporting point and a result of an exponential function of a value that results from the quadratic distance, weighted by the length scale, of the respective supporting point from the input variable vector, and/or a sum of the values of the input variables weighted by a weighting factor determined by the neuron and the input variable and the offset value specified to the neuron being calculated and the result being transformed using an activation function to obtain the output variable for the neuron.
3. The control unit as recited in claim 1, wherein a common memory area is assigned to the supporting points and the weighting matrix with weighting factors.
4. The control unit as recited in claim 1, wherein a shared memory area is assigned to the parameters specified for each of the supporting points and to the offset values specified for each neuron.
5. The control unit as recited in claim 1, wherein each processor core is configured to select as a function of a further selection variable a type of activation function for the multilayer perceptron model and/or to perform a calculation of a Gaussian process kernel.
6. The control unit as recited in claim 5, wherein the activation function is a kink function, or a sigmoid function, or a hyperbolic tangent function, or a linear function.
7. The control unit as recited in claim 1, wherein each processor core is configured to use local length scales for the calculation of the RBF model as a function of an RBF selection variable.
8. The control unit as recited in claim 1, wherein each processor core is configured to perform a calculation of partial derivations of the RBF model as a function of a gradient selection variable.
9. The control unit as recited in claim 1, wherein each processor core is developed in a surface area of an integrated chip.
10. The control unit as recited in claim 1, wherein each processor core is configured to initialize the output variable as a function of a configuration variable during a loop calculation for ascertaining the sum of the result of the additions for all supporting points to a specified value.
11. The control unit as recited in claim 10, wherein each processor core is configured to initialize multiple output variables of an output variable vector as a function of a configuration variable during the loop calculation for ascertaining the sum of the results of the additions for all supporting points to a specified value.
12. The control unit as recited in claim 1, wherein each processor core includes a state machine and one or multiple calculation operation blocks, the calculation blocks including a MAC block and an exponential function calculation block, and each processor core further includes a memory to store the one or multiple input variables of the input variable vector, the supporting points, the length scales, the parameters specified for each supporting point, and of the output variable.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1) Specific embodiments are explained in greater detail below on the basis of the figures.
(2)
(3)
(4)
(5)
(6)
DETAILED DESCRIPTION OF EXAMPLE EMBODIMENTS
(7)
(8) Model calculating unit 22 is hardwired and is accordingly not designed like microprocessor 21 to execute a software code and thereby to execute a variable function specified by software. In other words, no processor is provided in model calculating unit 22 so that the latter is not able to be operated by a software code. Focusing on a specified model function allows for a resource-optimized implementation of such a model calculating unit 22. In an integrated structural design, the model calculating unit 22 may be implemented in surface area-optimized fashion, which additionally allows for fast calculations.
(9) Control unit 2 is essentially used to process sensor signals S or sensor variables, which are recorded by a sensor system in internal combustion engine 3, and/or external inputs V, and to apply, cyclically at definitely specified time intervals of e.g. 1-100 ms or in angular synchronous manner as a function of a crankshaft angle of an operated internal combustion engine, values of one or multiple corresponding control variables A to internal combustion engine 3 so that the latter may be operated in a conventional manner.
(10)
(11) With the aid of state machine 11, values of input variables stored in an input variable memory area of memory 12 may be calculated by repeated loop calculations in order to obtain intermediate variables or output variables that are written into a corresponding output variable memory area of memory 12.
(12) State machine 11 is designed to calculate an RBF model (RBF: Radial Basis Function).
(13) A radial basis function corresponds to a function whose value depends only on the distance from the origin so that the function according to this definition is radially symmetric and that furthermore these functions are used as basis functions of an approximation.
(14) State machine 11 may be described according to the following pseudocode:
(15) TABLE-US-00001 /* input transformation */ for (k=0; k<p7; k++) { ut[k] = u[k]*pl[k] + p2[k]; } /* loop calculation */ for (j=p8; j<p6; j++) { i = j * p7; t = 0; for (k=0; k<p7; k++) { d = V[i+k] − ut[k]; t += L[k] * d * d; } y[0] += p3[j]*exp(−t); } /* output transformation */ z[0] = y[0] * p4[0] + p5[0];
where p7: maximum index value for the input variables of the input variable vector, indicates the dimension of the input variable vector p8: minimum index value (normally zero, except in interruption and continuation of the calculation) p6: maximum index value (number of supporting points) p3: parameters of the RBF model u: input variables ut: transformed input variables L: dimension-wise length scales V: training points or supporting points p1, p2: variables for the input transformation for each of the input variables of the input variable vector p4, p5: variables for the output transformation with dimension 1 (singleton).
(16) With the aid of the above pseudocode, it is possible to perform the following calculation for the RBF model:
y[0]=Σ.sub.j=0.sup.p6-1(p3[j].Math.exp(−Σ.sub.k=0.sup.p7-1L[k].Math.(V[j,k]−ut[k]).sup.2))
(17) As shown graphically in
(18) An input and/or output transformation of the input variables of the input variable vector and, respectively, of the output variables of the output variable vector may be performed with the aid of scaling variables p1 and p2 specified for each element of the input variable vector and, respectively for the output variable p4 and p5.
(19) The calculation of the RBF model allows for a slim design of model calculating unit 22 so that its surface area requirement in an integrated structural design is low.
(20) The existing hardware may also be modified as follows for the general calculation of a neural layer of a multilayer perceptron model.
(21) The result of the sum of the weighted values of the input variable vector ut.sub.0 . . . ut.sub.p7-1 has an offset value O.sub.0 . . . O.sub.P6-1 (corresponds to p3[0] . . . p3[p6−1]) applied to it, in particular applied additively. The result is transformed using a specified activation function “act”. As a result, one obtains a corresponding value of an output variable vector y.sub.0 . . . y.sub.p6-1. The provision of the offset value O.sub.0 . . . O.sub.p6-1 for each neuron 20 provides another degree of freedom for the model formation.
y[j]=act(0[j]+Σ.sub.k=0.sup.p7-1v.sub.j,k*ut[k]) for j=0 . . . p6−1
(22) Defining the controlled variables p6 makes it possible to set the number of neurons 20 of the neural layer to be calculated. By using the values of the output variable vector y.sub.0 . . . y.sub.P6-1 of a neural layer as input variable vector for calculating a subsequent neural layer, a multilayer perceptron model may be used in model calculating unit 22 so that the number of neural layers of the multilayer perceptron model may be implemented by repeatedly calling the function according to the above pseudocode or by repeatedly calling the model calculating unit 22 with accordingly changed parameters.
(23) As activation function “act,” one of several activation functions may be provided in calculating the perceptron model, which may be calculated by the activation function calculation block 14 of model calculating unit 22. As activation functions act, it is possible to use for example a kink function, a hyperbolic tangent function, a sigmoid function or a linear function, as shown respectively in
(24) A pseudocode for state machine 11 is shown below, which alternatively calculates the RBF model or a neural layer of a perceptron model.
(25) TABLE-US-00002 flag_clr_y = cfg_autoclear_y; /* input transformation */ for (k=0; k<p7; k++) { ut[k] = u[k]*p1[k] + p2[k]; } /* loop calculation */ for (j=p8; j<p6; j++) { i = j * p7; t = (cfg_mlp) ? p3[j] : 0.0f; // initialization for MLP calculation for (k=0; k<p7; k++) { if (cfg_mlp) { t += V[i+k] * ut[k]; } else { d = V[i+k] − ut[k]; n = (cfg_rbf_local) ? i+k : k; f = L[n] * d; t += f * d; // storing intermediate values for ascertaining partial derivations if (cfg_pd) ud[k] = f; } } if (cfg_mlp) { switch (cfg_activation_function) { case 1: e = (t>=0.0f) ? t : 0.0f; // kink function break; case 2: // sigmoid function e = sigmoid(t); break; case 3: // tanh function e = tanh(t); break; default: // linear function e = t; } y[j] = e; } else { // for Gaussian process model/RBF model e = exp(−t); if (flag_clr_y) for (n=0; n<p9; n++) y[n] = 0.0f; /* for non-MLP , p9 defines length */ q = p3[j] * e; y[0] += q; if (cfg_pd) for (n=1, k=p10; n<p9; n++,k++) y[n] += q * ud[n]; /* clear flag */ flag_clr_y = false; } /* output transformation */ j = (cfg_mlp) ? p6 : p9; for (k=0; k<j; k++) { z[k] = y[k] * p4[k] + p5[k]; }
(26) The hardware design defined by the above pseudocode makes it possible to calculate, in addition to a neural layer of a multilayer perceptron model, also a Gaussian process model or an RBF model (RBF: Radial Basis Function).
(27) It may be seen that in the execution of the loop function it is possible to perform a case distinction using variable cfg_mlp. At cfg_mlp=1, the calculation of the neural layer is selected and using cfg_activation_function=0 . . . 3 the type of the activation functions described above may be selected. At cfg_mlp=0, a Gaussian process model or an RBF model is calculated. Here a selection of the activation function is not necessary since it may always be calculated using the exponential function. In this manner, it is possible to use model calculating unit 22 both for calculating Gaussian process models and RBF models as well as for calculating a neural layer of an MLP model and to require in the process only a small surface area in an integrated construction of the state machine.
(28) Furthermore, depending on the selected calculation, a vector or a single value may be output as the result. Using a configuration flag cfg_autoclear_y, the processing unit is able to provide automatically for the initialization of the summing of the loop calculation to 0. This has the advantage that it is not necessary to clear or initialize the memory prior to starting the calculation. Furthermore, it is not necessary temporarily to store preliminary results during a resuming calculation. Only a different memory section is required for storing the result since y stores the pointer address.
(29) In the above pseudocode, the initialization of the result is performed in an additional loop calculation.
(30) TABLE-US-00003 if (flag_clr_y) for (n=0; n<p9; n++) y[n] = 0.0f;
y[0] is subsequently used as initial value for the summing of
(31) TABLE-US-00004 q = p3[j] * e; y[0] += q;
in order to obtain the result of the calculation of the Gaussian process model or of the RBF model.
(32) The initialization is thus performed in the first pass of the loop calculation if the configuration flag cfg_autoclear_y is set. No additional loop calculation in the calculating unit is necessary for this initialization of the calculation since the accumulator may be initialized with zero via this configuration flag.
(33) In a resumption of the loop calculation after a prior abortion, it is now possible to leave out the input scaling so as to speed up the calculation. Furthermore, the abortion of the calculation may be permitted only at the end of the calculation of the outer loop so that the result of the intermediate calculation does not have to be discarded.
(34) Moreover, by configuration of the selection variable cfg_pd, the above pseudocode allows for the calculation of partial derivations of the Gaussian process model or the RBF model with global or local length scales according to the selected input variables.
(35) On the whole, by configuration of selection variables such as, e.g., cfg_mlp, cfg_rbf_local, cfg_pd, the above hardware structure of model calculation unit 22 makes it possible to support the following different models. MLP model having different activation functions; RBF model having global length scales; RBF model having local length scales; Gaussian process model, whose calculation essentially corresponds to the calculation of the RBF model; and partial derivations of the RBF model having local or global length scales or of the Gaussian process mode.