A global pooling method and many-core system for neural networks

By performing preset pooling operations on each received point data in the multi-core system, the problem of multiple fully connected layer parameters and global pooling calculation delay in traditional convolutional neural networks is solved, and more efficient neural network processing is achieved , reduces storage and computing delays.

CN112446458BActive Publication Date: 2025-01-17LYNXI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN201910796532.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-08-27
Publication Date
2025-01-17
Estimated Expiration
2039-08-27

AI Technical Summary

Technical Problem

In traditional convolutional neural networks, there are many parameters of the fully connected layer and are prone to overfitting, and the global pooling calculation delay is long, which affects processing speed and efficiency.

Method used

The preset pooling operation is performed on each received point data in the multi-core system until all data pooling is completed. The final pooling result is obtained through average pooling or maximum pooling, reducing storage and calculation delays.

Benefits of technology

It improves the processing efficiency of neural networks, reduces computing delay and storage requirements, and improves the chip's unit time utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112446458B_ABST
    Figure CN112446458B_ABST
Patent Text Reader

Abstract

The present disclosure provides a global pooling method and a multi-core system for a neural network, the method comprising: receiving point data of the data to be processed inputted sequentially by the previous network layer; after each point data is received, performing a preset pooling operation based on the currently received point data until all the point data of the data to be processed are pooled. Based on the solution provided by the present disclosure, point operations can be used instead of graph operations in the pipeline operation of the multi-core system, that is, after each point data is received, it will be processed once to obtain an intermediate pooling result, until the final pooling result of the data to be processed is finally obtained, thereby reducing the calculation delay.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of neural network, and in particular to a global pooling method and a many-core system of a neural network. Background Art

[0002] With the continuous development of artificial intelligence technology, the application of deep learning is becoming more and more extensive. Convolutional Neural Networks (CNN) is a type of feedforward neural network that contains convolution calculations and has a deep structure. It is one of the representative algorithms of deep learning. The last layer of traditional CNN is a fully connected layer with a large number of parameters, which is easy to cause overfitting (such as Alexnet). In a CNN model, most of the parameters are occupied by the fully connected layer, which affects the processing speed and increases the processing time. Therefore, a solution of replacing the fully connected layer with global mean pooling is proposed. However, in the related technology, the calculation delay of global pooling is relatively long. Summary of the invention

[0003] In view of the above problems, the present disclosure provides a global pooling method and a many-core system of a neural network that overcome the above problems or at least partially solve the above problems.

[0004] According to one aspect of the present disclosure, a global pooling method of a neural network is provided, which is applied to a many-core system, and the method includes:

[0005] Receive the point data of the data to be processed input in sequence from the previous network layer;

[0006] After each point data is received, a preset pooling operation is performed based on the currently received point data until the pooling of all point data of the data to be processed is completed.

[0007] Optionally, after each point data is received, a preset pooling operation is performed based on the currently received point data until all point data of the data to be processed are pooled, including:

[0008] Receiving first point data input by the previous network layer, and performing a preset pooling operation based on the first point data to obtain a first pooling result;

[0009] Continue to receive the point data of the data to be processed, and perform the preset pooling operation after each point data is received until all the point data of the data to be processed are pooled, and a final pooling result is obtained.

[0010] Optionally, continuing to receive the point data of the data to be processed and performing the preset pooling operation after each point data is received until all the point data of the data to be processed are pooled to obtain a final pooling result, including:

[0011] Receiving the nth point data of the data to be processed, and performing a preset pooling operation on the nth point data based on the pooling result of the n-1th point data to obtain an nth pooling result;

[0012] Receive the Nth point data of the data to be processed, and perform a preset pooling operation on the Nth point data based on the pooling result of the N-1th point data to obtain an Nth pooling result;

[0013] Wherein, the Nth pooling result is the final pooling result of the data to be processed;

[0014] The N represents the number of points of the data to be processed, 1<n<N.

