Method and apparatus for memory efficient execution of neural networks
By performing lossy compression and frequency conversion of intermediate results in the neural network computing device, the problem of limited storage of intermediate results during large data volume calculation is solved, and more efficient computing and storage is achieved.
Patent Information
- Application Number
- CN201910179660.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2018-03-12
- Filing Date
- 2019-03-11
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2039-03-11
AI Technical Summary
When existing neural networks process large data volumes, intermediate calculation results cannot be effectively stored in cache memory, resulting in the calculation being limited by the data transmission bandwidth between the computing hardware and external memory.
By gradually calculating the data segment in the computing device, compressing it with lossy compression, converting it into the frequency range for filtering, and compressing the intermediate results using methods such as running length encoding or entropy encoding, and transmitting them to external memory.
The amount of data transmitted between the computing device and the external memory is reduced, the computing efficiency is improved, the energy consumption and access time is reduced, and more efficient neural network computing is achieved.
Smart Images

Figure CN110263910B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a neural network, and in particular to a measure for intermediately storing intermediate calculation results of each neuron layer. Background Art
[0002] In particular, neural networks used for image processing must process large amounts of data. For the calculation of a neural network, computing hardware is usually available that performs the calculation of only a portion of the neural network, wherein the algorithm provides for multiple uses of the computing hardware. The calculation results obtained during the calculation of a portion of the neural network are temporarily stored for this purpose and can be called up again when required.
[0003] Thus, for example, for an image with an input resolution of 2048 x 1024 pixels, calculation results for a single neuron layer can be generated which, with a (pixel) word size of 8 bits, have a size of approximately 134 MB. This amount of data can no longer be temporarily stored in a cache memory during the calculation of a neural network, since the size of the cache memory is usually limited.
[0004] Therefore, it is usually necessary to transfer the intermediate results of the neural network to an external memory outside the computing hardware of the neural network and read it back from there when necessary. However, access to external memory requires more energy and higher access time than access to registers or intermediate memories (cache) inside the (computing hardware). Therefore, the calculation of high data volumes in neural networks is not limited by the computing power of the computing hardware, but by the bandwidth of the data transmission between the computing hardware and the external memory for storing the intermediate results.
[0005] "CNNpack: Packing Convolutional Neural Networks in the Frequency Domain" by Y. Wang et al. Advances in Neural Information Processing Systems 29, Barcelona, Spain, 2016 and "Compressing Convolutional Neural Networks in Frequency Domain" by W. Chen et al. Proc. ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD), San Francisco, USA, 2016 It is known that the size of network parameters, i.e., weights and bias values, is reduced by converting network parameters into the frequency domain, and thereby reducing the parameter size: similar values are mapped to common values by clustering methods in frequency space. Weight sharing is thus achieved.
[0006] From the publication "Adaptive Weight Compression for Memory-Efficient Neural Networks," by JH Ko et al., at the Design, Automation Test in Europe Conference Exhibition (DATE), Lausanne, Switzerland, 2017, it is known to compress network parameters for neurons of a neural network, wherein the compression method specifies the compression rate via a quality factor, which depends on the training step. The compression algorithm is similar to jpeg image compression.
[0007] However, both methods mentioned above involve the compression of network parameters known a priori, which are usually only loaded but not necessarily intermediately stored. Summary of the invention
[0008] According to the invention, a method for operating a neural network, in particular a convolutional neural network, is provided as claimed in claim 1 , as well as a neural network and a computing system as claimed in the independent claims.
[0009] Further embodiments are described in the dependent claims.
[0010] According to a first aspect, a method for operating a computing system having a neural network, in particular a convolutional neural network, is provided, wherein the computing system has a computing device for sequential calculations of the neural network and a memory external to the computing device for buffering intermediate results of the calculations in the computing device, the method comprising the following steps:
[0011] - step-by-step calculation of data segments using a neural network, each of which represents a group of intermediate results,
[0012] - lossily compressing one or more of the data sections in order to obtain a compressed intermediate result,
[0013] - transferring the compressed intermediate results to the external memory.
[0014] The above method provides for storing calculation results of the neural network outside the computing device (computing hardware), that is, not in registers or other intermediate memories that are components of the computing device (computing hardware), wherein the calculation results are to be further processed as intermediate results by the neural network or another neural network. These intermediate results are to be stored in an external memory and, for this purpose, compressed before being transferred to the external memory in order to reduce the amount of data to be transferred between the computing device and the external memory. This is achieved by compression and decompression in the computing device or, if necessary, in a stage (Stufe) between the computing device and the external memory.
[0015] The compression of data usually makes use of the repetition of data elements in order to reduce the size of the data. For example, run-length compression makes use of the possibility of encoding sequences of identical values (e.g. zeros which often occur in neural networks) by indicating their length. Such run-length compression is particularly effective if the data to be compressed are manipulated in such a way that the data have one or more sequences of identical data elements or zeros which are as large as possible.
[0016] It may be provided that for lossy compression the data segments are each transformed into a frequency range and that the transformed data segments are filtered element by element in the frequency range in order to obtain modified data segments.
[0017] The element-by-element filtering may include multiplying a portion of the elements of the transformed data segment by 0 in order to obtain a modified data segment having a number of elements “0” that is greater than the number of elements “0” in the original data segment of the input feature card.
[0018] “Element-by-element filtering” here means an operation in which the data elements of the transformed data segment are set to zero. Mathematically, “setting to zero” corresponds to an element-by-element multiplication with a compression matrix A, the entries of which are can be zero. In the following, "filtering" is understood to mean such a setting to zero or (respektive) element-by-element comparison
[0019] Multiply.
[0020] In particular, one or more modified data sections are encoded, in particular jointly, using a predefined encoding method in order to obtain a compressed intermediate result, in particular by means of run-length coding or entropy coding.
[0021] According to the above method, the data segment to be compressed is manipulated in such a way that it is represented by a data sequence that contains one or more zero sequences (Abstract von Nullen) of the largest possible extent. This manipulation can be lossy, so that the compression method used is lossy overall. The use of lossy compression for storing intermediate results of calculations of neural networks is in principle reliable, because neural networks are particularly robust to noise (quantization noise, single-event errors, etc.) compared to other algorithms.
[0022] Before compressing the data segment, the data segment is modified in such a way that the data segment has one or more sequences of identical data elements or zeros of the largest possible range. For this purpose, for example, a frequency transformation can be provided, which includes that the intermediate results to be compressed are transmitted as input data into the frequency range. The frequency range data, that is, the data segments transmitted into the frequency range, can be filtered in a simple manner according to the frequency components, so that after filtering the frequency range data, a larger data range is generated, which only has zeros. The data range can be encoded or compressed in a suitable manner, for example by means of run length coding or entropy coding.
[0023] According to one specific embodiment, for element-by-element filtering, the transformed data segments can be loaded with a compression matrix which is predefined individually, in particular for each neuron layer or calculation layer of the sequential calculation of the neural network.
[0024] In particular, the compression matrix can be adapted to the encoding method of the transformed data segments in such a way that better compression is achieved than if the encoding method were applied directly to the untransformed data segments.
[0025] The filtering in the frequency range can be performed, for example, with the aid of a compression matrix which enables element-by-element filtering of the frequency range data transformed into the frequency range, wherein an element of a data segment transformed into the frequency range corresponds to a frequency component having a frequency.
[0026] In particular, the compression matrix can be predefined in such a way that higher-frequency components of the transformed data segment are filtered.
[0027] Alternatively, a compression matrix can be predefined in that, during the training of the neural network, the matrix elements of the compression matrix A for each calculation layer are The neuron parameters of the neurons of the neural network are trained together, in particular by means of a backpropagation method.
[0028] The compression matrix can be modified in a suitable manner in order to adapt the reduction of the frequency range data. For this purpose, the compression matrix can be adjusted during the training of the neural network or added to the trained neural network afterwards. When added to the trained neural network, the learning rates of the compression matrix and the network parameters can be different or the network parameters can be fixed during the learning of the compression matrix. In the layer-by-layer calculation of the neural network, a separate compression matrix can be determined for each of the neuron layers. The compression matrix also determines how strongly the calculation results of the individual neuron layers can be compressed.
[0029] The adaptation of the compression matrix during the training method of the neural network makes it possible to minimize the error introduced into the neural network by compression or to limit it to a predetermined error value. The above method can be applied particularly well to convolutional neural networks (CNN), which have been trained by conventional, non-specialized training. The convolution is performed in the spatial domain during the implementation of the convolutional neural network. For the compression in the frequency range, which may be lossy, the data to be compressed are thus divided into smaller and limited-size slices.
[0030] The separation of the calculation by the neural network and the compression of the calculation results makes it possible that the compression method according to the invention does not need to be taken into account when developing the neural network, and the compression unit can also be arranged separately from the calculation device. In addition, the calculation unit can be switched on and off dynamically in order to set a control option that allows a compromise between accuracy of the calculation of the neural network and the compression rate (i.e. the required memory bandwidth and the calculation duration). The proposed lossy compression method has the advantage that the compression rate can be adjusted so that a guaranteed statement can be made about the required memory bandwidth that is ultimately obtained. This is particularly advantageous for applications in real-time-critical systems.
[0031] Furthermore, for calculations with the aid of the neural network, compressed intermediate results are retrieved from the external memory and decompressed, and further calculations are performed as a function of the decompressed intermediate results.
[0032] It can be provided that the neural network corresponds to a convolutional neural network having a plurality of neuron layers, each of which is assigned a neuron parameter, wherein elements of an output feature map can be obtained by loading data sections of one or more input feature maps with the neuron parameters assigned to the output feature maps.
[0033] Furthermore, compressed intermediate results can be transferred to the external memory, wherein for further calculations with the aid of the neural network the compressed intermediate results are retrieved from the external memory and decompressed in order to obtain decompressed data segments.
[0034] It can be provided that after the compressed intermediate result has been retrieved from the external memory, the intermediate result is decoded by means of a decoding method and then inversely transformed in order to obtain a decompressed intermediate result. The decoding method is preferably selected in this case in a complementary manner to the encoding method. Furthermore, the inverse transformation corresponds to a process that is complementary to the transformation into the frequency range.
[0035] According to a further aspect, a computing system having a neural network, in particular a convolutional neural network, is provided, wherein the computing system has a computing device for sequential calculations of the neural network and a memory external to the computing device for buffering intermediate results of the calculations in the computing device, wherein the computing device is designed to:
[0036] - stepwise calculation of data segments by means of a neural network, said data segments each representing a group of intermediate results,
[0037] - lossily compressing one or more of said data segments in order to obtain a compressed intermediate result,
[0038] - transferring the compressed intermediate results to the external memory.
[0039] Furthermore, a decompression unit may be provided, which is designed to retrieve compressed intermediate results from the external memory for calculations using the neural network, to decompress the intermediate results, and to perform further calculations as a function of the decompressed intermediate results. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The following further describes the implementation method according to the accompanying drawings.
[0041] Figure 1 A schematic diagram showing a computing system for computing a neural network;
[0042] Figure 2 A flow chart for illustrating a method for compressing intermediate results of calculations in a neural network for external storage is shown;
[0043] Figure 3 a to 3e show an illustration of the compression method according to an exemplary data segment;
[0044] Figure 4a to 4e illustrate an input feature card of a convolutional neural network, an input feature card divided into data slices, an input feature card transformed into a frequency range, an input feature card loaded with a compressed matrix transformed into a frequency range, a feature card loaded with a compressed matrix that is inversely transformed from the frequency range, and an input feature card shown in succession; and
[0045] Figure 5 a to 5f show a diagram of the method when the division into data segments is performed along the channel; and
[0046] Figure 6 An exemplary diagram shows the development of elements of a compression matrix for a neural network with 13 neuron layers in the case of training for 30 training cycles, wherein the grayscale illustrates the element values. DETAILED DESCRIPTION
[0047] Figure 1 The schematic diagram of a computing system 1 with a computing device 2 is shown. The computing device 2 includes a processor and / or other hardware units which are designed or particularly suitable for computing a neural network. Usually, the computing device 2 is configured such that components or hardware units are used multiple times for computing runs. In particular, hardware units are common: they calculate individual neuron layers or provide one or more computing steps for the step-by-step calculation of, for example, a convolutional neural network.
[0048] When calculating complex neural networks, calculations are performed successively and step by step by the calculation device 2, wherein intermediate results are respectively generated which are not used further in the immediately following calculation, for example, only in the calculation of a further neuron layer. These intermediate results may correspond to such a large amount of data that they cannot be easily stored in the calculation device 2.
[0049] Therefore, provision is made for intermediate results of calculations of the calculation device 2 to be transferred to the external memory 4 and to be retrieved from there when they are required for subsequent calculations.
[0050] For this purpose, a compression unit 3 is provided to compress the intermediate results of the calculation of the neural network. The compressed calculation results are then transmitted to an external memory 4 and stored there.
[0051] For further processing of previously stored intermediate results, they can be read from the external memory 4 and decompressed by means of a decompression unit 5 in order to use the decompressed intermediate results stored temporarily for the next calculation step by the neural network.
[0052] If input data or intermediate results are further processed in sections by means of a neural network after the calculation of a neuron layer, compression or decompression of intermediate results in the calculation of the neural network can be used in particular in a meaningful way. This is the case in particular with convolutional neural networks. For example, such neural networks can be used for the perception of images, wherein a network with a size of fo x x y x c The output of the neuron layer can be regarded as fo c Different filtered 2D matrices. Each so-called channel consists of size fo x x y The processing by the convolutional neural network consists in convolving the input data one or more times with the network parameters (network weights) determined during the training process by means of computing elements (e.g. multiplication-accumulation units - MAC units) of the computing device 2, which are usually highly parallel in hardware. The network parameters can be regarded as filter coefficients (filter coefficients) or filters (filter).
[0053] To this end, the input and output feature cards are divided into dimensions t x xt y The slices are processed sequentially by the corresponding computing elements of the computing unit 2. As a result, the calculation results of the output feature card are obtained, wherein the input feature card is converted into slices of the output feature card sequentially according to the division into slices. The calculation results are collected for multiple or all slices and can be used as intermediate results for the calculation of the next layer or, if necessary, correspond to the output data of the neural network. Since the next neuron layer is usually calculated when all slices of the feature card have been processed, it is necessary to store the intermediate results in the middle. For this purpose, the intermediate results are compressed slice by slice and transmitted to the external memory 4. The division into slices makes it possible to access the data block by block or slice by slice.
[0054] The compression based on the calculation of tiles is described below, tiles of dimension D of 8×8 being used as an example.
[0055] exist Figure 2 , a flow chart for illustrating a method for operating a neural network based on one or more input feature cards for calculating one or more output feature cards and network parameters (network weights) predefined therefor is shown. In addition, Figure 3 a to 3e illustrate the compression method based on an exemplary 8x8 tile.
[0056] First, in step S1 , one or more feature cards are specified to which the possibly first neuron layer of the neural network is to be applied.
[0057] In step S2 , segments of adjacent data, one or more so-called slices, having dimension D are selected from one or more of the input feature cards according to the process flow, and then in step S3 one or more corresponding slices of an output feature card assigned to the network parameters are calculated therefrom using the network parameters.
[0058] The network parameters assigned to the output feature map are also called kernels. Such kernels represent parameterized units whose parameters are predefined for a specific feature map and a specific neuron layer / computation layer by the training process of the neural network. The kernel is essentially used to calculate the elements of the output feature map by converting the t of the slices of the input feature map into x xt y Input values are mapped to output values on the output feature card.
[0059] In step S4, a check is performed to determine whether there is sufficient free local memory for the intermediate results of the further calculations that may be performed on the slice of the feature card that is output in the computing unit. If this is not the case (option: no), the method is continued with step S5, otherwise (option: yes) the method jumps back to step S2 for the calculation of the next slice of the selected output feature card.
[0060] In step S5, the slices of the output feature card thus obtained are decomposed into the dimensions D=t x xt y The film. Figure 3 a shows a patch with the original pixel distribution.
[0061] In step S6 , the slices are converted individually or in groups into the frequency range by a transformation in order to obtain a dimension D= t x xt y Frequency range data (frequency range slices). In this case, a predetermined sequence of individual pixels of a slice is considered as a temporal or spatial sequence (temporal range or spatial range), so that a transformation into the frequency range is possible. Figure 3 b shows after transformation into the frequency range Figure 3 8 x 8 pieces of a.
[0062] The transformation may be, for example, a discrete cosine transform, a discrete sine transform, a Fourier transform, a fast Fourier transform, a Hadamard transform, etc. For example, for a 2D DCT transform of a slice matrix X, the following applies (wherein, by way of example, it is written: x =t y =n):
[0063]
[0064]
[0065]
[0066]
[0067] After the slice is transformed into the frequency range, the frequency range data is combined with the size t in step S7. x xt y The compression matrix A which is predefined for the relevant neuron layer or feature card is multiplied element by element in order to obtain a filtered frequency range slice or a slice provided with zero elements.
[0068] Figure 3 c shows an exemplary compression matrix, in which light-colored entries correspond to the value 1 and dark-colored entries correspond to the value 0. This compression matrix is exemplary and values between 0 and 1 may also be employed. Figure 3 d shows the frequency range slices (transformed data segments) loaded in the compressed matrix.
[0069] Depending on the entries of the compression matrix A, a change in the frequency range data (filtered data segment) may result.
[0070] In step S8, the slices transformed into the frequency range and loaded with the compression matrix A are encoded by means of a suitable compression method. The frequency range slices modified by the compression matrix contain a larger number of ranges and longer ranges, which contain consecutive zeros, which can be compressed in a particularly efficient manner, for example by a run-length coding method or by entropy coding. This makes it possible to achieve high compression rates, which only result in low information losses with respect to the application and calculation of the neural network. In step S9, the encoded frequency range slices are transferred to the external memory 4.
[0071] In step S10, it is checked whether further slices of the feature card should be calculated in a corresponding manner. If this is the case (option: yes), the method jumps back to step S2 and repeats the method of steps S2 to S9 for further slices of the feature card. Otherwise (option: no), the method continues with step S10.
[0072] In step S11, it is checked whether the next layer of the neural network is to be calculated based on the calculation results previously determined from the feature card. If this is the case (option: yes), the method is repeated by jumping back to step S1 to generate the feature card based on the intermediately stored encoded feature card. Otherwise (option: no), the intermediately stored output feature card represents the output of the neural network in compressed form. The output feature card can be decoded for further use by a decoding method corresponding to the compression method used.
[0073] In order to use the frequency range slices of the feature card from the external memory 4 for performing a new calculation, the encoded frequency range slices of the feature card are calculated in the decompression unit 5 by applying a decompression method corresponding to the compression method of step S8 and then inversely transformed by an inverse frequency transformation.
[0074] The slices loaded from the external memory are in frequency based on the compression method and are already coded and therefore stored in a compressed manner. After loading from the external memory, the slices are first decoded in the next calculation step, that is, decoded by RLE representation or entropy coding and then back-transformed from the frequency range into the spatial range (modified data segments) in order to create modified slices of the input feature map of the next neuron layer. Only then are the modified data segments converted into the output feature map assigned to the network parameters using the network parameters.
[0075] Figure 3 e shows the slices obtained by inverse transformation of the frequency range slices loaded with the compression matrix. It is recognized that Figure 3 The graph of e Figure 3 The graph of a is very similar.
[0076] When the compressed matrix A contains only entries of "1", for example, the original data is not changed by the inverse transformation.
[0077] Applying the compression matrix A to the frequency range slice corresponds to the application of a digital filter. The further (je weiter) the items in the compression matrix A are located in the upper left, the lower frequency components are loaded or filtered. On the contrary, the further the items in the compression matrix A are located in the lower right, the higher frequency components are loaded or filtered. In the case of a compression matrix with an item "0" in the lower right half, less fluctuation (fluctuation) is generated in the spatial range after the inverse transformation, that is, the high frequency components of the items of the inversely transformed output characteristic card are reduced or moved. However, the basic structure of the output characteristic card remains to exist.
[0078] It has been found that for transmission through a neuron layer, higher-frequency frequency components are less relevant for the representation error of a neural network than lower-frequency frequency components. Therefore, for compression of intermediate results of a neural network, a compression matrix can be selected that contains zeros in the entries corresponding to high-frequency frequency components.
[0079] In a further variant, data reduction can be achieved by setting the entries of the frequency range slices to zero before encoding in step S8 if the respective corresponding frequency components in the compression matrix do not reach a limit value. The frequency filtering is thus selected depending on the corresponding entries in the compression matrix.
[0080] exist Figure 4 In a to 4f, the entire process is applied to the following input data, which is transmitted through the feature cards in multiple channels ( Figure 4 a) is given. It can be seen that each of the feature cards is divided into pieces of the same size ( Figure 4 b) and by transforming to the frequency range ( Figure 4 c) to process the slices and to compress the matrix A ( Figure 4 d) to load in order to obtain the modified feature card ( Figure 4 f). After the modified frequency range slices have been coded / compressed in a suitable way (RLE or entropy coding), the modified frequency range slices ( Figure 4 d) stored in an external memory. To read the stored data again, the encoded frequency range slice is called up again, decoded and then inversely transformed ( Figure 4 e).
[0081] Alternatively, the input data can be divided along the channels, so that instead of the slices of the input feature card, a one-dimensional input data vector x can be processed. For a one-dimensional frequency transform, the following transformation rules apply:
[0082] .
[0083] The behavior is Figure 5 a to 5f schematically correspond to Figure 4 a to 4f are shown.
[0084] A separate compression matrix can be predefined for each neuron layer. If necessary, a separate compression matrix can be predefined for each of the channels.
[0085] For each of the compressed matrices t, there exists a corresponding dimension D = t in the compressed matrix x xt yThe number of elements of the compression matrix must be manually adjusted to a suitable compromise between the compression rate and the minimum error in the calculation of the neural network. This process is time-consuming. It is therefore proposed to optimize the elements of the compression matrix in an adaptation method. This can be done, for example, together with the training of the neural network. For example, the elements of the compression matrix can be optimized together with the coefficients of the neural network by means of a conventional training algorithm such as the back propagation algorithm. That is to say, the compression matrix is learned to the same degree (mass) as the neuron parameters. This eliminates the need for manual optimization of the elements of the compression matrix, and the compression of each neuron layer is automatically adjusted while taking into account the compression of other neuron layers.
[0086] Specifically, during the training method, the optimization is performed by loading the cost function on which the optimization is based with an additional term when training the neural network (see back propagation algorithm). This term can be the norm of the coefficients of the compression matrix (e.g. the L1 norm). The additional term acts as a regularization. In order to simultaneously train the neuron parameters of the neurons of the neural network and the elements of the filter matrix, the regularization can be weighted in the cost function by a factor α∈[0, 0.001].
[0087] exist Figure 6 In FIG. 1 , the development of the element values of the associated compression matrices for 30 training cycles is illustrated by way of example for a neural network with 13 neuron layers, each of which has an associated compression matrix, wherein the grayscale indicates the element values.
[0088] The above method is particularly efficient when the compression unit 3 is implemented in hardware. If such a hardware compression unit 3 processes, compresses and encodes the calculation results according to the above method by pipelining in a streaming mode, an increase in the effective bandwidth in the direction of the external memory 4 is possible. The same applies to the following decompression unit 5, which is used to read back, inversely transform and decode the frequency range slices of the intermediate results or feature cards from the external memory 4 according to the above method.
[0089] Since the transfer of data to the external memory 4 is much more energy-consuming and time-intensive than internal calculations and register accesses, the power consumption can be reduced and the data throughput per power unit can be increased by implementing the compression unit 3 and the decompression unit 5 .
[0090] The computing system and the corresponding method described above can be used, for example, for processing image data of camera images in motor vehicle applications. In this case, the image data captured by the camera system are processed by a neural network of the computing system in order to, for example, implement object recognition methods, segmentation methods or other classification methods for the image data. The image data processed in this way (segmented or classified) can then be used in a known manner in a driver assistance system or in a system for autonomous operation of a motor vehicle.
Claims
1. A method for operating a computing system (1) having a neural network, wherein the neural network has a plurality of neuron layers, and wherein the computing system has a computing device (2) for sequential computing of the neural network and an external memory (4) relative to the computing device for intermediate storage of intermediate results of the computing in the computing device (2), the method comprising the following steps: - calculating (S2, S3) data segments step by step by means of a neural network, said data segments each representing a group of intermediate results, - lossily compressing (S5, S6, S7, S8) one or more of said data segments in order to obtain a compressed intermediate result, and - transmitting (S9) the compressed intermediate result to the external memory (4) for intermediate storage, In this case, the data segments are each converted into a frequency range for lossy compression ( S6 ), wherein the transformed data segment is filtered element by element (S7) in order to obtain a modified data segment, wherein the filtering in the frequency range is performed by means of a compression matrix, and In this case, in the layer-by-layer calculation of the neural network, a separate compression matrix is determined for each neuron layer, which determines how strongly the calculation results of the respective neuron layer can be compressed.
2. The method according to claim 1, wherein: The neural network is a convolutional neural network.
3. The method according to claim 1 or 2, wherein: In order to perform calculations using the neural network, the compressed intermediate results are retrieved from the external memory (4), the compressed intermediate results are decompressed, and further calculations are performed based on the decompressed intermediate results.
4. The method according to claim 1 or 2, wherein: The element-by-element filtering (S7) comprises multiplying a portion of the elements of the transformed data segment by 0 so as to obtain a modified data segment having a number of elements "0" greater than the number of elements "0" in the data segment of the input feature card.
5. The method according to claim 1 or 2, wherein: One or more modified data segments are jointly encoded using a predefined encoding method in order to obtain the compressed intermediate result. The method according to claim 5 , wherein the encoding method is implemented by means of run-length encoding or entropy encoding.
7. The method according to claim 5, wherein: For element-by-element filtering ( S7 ), the transformed data segment is loaded with a compression matrix which is predefined individually for each calculation layer of the sequential calculation of the neural network.
8. The method according to claim 7, wherein: The compression matrix is adapted to the encoding method of the transformed data segments in such a way that better compression is achieved than if the encoding method were applied directly to the untransformed data segments.
9. The method according to claim 7 or 8, wherein: The compression matrix is predefined in such a way that higher-frequency components of the transformed data segment are filtered.
10. The method according to claim 9, wherein: The compression matrix is predefined in that, during the training of the neural network, matrix elements of the filter matrix for each calculation layer are trained together with neuron parameters of neurons of the neural network.
11. The method according to claim 10, wherein: The training is carried out with the aid of a back-propagation method.
12. The method according to any one of claims 1 to 2, wherein: The neural network corresponds to a convolutional neural network having a plurality of neuron layers, each of which is assigned a neuron parameter, wherein an element of an output feature card is respectively obtained by loading a data segment of at least one input feature card with a neuron parameter assigned to the output feature card.
13. The method according to any one of claims 1 to 2, wherein: The compressed intermediate results are transmitted to the external memory (4), and, for further calculations with the aid of the neural network, the compressed intermediate results are retrieved from the external memory (4) and decompressed in order to obtain decompressed data segments.
14. The method according to claim 12, wherein: After the compressed intermediate result has been retrieved from the external memory (4), the intermediate result is decoded by means of a decoding method and then inversely transformed in order to obtain a decompressed intermediate result.
15. A computing system (1) having a neural network, wherein the neural network has a plurality of neuron layers, and wherein the computing system (1) has a computing device (2) for sequential computing of the neural network and an external memory (4) relative to the computing device for intermediate storage of intermediate results of the computing in the computing device (2), wherein: The computing device (2) is configured to: - stepwise calculation of data segments by means of a neural network, said data segments each representing a group of intermediate results, - lossily compressing one or more of said data segments in order to obtain a compressed intermediate result, - transmitting the compressed intermediate result to the external memory (4) for intermediate storage, In this case, the data segments are each converted into a frequency range for lossy compression ( S6 ), wherein the transformed data segment is filtered element by element (S7) in order to obtain a modified data segment, wherein the filtering in the frequency range is performed by means of a compression matrix, and In this case, in the layer-by-layer calculation of the neural network, a separate compression matrix is determined for each neuron layer, which determines how strongly the calculation results of the respective neuron layer can be compressed.
16. The computing system (1) of claim 15, wherein the neural network is a convolutional neural network.
17. A computing system (1) according to claim 15 or 16, wherein the computing system has a decompression unit (5), which is configured to call the compressed intermediate result from the external memory (4) for calculation with the aid of the neural network, decompress the compressed intermediate result, and perform further calculations based on the decompressed intermediate result.
18. An application of a computing system according to any one of claims 15 to 17, wherein the computing system is used to process image data of a camera image in a driver assistance system for performing driver assistance functions or in a system for autonomous operation of a motor vehicle in order to perform an object recognition method, a segmentation method or a classification method for the image data.
19. A computer program product comprising a computer program configured to carry out all the steps of the method according to any one of claims 1 to 14. 20 . A machine-readable storage medium having a computer program stored thereon, the computer program being designed to carry out all the steps of the method according to claim 1 .
Citation Information
Patent Citations
Neural network processor and convolutional neural network processor
CN105260776A
Neural network accelerator for bit width partitioning and implementation method of neural network accelerator
CN107451659A
Apparatus and method to improve image or video quality or encoding performance by enhancing discrete cosine transform coefficients
US20170257645A1