Disclosure of Invention
The invention aims to provide a maximum pooling method, a chip and an electronic product for a system based on event driving for the first time, and certain embodiments have the technical effects of high efficiency, flexible and adjustable precision, overflow prevention, convenience in resetting and the like, and are realized by the following scheme:
a method for event-based max pooling, the method comprising the steps of:
determining a pooling objective based on the input events, the pooling objective being a set of events;
loading a plurality of count values corresponding to the pooled target;
performing one-time accumulation counting on the counting value corresponding to the input event to obtain an updated counting value corresponding to the input event;
and judging whether the count value corresponding to the updated input event is the maximum value in the plurality of count values corresponding to the pooling target, if so, sending the input event, and otherwise, discarding the input event.
In a certain embodiment, before performing the one-time accumulation counting on the count value corresponding to the input event, it is determined whether the count value corresponding to the input event reaches a threshold, and if the count value corresponding to the input event does not reach the threshold, the one-time accumulation counting on the count value corresponding to the input event is performed.
In some kind of embodiments, if the count value corresponding to the input event has reached the threshold, performing: setting all other count values in the plurality of count values corresponding to the pooling target to zero except the count value corresponding to the input event.
In a certain type of embodiment, it is determined whether the count value corresponding to the input event is the maximum value among the plurality of count values corresponding to the pooling target, if so, the input event is sent, otherwise, the input event is discarded; or the like, or, alternatively,
the input event is sent directly.
In some kind of embodiments, a count value corresponding to the input event is set to zero; or the like, or, alternatively,
and sending a new input event with the same event coordinate as the input event, wherein the input event is a bias event, and the bias event sets the count value corresponding to the input event to be zero.
In some kind of embodiments, if the count value corresponding to the input event has reached the threshold, performing: setting all count values in a plurality of count values corresponding to the pooled target to zero.
In some embodiment, sending the input event is performed after all of the plurality of count values corresponding to the pooling target are set to zero.
In a certain embodiment, before determining whether the count value corresponding to the input event reaches the threshold, it is determined whether the event type of the input event is a bias event, and if not, the determination is performed to determine whether the count value corresponding to the input event reaches the threshold.
In some embodiments, the type of the input event is determined according to the bias label of the input event.
In a certain class of embodiments, if the event type of the input event is a bias event, performing: and setting a plurality of counting values corresponding to the pooling target to be zero.
In a certain embodiment, the operation of setting to zero and the count value corresponding to the input event are counted in an accumulation manner, and the updated count value is stored in a memory.
In certain embodiments, the input event includes an event coordinate and a bias flag.
In some class of embodiments, the bias flag for the input event is true when one of the following occurs:
when a counter reaches a predetermined value, the counter is configured to count pulses input to a pooled kernel field or a convolved kernel field in which the input event is located;
when the counter reaches a predetermined value, the counter is configured to count pulses input to the spiking neural network;
when the time reference is reached.
In some embodiments, a multiplier is provided from which the bias event may be subtracted by a fixed value multiple times.
A chip, the chip being an event-driven type chip, characterized in that: the chip uses any of the event-based max pooling methods described above.
An electronic product, characterized in that: the electronic product uses the chip to process signals.
The beneficial technical effects are as follows:
the invention provides a maximum pooling scheme for an event-driven system for the first time, and has the technical effects of high efficiency, flexible and adjustable precision, overflow prevention, convenience in resetting and the like.
The technical solutions, technical features, and technical means disclosed above may not be completely the same as, identical to, or detailed in the following detailed description. The technical features and technical measures disclosed in the section and the technical measures disclosed in the subsequent detailed description are combined reasonably, so that more technical measures are disclosed, and the technical measures are beneficial to supplement of the detailed description. As such, some details in the drawings may not be explicitly described in the specification, but if a person skilled in the art can deduce the technical meaning of the details based on the description of other related words or drawings, the common technical knowledge in the art, and other prior arts (such as conference, journal articles, etc.), the technical solutions, technical features, and technical means not explicitly described in this section also belong to the technical contents disclosed in the present invention, and the same as the above descriptions can be used in combination to obtain corresponding new technical solutions. The technical scheme combined by all technical features disclosed by any position of the invention is used for supporting the generalization of the technical scheme, the modification of a patent document and the disclosure of the technical scheme.
Detailed Description
Although the embodiments show some step numbers, and the numbers have numerical magnitude order, this does not necessarily mean the absolute order of execution of the steps. The above numbering of the present invention does not imply an order of execution. Based on the present inventive concept, the present inventive concept will hereinafter be described in detail with respect to certain specific embodiments, which are merely part of the detailed description of the inventive concept, and the claims will be intended to summarize the inventive concept based on these specific embodiments.
Referring to FIG. 2, a mapping of events to counts is shown. In an event driven system, events are generated according to changes in an event signal sensed by a Sensor, such as a common event camera — Dynamic Vision Sensor (DVS). If the signal received by the sensor is not changed, no event is generated, and therefore no event is transmitted to the subsequent stage. A common event transmission protocol is the address-event presentation (AER) protocol. A pixel of the DVS sensor may pass an event to a subsequent stage if it senses a signal change, such as a dimming of light.
These events are processed through various processes such as convolution, pooling, convolution, pooling … …, and each operation results in a feature map or feature map matrix, also referred to as the event matrix 20. Each element in the event matrix 20 represents an event, the event matrix 20 may be a matrix to be pooled for the first time, or an event matrix after being subjected to multiple convolution and pooling, and the pooling method of the present invention is not limited to the event matrix obtained by performing the first convolution on the sensor raw acquisition. For example, the event matrix 20 includes an event 22, which may also be referred to as a pixel in the DVS art. For example, if the pool kernel is 2 × 2 in size, as shown, the event 22 is shown to be located within the first receptive field (dashed portion of the figure) of the pool kernel. Although the receptive field in the figure is a continuous region, there may be gaps between events to form cavities, which are determined by the pooling nucleus, and the present invention does not limit the configuration of the pooling nucleus.
Each event in the event matrix 20 is associated with a corresponding memory location (such as SRAM memory) as its counter. As shown, the memory 21 includes a number of memory cells, and each event in the event matrix has a memory cell as its counter. The event's corresponding count store may be uniquely determined based on attributes of the event, such as coordinates. The value recorded by the storage unit is called a count number or count, count value.
Referring to fig. 3, an event-based max pooling method is illustrated. For an event output by a sensor, for example, the format is as follows { event coordinates }. Alternatively, the event coordinates may include two values x and y. Preferably, the event also includes a bias flag is _ bias, which is used for the reset operation, i.e. in some kind of embodiment the format of the event is as follows: { event coordinates, bias flag }. For a two-dimensional signal, the format of the event may be specified as { x, y, is _ bias }, where x, y represent the position coordinates of the event, is _ bias is a bias flag, for example, 1 indicates that the event is a bias event, and 0 indicates that the event is not a bias event and is a normal event. The coordinates have only two bits representing that the sensor is a two-dimensional sensor, e.g. the visual signal is often represented by a two-dimensional signal. Of course, the present invention may also be not limited to two-dimensional sensor signals, and may be one-dimensional, three-dimensional or even more, and the two-dimensional signals are only used as examples.
Step 31: based on the input events { x, y, is _ bias }, the pooling goal is determined.
Since the event includes event coordinates, based on the construction of the pooling core and the coordinates of the event, a pooling target of the event with other surrounding event sets may be determined. In some embodiments, the event count index count may be determined by determining a set that includes all event count indices corresponding to the determined pooled targets id Or coordinates of all events, e.g. { x } p ,y p Or a combination of the two. For example, the event count index count id Is an index of the location of the event in memory 21. All things corresponding to the pooling target can be uniquely determined at willThe manner of the members is feasible and the invention is not limited thereto. For the current input event, the determined set of coordinates for the pooled target event set is denoted as { x } p ,y p The index of the storage location in the memory 21 is denoted as count id . The information that can be determined at this time includes: set of coordinates for pooled target event set { x p ,y p And event count indexes (collectively referred to as count) corresponding to the coordinates id ) And an offset flag is _ bias of the input event.
Referring to event 22 in fig. 2, for a 2 × 2 pooling kernel, this event 22 together with its surrounding 3 pixels (within the dashed box in the figure) constitutes the pooling target. For example, the pooled target event count index is {1, 2, 5, 6 }.
Step 32: and loading count words for the pooled target event set from the corresponding storage unit.
Since the pooled target event set and its event count index count are already or can be obtained id This step may therefore read from the memory 21 the set of memory locations corresponding to the pooled target event set and its corresponding set of stored count words. The count values (or counts, count words) stored therein are read, such as by the aforementioned count index {1, 2, 5, 6}, and are collectively denoted as count.
Step 33: and judging the event type according to the bias mark of the input event.
If the bias flag for the input event { x, y, is _ bias } is true, then the input event is a bias event, which will trigger the count value zeroing operation described subsequently. If the bias flag is false, then the input event is a normal event.
Alternatively, the bias event may be triggered to be generated as follows:
(1) when the counter reaches a predetermined value, the counter is configured to count pulses input to a pooled nuclear receptive field or a convolved nuclear receptive field in which the input event is located;
(2) when the counter reaches a predetermined value, the counter is configured to count pulses input to the spiking neural network;
(3) when the time reference is reached.
Alternatively, the order of step 33 and step 32 may be replaced, that is, the event type is determined and then step 32 is performed.
Step 34: if the bias flag for the input event is false, then: and judging whether the count value of the current input event reaches a threshold value.
Although the description here is made as to whether the count value is greater than or equal to a certain threshold value, it is substantially equivalent to determining whether the count value is greater than the threshold value minus 1.
The scheme of setting the threshold value belongs to the preferred embodiment, and the advantages thereof comprise: the accuracy can be set when needed in the future by configuring the threshold. On the other hand, this also effectively prevents spillage.
Step 35: if the threshold is not reached, the count value corresponding to the input event is counted up once, and step 37 is performed.
The specific cumulative increment is generally 1. Of course, other values, such as 2, are also possible, and the present invention is not limited to the specific value of the accumulated increment.
Refer to fig. 4 for a diagram illustrating the updating of the maximum pooling count value in the first case. If the event count index count corresponding to the event 22 in FIG. 2 corresponds to id If it is 6, the memory location with index 6 in the memory 21 is counted up once, for example, if the value 9 is stored before, then the value is updated to 10 after the accumulation.
Step 36: if the threshold is reached, the count values corresponding to the other events in the pooled target event set are all zeroed (i.e., zeroed), and step 37 is performed.
Performing this step means that the current input event directly triggers the threshold, which can be directly output as a pooling result. And (4) enabling all the count values corresponding to other events in the pooling target event set to be zero, and completing a pooling process of the receptive field.
Referring to fig. 5, it is a diagram of the update of the count value in the maximum pooling process in the second case, which shows that in the case that the threshold is 9, the event 22 directly triggers the threshold, and the event 22 can be output as the pooling result of the pooling step. Therefore, the count values stored in the storage units with indexes 1, 2 and 5 are all reset to zero except the storage unit with index 6.
Since the other counts are all zero, the input event must have the largest count after step 36 goes to step 37, and thus the input event must be pooled in this case. In order to prevent the maximum count value corresponding to the input event and the input event corresponding to the coordinate of the event from being used as the pooling result, after the determination of step 37 is completed and the event is sent, the count value corresponding to the input event needs to be also set to zero. The zeroing mode may include: directly writing 0 into the corresponding memory cell; or inputting an event { x, y, is _ bias ═ true }, wherein the event is a bias event and has the same event coordinate { x, y }, and the count values corresponding to all events in the direct trigger pooling target event set are returned to zero. The zeroing scheme of the present invention is not limited herein.
An alternative to this step 36 is: step 36': and if the threshold value is reached, resetting the count values corresponding to all the events in the pooling target event set to zero (namely, setting the count values to zero), sending the input event as a pooling result, and ending the current pooling step.
Alternatively, by providing a multiplier according to which the bias event can be subtracted by a fixed value a plurality of times. Optionally, a zeroing operation is implemented in this way.
Step 37: and judging whether the count value corresponding to the current input event is the maximum in the count value corresponding to the event in the pooling target event set.
If the counting value corresponding to the current input event is the maximum, the event is output as the result of the pooling, and the event is sent. If the count value corresponding to the current input event is not the maximum, then the input event will not be discarded as a pooled result.
For example, in the example shown in fig. 4, the count value 10 corresponding to the event 22 already belongs to the maximum count value corresponding to the event in the target event set, and thus it can be output as the pooling result.
Step 38: in step 33, if the input event is determined to be a bias event, that is, if the bias flag of the input event is true, the count values corresponding to all events in the pooled target event set are reset to zero.
This step allows the total count values corresponding in the memory 21 to be zeroed out within the receptive field in which the event is located.
Step 39: and writing the count value corresponding to the event into a storage unit of the memory.
After step 35, step 36 (and step 36') and step 38, the updated count value corresponding to the event needs to be saved. For example, the process can be implemented by writing to SRAM, although the type of memory is not limited herein.
Referring to fig. 6, there is shown a block diagram of a max pooling system in an event driven system, the system being configured to implement the max pooling method described above. The event coming from the upper level in the system is sent to the first buffer module, and then the pooling target is decided in the target decision module according to the event 40{ x, y, is _ bias } output in the first buffer module, namely the coordinate set { x of the pooling target event is determined p ,y p And the corresponding event count index count id Where x, y are the coordinates of the event 40 and is _ bias is the bias flag. In addition, the first data stream 41 outputted by the target determination module further includes a read command and an offset flag is _ bias, where the read command controls reading the event count index count id The corresponding count value.
In the merged stream arbitration (merge stream arbitration) module, its input data streams, such as the input first data stream 41, and other data streams (the first-type third data stream 43 described later) are merged. The data is then read or written in a memory, such as an SRAM. For example, the event count index count is read as described above id The corresponding count value. The data included in the second data stream 42 has x p ,y p ,count id Is _ bias, count _ words }, where count _ words is a count value (or count word). Data such as read count value is sent to return to zero andin the accumulation module, the data is zeroed or accumulated according to the maximum pooling method, and a third data stream 43 is output. The third data stream 43 comprises two types: type one, { x p ,y p ,count id ,write,count_words * Writing an instruction to the SRAM, wherein the type of data stream is shunted to the second cache module by the splitting module; and type two, { x p ,y p ,count id ,count_words * The data stream of the type is sent to a searching maximum module; wherein the count _ words * Is the count _ words updated by the zeroing and accumulating module. In the find max module, it is determined whether the input event 40 is the final pooled result, whose output fourth data stream 44 includes { x } p ,y p Is _ max, where is _ max is the result of the determination. Based on this final determination, it is determined at the conditional discard module whether to send the event 40 (corresponding to is _ max being true, obtaining the pooled result 45) or to discard the event 40 (corresponding to is _ max being false).
In the output result of the splitting module, the third data stream 43 of the first type containing the write command is sent to the second buffer module, and the data in the second buffer module is sent to the merged stream arbitration module as another input of the merged stream arbitration module, and is used to write data to the SRAM read/write module, such as performing the aforementioned step 39.
In addition, the data in the target decision module and the second cache module can also be used for controlling the event flow control module so as to control the data flow of the first cache module. Such control would be very beneficial to the smooth operation of the system, such as when there are too many events entered into the system.
In addition, the invention also discloses a chip which is an event-driven chip and uses any one of the event-based maximum pooling methods.
In addition, the invention also discloses an electronic product which uses the chip to process the environment signal.
While the invention has been described with reference to specific features and embodiments thereof, various modifications and combinations may be made without departing from the invention. Accordingly, the specification and figures are to be regarded in a simplified manner as being illustrative of some embodiments of the invention defined by the appended claims and are intended to cover any and all modifications, variations, combinations, or equivalents that fall within the scope of the invention. Thus, although the present invention and its advantages have been described in detail, various changes, substitutions and alterations can be made herein without departing from the invention as defined by the appended claims. Moreover, the scope of the present application is not intended to be limited to the particular embodiments of the process, machine, manufacture, composition of matter, means, methods and steps described in the specification.
As one of ordinary skill in the art will readily appreciate from the disclosure of the present invention, processes, machines, manufacture, compositions of matter, means, methods, or steps, presently existing or later to be developed that perform substantially the same function or achieve substantially the same result as the corresponding embodiments described herein may be utilized according to the present invention. Accordingly, the appended claims are intended to include within their scope such processes, machines, manufacture, compositions of matter, means, methods, or steps.
To achieve better technical results or for certain applications, a person skilled in the art may make further improvements on the technical solution based on the present invention. However, even if the partial modification/design is inventive or/and advanced, the technical solution should also fall within the protection scope of the present invention according to the "overall coverage principle" as long as the technical features covered by the claims of the present invention are utilized.
Several technical features mentioned in the attached claims may be replaced by alternative technical features or the order of some technical processes, the order of materials organization may be recombined. Those skilled in the art can easily understand the alternative means, or change the sequence of the technical process and the material organization sequence, and then adopt substantially the same means to solve substantially the same technical problems and achieve substantially the same technical effects, therefore, even if the means or/and the sequence are explicitly defined in the claims, the modifications, changes and substitutions shall fall into the protection scope of the claims according to the "equivalent principle".
Where a claim recites an explicit numerical limitation, one skilled in the art would understand that other reasonable numerical values around the stated numerical value would also apply to a particular embodiment. Such design solutions, which do not depart from the inventive concept by a departure from the details, also fall within the scope of protection of the claims.
The method steps and elements described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and the steps and elements of the embodiments have been described in functional generality in the foregoing description, for the purpose of clearly illustrating the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention as claimed.
Further, any module, component, or device executing instructions exemplified herein may include or otherwise have access to a non-transitory computer/processor readable storage medium or media for storing information, such as computer/processor readable instructions, data structures, program modules, and/or other data. Any such non-transitory computer/processor storage media may be part of or accessible or connectable to a device. Any application or module described herein may be implemented using computer/processor readable/executable instructions that may be stored or otherwise maintained by such non-transitory computer/processor readable storage media.