[0015] Optionally, the preset pooling operation includes: average pooling or maximum pooling.

[0016] Optionally, the storage space of the many-core system includes a first storage space and a second storage space.

[0017] When the preset pooling operation is an average pooling operation, after each point data is received, the preset pooling operation is performed based on the currently received point data until all point data of the data to be processed are pooled, including:

[0018] Receive the first point data and store it in the first storage space as data A1; initialize the data in the second storage space to 0, and store data B1=A1*(1 / N) in the second storage space;

[0019] Receive the nth point data and store it in the first storage space as data A n ; A n Output to the second storage space through the multiplier-adder to obtain B n =B n-1 +A n *(1 / N);

[0020] Receive the Nth point data and store it in the first storage space as data A N ; A N Output to the second storage space through the multiplier-adder to obtain B N =B N-1 +A N *(1 / N),

[0021] Wherein, N represents the number of points of the data to be processed, 1<n<N.

[0022] Optionally, the storage space of the many-core system includes a first storage space and a second storage space.

[0023] When the preset pooling operation is maximum pooling, after each point data is received, the preset pooling operation is performed based on the currently received point data until all point data of the data to be processed are pooled, including:

[0024] Receive the first point data and store it in the first storage space as data A1; initialize the data B0 in the second storage space to negative infinity, and store the maximum value in the second storage space, B1=Max(A1,B0);

[0025] Receive the nth point data and store it in the first storage space as data A n ; Store the maximum value in the second storage space, B n =Max(A n ,B n-1 );

[0026] Receive the Nth point data and store it in the first storage space as data A N ; Store the maximum value in the second storage space, B N =Max(A N ,B N-1 ),

[0027] Wherein, N represents the number of points of the data to be processed, 1<n<N.

[0028] According to another aspect of the present disclosure, a many-core system is provided, wherein the many-core system comprises:

[0029] A plurality of processing cores, at least one of the plurality of processing cores performing the following operations:

[0030] Receive the point data of the data to be processed input in sequence from the previous network layer;

[0031] After each point data is received, a preset pooling operation is performed based on the currently received point data until the pooling of all point data of the data to be processed is completed.

[0032] Optionally, the processing core includes:

[0033] A controller, configured to control receiving and storing point data input from a previous network layer;

[0034] a memory configured to store the point data;

[0035] An operator is configured to perform a preset pooling operation based on the point data under the control of the controller.

[0036] Optionally, the memory includes a first memory and a second memory.

[0037] Optionally, the operator is further configured to:

[0038] Receive the nth point data of the data to be processed, and perform a preset pooling operation on the nth point data based on the pooling result of the n-1th point data to obtain the nth pooling result;

[0039] Receive the Nth point data of the data to be processed, and perform a preset pooling operation on the Nth point data based on the pooling result of the N-1th point data to obtain the Nth pooling result;

[0040] Among them, the Nth pooling result is the final pooling result of the data to be processed; N represents the number of points of the data to be processed, 1<n<N.

[0041] Optionally, the operator is further configured to:

[0042] Perform average pooling operation on the point data in the memory. The specific configuration is:

[0043] Receive the first point data and store it in the first memory as data A1; initialize the data B in the second memory to 0, and store data B1=A1*(1 / N) in the second memory;

[0044] Receive the nth point data and store it in the first memory as data A n ;

[0045] A n Output to the second memory through the multiplier and adder to get B n =B n-1 +A n *(1 / N);

[0046] Receive the Nth point data and store it in the first memory as data A N ; A N Output to the second memory through the multiplier and adder to get B N =B N-1 +A N *(1 / N); where N represents the number of points of data to be processed, 1<n<N.

[0047] Optionally, the operator is further configured to:

[0048] Perform a maximum pooling operation on the point data in the memory, and the specific configuration is: receive the first point data and store it in the first memory as data A1;

[0049] Initialize the data B0 in the second memory to negative infinity, and store the maximum value in the second memory, B1 = Max(A1, B0); receive the nth point data and store it in the first memory as data A n ;

[0050] Store the maximum value in the second memory, B n =Max(A n ,B n-1 );

[0051] Receive the Nth point data and store it in the first memory as data A N ; Store the maximum value in the second memory, B N =Max(A N ,B N-1 );

[0052] Wherein, N represents the number of points of data to be processed, 1<n<N.

[0053] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, characterized in that the program is executed by a processor to implement the global pooling method of the neural network described in any one of the above items.

[0054] According to another aspect of the present disclosure, a computer program product is also provided, characterized in that when the computer program product is run on a computer, the computer is enabled to execute the global pooling method of the neural network as described in any one of the above items.

[0055] The present disclosure provides a more efficient global pooling method and multi-core system for neural networks, which obtains the final pooling result of the final data to be processed by performing a pooling operation on each data point input by the front layer. Based on the solution provided by the present disclosure, point operations can be used instead of graph operations in the multi-core system to reduce storage and computing delays.

[0056] The above description is only an overview of the technical solution of the present disclosure. In order to more clearly understand the technical means of the present disclosure, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present disclosure more obvious and easy to understand, the specific implementation methods of the present disclosure are listed below.

[0057] Based on the following detailed description of the specific embodiments of the present disclosure in conjunction with the accompanying drawings, those skilled in the art will become more aware of the above and other objects, advantages and features of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0059] Figure 1 A schematic diagram of a common pooling process is shown;

[0060] Figure 2 A schematic diagram of the global average pooling process is shown;

[0061] Figure 3 A schematic diagram of row pipeline operation in a many-core system is shown;

[0062] Figure 4 A schematic diagram of a global pooling method of a neural network according to an embodiment of the present disclosure is shown;

[0063] Figure 5 A schematic diagram of a first point data pooling process according to an embodiment of the present disclosure is shown;

[0064] Figure 6 A schematic diagram of a second point data pooling process according to an embodiment of the present disclosure is shown;

[0065] Figure 7 A schematic diagram of processing the pooling of intermediate point data according to an embodiment of the present disclosure is shown;

[0066] Figure 8 A schematic diagram of pooling processing of the last point data according to an embodiment of the present disclosure is shown;

[0067] Fig. 9 A schematic diagram of the data processing time of the conventional solution is shown;

[0068] Fig.10 A schematic diagram of data processing time according to an embodiment of the present disclosure is shown;

[0069] Fig.11 A schematic structural diagram of a many-core system according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0070] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0071] Figure 1shows a schematic diagram of the general pooling of a CNN neural network, see Figure 1 It can be seen that in the traditional pooling process, the feature map is slid in the form of a window (similar to the window sliding of convolution), and the operation is to take the average or maximum value in the window as the result. After the operation, the feature map is downsampled to reduce overfitting.

[0072] On the other hand, it is also proposed to replace the fully connected layer of the last layer of the CNN neural network with global mean pooling. Unlike the traditional fully connected layer, the global mean pooling method will be used to pool each feature. Figure 1 The whole image is globally averaged and pooled, so that each feature map can get an output. In this way, the use of global average pooling can not only greatly reduce the network parameters and avoid overfitting compared to the fully connected layer, but also each feature map is equivalent to an output feature, which represents the characteristics of the output class.

[0073] Figure 2 A schematic diagram of global average pooling (GAP) is shown in FIG. Figure 2 It can be seen that global average pooling does not take the average in the form of a window, but averages it in units of feature maps, that is, one feature map outputs one value.

[0074] The NIN (Network In Network) network architecture uses global average pooling to replace the traditional fully connected layer in CNN. In recognition tasks using convolutional layers, global average pooling can generate a feature map for each specific category (as many feature maps as there are classes). The advantages of global average pooling GAP are: the connection between each category and the feature map is more intuitive (compared to the black box of the fully connected layer), and it is easier to convert the feature map into classification probability; because there are no parameters to adjust in global average pooling, overfitting problems are avoided; global average pooling summarizes spatial information, so it is more suitable for spatial transformation of the input.

[0075] However, currently, global average pooling is performed on the entire image. Calculating the entire image at one time will concentrate the calculation at one moment. Assuming that the storage time of the entire image is t1 and the calculation time is t2, the time used to calculate the entire image using the traditional solution is t1+t2. Using this solution is likely to cause large calculation delays and waste of storage.

[0076] Many-core systems are multi-core processors that are mainly used for floating-point operations and intensive operations. Generally, row pipeline operations can be performed in many-core systems, that is, in units of rows. Figure 3 As shown in the figure, assuming that the filter of a picture is 3*3 and the stride is 2, the sliding window operation can be performed when there are 3 rows of data in the storage, so the storage only needs to store 4 rows of data at least to achieve parallel calculation and data reception, which reduces the storage amount and improves the overall computing power of the chip.

[0077] When global pooling is performed in the downstream pipeline operation of the many-core system, the size of the global pooling filter is the same as the size of the entire image, so there is no way to save storage, and the corresponding storage saving effect is not achieved, which goes against the original design intention of the many-core system.

[0078] The disclosed embodiment provides a more efficient global pooling method for a neural network, which is applied to a many-core system, such as Figure 4 As shown, the global pooling method of the neural network provided by the embodiment of the present disclosure may include:

[0079] Step S401, receiving point data of the data to be processed input sequentially by the previous network layer;

[0080] Step S402, after each point data is received, a preset pooling operation is performed based on the currently received point data until all the point data to be processed are pooled. The data to be processed may be image data or video data, etc. The neural network may include multiple network layers, such as a convolutional layer, a pooling layer, etc. The previous network layer may be any network layer in the neural network that inputs the data to be processed to the pooling layer, and the present disclosure does not limit the network structure and form of the neural network.

[0081] Based on the method provided by the embodiment of the present disclosure, point operations can be used instead of graph operations in the pipeline operation of the many-core system, that is, after each point data is received, it will be processed once to obtain an intermediate pooling result until the final pooling result of the data to be processed is finally obtained. There is no need to receive all the data and then perform pooling operations in a centralized manner, thereby effectively reducing computing delays.

[0082] As mentioned in the above step S402, the method provided in this embodiment will perform a preset pooling operation on each point data when it is received.

[0083] In an optional implementation, the above step S402 may include: receiving the first point data input by the previous network layer, performing a preset pooling operation based on the first point data, and storing the first pooling result after obtaining it; continuing to receive point data of the data to be processed, and performing the preset pooling operation after each point data is received until all point data of the data to be processed are pooled, and the final pooling result is obtained.

[0084] Further, assuming that the number of points in the entire image of the data to be processed is N, then for the nth point data, it can include: receiving the nth point data of the data to be processed, performing a preset pooling operation on the nth point data based on the pooling result of the n-1th point data, to obtain the nth pooling result; wherein 1<n<N.

[0085] For the Nth point data, it may include: receiving the Nth point data of the data to be processed and storing it in the first storage space, performing a preset pooling operation on the Nth point data based on the pooling result of the N-1th point data, and obtaining an Nth pooling result; wherein the Nth pooling result is the final pooling result of the data to be processed. In the embodiment of the present disclosure, each received point data and the preset pooling operation performed on the point data may be stored so as to quickly perform the preset pooling operation on the subsequently received point data.

[0086] In this embodiment, the storage space of the many-core system can be divided in advance and the first storage space and the second storage space can be selected so as to store the received point data and the pooling result after the preset pooling operation is performed on the point data separately, thereby improving the processing efficiency of the data. As mentioned above, the many-core system may include multiple processing cores, and the storage space of the many-core system may be the storage space of at least one of the multiple processing cores. The present disclosure does not limit the form of the storage space of the many-core system.

[0087] It is mentioned in the above embodiments that the received point data can be continuously pooled to obtain the final pooling result of the data to be processed. Optionally, the preset pooling operation may include: average pooling or maximum pooling, and the present disclosure does not limit the type of preset pooling operation. In an optional embodiment of the present disclosure, since the downstream pipeline operation of the multi-core system can be to input only one point data from the previous network layer at a time, it is possible to perform calculations when one point data is received. In this way, there is no need to receive and store all the point data before performing the pooling operation, which can effectively reduce the calculation delay and improve the efficiency of data processing.

[0088] The average pooling operation and the maximum pooling operation are described in detail below, assuming that the data in the first storage space is A and the data in the second storage space is B.

[0089] When the preset pooling operation is an average pooling operation, the process of obtaining the final pooling result of the to-be-processed data may include:

[0090] S1-1, receive the first point data and store it in the first storage space as data A1; initialize the data B in the second storage space to 0, and store data B1=A1*(1 / N) in the second storage space, such as Figure 5 As shown, in Figure 5 In the figure, the solid pixel block represents the first point data. After the pooling layer of the neural network receives the point data, it will store it in the first storage space.

[0091] S1-2, receiving the nth point data and storing it in the first storage space as data A n ; A n Output to the second storage space through the multiplier-adder, B n =B n-1 +A n *(1 / N).

[0092] Furthermore, if Figure 6 As shown, when the second point data arrives ( Figure 6 The second point data is stored in the first storage space as data A2; A2 is output to the second storage space through the multiplier-adder to obtain B2=B1+A2*(1 / N);

[0093] like Figure 7 As shown, when the nth (n>2) point data arrives, the nth point data is stored in the first storage space as data A n ; A n Output to the second storage space through the multiplier and adder to get B n =B n-1 +A n *(1 / N).

[0094] S1-3, such as Figure 8 As shown, the Nth point data is received and stored in the first storage space as data A N ; A N Output to the second storage space through the multiplier and adder to get B N =B N-1 +A N *(1 / N), the final data B = B N This is the final pooling result of the entire image. It can be seen that the solution provided by this embodiment can effectively utilize the storage space of the multi-core system, reduce memory, and separately calculate the point data of the entire image, further improve the image processing efficiency, and reduce calculation delay. Especially when the data to be processed contains a large amount of point data, the utilization rate of the chip per unit time can be greatly improved.

[0095] In another optional embodiment of the present disclosure, when the preset pooling operation is maximum pooling, the process of obtaining the final pooling result of the data to be processed may include:

[0096] S2-1, receive the first point data and store it in the first storage space as data A1; initialize the data B0 in the second storage space to negative infinity, and store the maximum value in the second storage space, B1 = Max (A1, B0), such as Figure 5 shown.

[0097] S2-2, receiving the nth point data and storing it in the first storage space as data A n ; Store the maximum value in the second storage space, B n =Max(A n ,B n-1 ).

[0098] Furthermore, if Figure 6 As shown, when the second point data arrives, the second point data is stored in the first storage space as data A2; and the maximum value is stored in the second storage space, B2 = Max (A2, B1);

[0099] like Figure 7 As shown, when the nth (n>2) point data arrives, the nth point data is stored in the first storage space as data A n ; and store the maximum value in the second storage space, B n =Max(A n ,B n-1 ).

[0100] S2-3, such as Figure 8 As shown, the Nth point data is received and stored in the first storage space as data A N ; Store the maximum value in the second storage space, B N =Max(A N ,B N-1 ), the final data B = B N This is the final pooling result of the entire image. N represents the number of points in the data to be processed, and 1<n<N. It can be seen that the solution provided by this embodiment can effectively utilize the storage space of the multi-core system and reduce the memory while calculating the point data of the entire image separately, further improving the image processing efficiency and reducing the calculation delay. Especially when the data to be processed contains a large amount of point data, the utilization rate of the chip per unit time can be greatly improved.

[0101] Fig. 9 , Fig.10Schematic diagrams of data processing time based on the traditional solution and the solution provided by the embodiment of the present disclosure are shown respectively. Fig. 9 As shown in FIG. 1 , as mentioned above, in the related art, t1+t2 is required to process the pooling operation of a picture. Fig.10 As shown, the solution provided by the embodiment of the present disclosure can realize parallel processing of storage and calculation. For example, the time used for storage is t1, the time used for calculation is t2, the intermediate storage and calculation parallel time is T, and the total time for processing a whole picture is t1+t2-T, which is much shorter than the previous processing time. The larger the picture, the more obvious the effect. That is, the solution provided by the embodiment of the present disclosure can greatly reduce the amount of storage and reduce the calculation delay.

[0102] For storage:

[0103] For example, for a 224*224 image, the related technology needs to store the entire 224*224 image and then perform global pooling, which requires 224*224 storage. However, the solution provided by the embodiment of the present disclosure can only store one point data in the first storage space and the second storage space respectively, that is, only 2 storage spaces are occupied. It can be seen that the solution provided by the embodiment of the present disclosure can be reduced to only the original 2 / (224*224) storage space for calculation, thereby greatly reducing the storage amount.

[0104] For calculating delay:

[0105] For example, if the same 224*224 image receives one point of data using 1 clk, a multiplication and addition calculation uses 1 clk.

[0106] Using traditional solutions, such as Fig. 9 As shown:

[0107] The time used to receive data is t1 = 224*224 clks.

[0108] The time used for calculation is t2=224*224 clks.

[0109] Calculate t1+t2=224*224+224*224 clks required for one image.

[0110] The solution provided by the embodiment of the present disclosure realizes storage and computation parallelism, and only t1+1=224*224+1 clks are needed to calculate one graph.

[0111] It can be seen that the embodiments of the present disclosure can not only save the storage space of the chip and reduce the computing delay, but also improve the unit time utilization of the chip.

[0112] Fig.11 Schematic diagram of the structure of the many-core system of the embodiment of the present disclosure. Fig.11As shown, the multi-core system of this embodiment includes processing cores 11-1M and an on-chip network 14. The processing cores 11-1M are all connected to the on-chip network 14. The on-chip network 14 is used to exchange data between the M processing cores and external data. At least one of the M processing cores performs the following operations: receiving point data of the data to be processed input in sequence by the previous network layer; after each point data is received, a preset pooling operation is performed based on the currently received point data until all the point data of the data to be processed are pooled. Among them, there may be multiple processing cores among the M processing cores that are mapped and perform global pooling operations at the same time to improve data processing efficiency.

[0113] like Fig.11 As shown, the processing core 11 may include a memory 111, an operator 113 and a controller 114. Among them, the memory 111 is used to store the processing instructions corresponding to the processing core 11 and the data to be processed in the pooling layer in the neural network layer and the processed data. In another optional implementation, the memory 111 may include a first memory and a second memory, the first memory is used to store the point data input by the previous network layer of the pooling layer in the neural network layer, and the second memory is used to perform a pooling result after a preset pooling operation is performed on the point data. The operator 113 is configured to perform a preset pooling operation based on the point data. The controller 114 is configured to control the operator 113 to perform a preset pooling operation. By dividing the memory 111 to store point data and pooling results separately, not only can the storage space of the chip be saved, but also the unit time utilization of the chip can be improved.

[0114] In an optional embodiment of the present invention, the operator 113 is further configured to receive the nth point data of the data to be processed, perform a preset pooling operation on the nth point data based on the pooling result of the n-1th point data, and obtain the nth pooling result; receive the Nth point data of the data to be processed, perform a preset pooling operation on the Nth point data based on the pooling result of the N-1th point data, and obtain the Nth pooling result; wherein the Nth pooling result is the final pooling result of the data to be processed; N represents the number of points of the data to be processed, 1<n<N.

[0115] In an optional embodiment of the present invention, the operator 113 is further configured to perform an average pooling operation on the point data in the memory 111, and is specifically configured as follows: receiving the first point data and storing it in the first memory as data A1; initializing the data in the second memory to 0, and storing data B1=A1*(1 / N) in the second memory; receiving the nth point data and storing it in the first memory as data A n ; A n Output to the second memory through the multiplier and adder to get B n =B n-1 +A n*(1 / N); Receive the Nth point data and store it in the first memory as data A N ; A N Output to the second memory through the multiplier and adder to get B N =B N-1 +A N *(1 / N). Where N represents the number of points of data to be processed, 1<n<N.

[0116] In an optional embodiment of the present invention, the operator 113 is further configured to perform a maximum pooling operation on the point data in the memory 111, and is specifically configured as follows: receiving the first point data and storing it in the first memory as data A1; initializing the data B0 in the second memory to negative infinity, and storing the maximum value in the second memory, B1=Max(A1,B0); receiving the nth point data and storing it in the first memory as data A n ; Store the maximum value in the second memory, B n =Max(A n ,B n-1 ) ; Receive the Nth point data and store it in the first memory as data A N ; Store the maximum value in the second memory, B N =Max(A N ,B N-1 ). Where N represents the number of points of data to be processed, 1<n<N.

[0117] Based on the same inventive concept, an embodiment of the present disclosure further provides a computing device, including a multi-core processor, for running a computer program, wherein:

[0118] When performing data processing, the many-core processor adopts the global pooling method of the neural network described in any of the above embodiments.

[0119] In an optional embodiment of the present disclosure, the computing device further includes:

[0120] The storage device is used to store a computer program, and the computer program is loaded and executed by a processor when running in the computing device.

[0121] The disclosed embodiments provide a more efficient global pooling method and multi-core system for a neural network, which obtains the final pooling result of the final data to be processed by performing a pooling operation on each data point inputted by the front layer. Based on the solution provided by the disclosed embodiments, point operations can be used instead of graph operations in the multi-core system to reduce storage and computing delays.

[0122] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present disclosure can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0123] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of the exemplary embodiments of the present disclosure, the various features of the present disclosure are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the following intention: the claimed disclosure requires more features than the features explicitly recited in each claim. More specifically, as reflected in the claims below, the inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present disclosure.

[0124] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

[0125] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present disclosure and form different embodiments. For example, in the claims, any one of the claimed embodiments can be used in any combination.

[0126] It should be noted that the above embodiments illustrate the present disclosure rather than limit the present disclosure, and that those skilled in the art may design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets should not be constructed as a limitation to the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of multiple such elements. The present disclosure may be implemented by means of hardware including several different elements and by means of appropriately programmed computers. In a unit claim that lists several devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names.

[0127] At this point, those skilled in the art should recognize that, although multiple exemplary embodiments of the present disclosure have been shown and described in detail herein, many other variations or modifications that conform to the principles of the present disclosure can still be directly determined or derived from the contents disclosed in the present disclosure without departing from the spirit and scope of the present disclosure. Therefore, the scope of the present disclosure should be understood and recognized as covering all such other variations or modifications.

Claims

1. A global pooling method for a neural network, applied to a many-core system, the method comprising: Receiving point data of data to be processed inputted sequentially by a previous network layer, wherein the data to be processed includes image data or video data; After each point data is received, a preset pooling operation is performed based on the currently received point data until all point data of the data to be processed are pooled; The storage space of the many-core system includes a first storage space and a second storage space. After each point data is received, a preset pooling operation is performed based on the currently received point data until all point data of the to-be-processed data are pooled, including: receiving the nth point data of the data to be processed and storing it in the first storage space, Storing the result of performing a preset pooling operation based on the nth point data into the second storage space; Wherein, 1<n<N, and N represents the number of points of the data to be processed.

2. The method according to claim 1, characterized in that: After each point data is received, a preset pooling operation is performed based on the currently received point data until all point data of the to-be-processed data are pooled, including: Receiving first point data input by the previous network layer, and performing a preset pooling operation based on the first point data to obtain a first pooling result; Continue to receive the point data of the data to be processed, and perform the preset pooling operation after each point data is received until all the point data of the data to be processed are pooled, and a final pooling result is obtained.

3. The method according to claim 2, characterized in that The step of continuing to receive the point data of the data to be processed and performing the preset pooling operation after each point data is received until all the point data of the data to be processed are pooled to obtain a final pooling result includes: Receiving the nth point data of the data to be processed, and performing a preset pooling operation on the nth point data based on the pooling result of the n-1th point data to obtain an nth pooling result; Receive the Nth point data of the data to be processed, and perform a preset pooling operation on the Nth point data based on the pooling result of the N-1th point data to obtain an Nth pooling result; Wherein, the Nth pooling result is the final pooling result of the data to be processed; The N represents the number of points of the data to be processed, 1<n<N.

4. The method according to any one of claims 1 to 3, characterized in that: The preset pooling operation includes: average pooling or maximum pooling.

5. The method according to claim 4, characterized in that The storage space of the many-core system includes a first storage space and a second storage space. When the preset pooling operation is an average pooling operation, after each point data is received, the preset pooling operation is performed based on the currently received point data until all point data of the data to be processed are pooled, including: Receive the first point data and store it in the first storage space as data A1; initialize the data in the second storage space to 0, and store data B1=A1*(1 / N) in the second storage space; Receive the nth point data and store it in the first storage space as data A n ; A n Output to the second storage space through the multiplier-adder to obtain B n =B n-1 +A n *(1 / N); Receive the Nth point data and store it in the first storage space as data A N ; A N Output to the second storage space through the multiplier-adder to obtain B N =B N-1 +A N *(1 / N); Wherein, N represents the number of points of the data to be processed, 1<n<N.

6. The method according to claim 4, characterized in that The storage space of the many-core system includes a first storage space and a second storage space. When the preset pooling operation is maximum pooling, after each point data is received, the preset pooling operation is performed based on the currently received point data until all point data of the data to be processed are pooled, including: Receive the first point data and store it in the first storage space as data A1; initialize the data B0 in the second storage space to negative infinity, and store the maximum value in the second storage space, B1=Max(A1, B0); Receive the nth point data and store it in the first storage space as data A n ; Store the maximum value in the second storage space, B n =Max(A n , B n-1 ); Receive the Nth point data and store it in the first storage space as data A N ; Store the maximum value in the second storage space, B N =Max(A N , B N-1 ); Wherein, N represents the number of points of the data to be processed, 1<n<N.

7. A many-core system, characterized in that: The many-core system comprises: A plurality of processing cores, at least one of the plurality of processing cores performing the following operations: Receiving point data of data to be processed inputted sequentially by a previous network layer, wherein the data to be processed includes image data or video data; After each point data is received, a preset pooling operation is performed based on the currently received point data until all point data of the data to be processed are pooled; The storage space of the many-core system includes a first storage space and a second storage space. After each point data is received, a preset pooling operation is performed based on the currently received point data until all point data of the to-be-processed data are pooled, including: receiving the nth point data of the data to be processed and storing it in the first storage space, Storing the result of performing a preset pooling operation based on the nth point data into the second storage space; Wherein, 1<n<N, and N represents the number of points of the data to be processed.

8. The many-core system according to claim 7, characterized in that: The processing core comprises: A controller, configured to control receiving and storing point data input from a previous network layer; a memory configured to store the point data; An operator is configured to perform a preset pooling operation based on the point data under the control of the controller.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the global pooling method of the neural network according to any one of claims 1 to 6.

10. A computer program product, characterized in that When the computer program product is run on a computer, the computer is enabled to perform the global pooling method of a neural network according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Pooling unit design method of convolutional neural network

    CN108805285A