WO2023085535A1 - 1차원 어레이 풀링 방법 및 이를 위한 장치 - Google Patents

1차원 어레이 풀링 방법 및 이를 위한 장치 Download PDF

Info

Publication number
WO2023085535A1
WO2023085535A1 PCT/KR2022/006215 KR2022006215W WO2023085535A1 WO 2023085535 A1 WO2023085535 A1 WO 2023085535A1 KR 2022006215 W KR2022006215 W KR 2022006215W WO 2023085535 A1 WO2023085535 A1 WO 2023085535A1
Authority
WO
WIPO (PCT)
Prior art keywords
pooling
target array
value
values
target
Prior art date
Application number
PCT/KR2022/006215
Other languages
English (en)
French (fr)
Inventor
전지현
최정환
Original Assignee
오픈엣지테크놀로지 주식회사
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 오픈엣지테크놀로지 주식회사 filed Critical 오픈엣지테크놀로지 주식회사
Publication of WO2023085535A1 publication Critical patent/WO2023085535A1/ko

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/06Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons
    • G06N3/063Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons using electronic means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • the present invention relates to a method for performing pooling in a computing device and a hardware accelerator to which the method is applied.
  • a CNN performs a plurality of operation steps including a pooling operation.
  • US registered patent US10713816 proposes an object detection method using a deep CNN pooling layer as a feature.
  • FIG. 1 illustrates a computational structure of a CNN according to an embodiment. It will be described with reference to FIG. 1 below.
  • convolution layers 52 may be generated by performing a convolution operation using a plurality of kernels on the input image data 51 stored in the internal memory. Generating the convolution layers 52 may include performing a nonlinear operation (eg, ReLU, Sigmoid, or tanH) on a plurality of feature maps obtained as a result of performing the convolution operation.
  • a nonlinear operation eg, ReLU, Sigmoid, or tanH
  • pooling of the convolutional layers 52 may be performed to generate pooling layers 53 .
  • Each convolutional layer 52 may include data that can be expressed in the form of an M*N matrix.
  • a pooling window which is a window having a smaller dimension than the convolution layer 52, may be defined to perform pooling.
  • the pooling window may have sizes of Mp and Np in the row and column directions, respectively.
  • the pooling is an operation of generating a smaller number of data, for example, one data, from Mp*Np data selected by overlapping the pooling window on the convolution layer.
  • MAX pooling is an operation of selecting and outputting one of the largest values among the Mp*Np pieces of data.
  • average pooling is an operation of outputting an average value of the Mp*Np pieces of data.
  • Other pooling rules may be defined. The number of cases in which the pooling window may overlap the convolutional layer varies. According to embodiments, rules for moving the pooling window on the convolution layer may be restricted.
  • the row direction stride of the pooling operation is referred to as SM
  • the pooling window is set in the column direction of the convolution layer
  • the stride in the column direction of the pooling operation may be referred to as SN (SM and SN are natural numbers).
  • SN the stride in the column direction of the pooling operation
  • the size of the pooling layer output as a result of the pooling operation may decrease.
  • the specific concept of the pooling operation is well presented in the prior art describing CNNs.
  • an array to be input to the neural network 54 may be generated by performing flattening on the pooling layers 53 .
  • the array can then be input to the neural network 54 to generate an output from the neural network 54 .
  • FIG. 1 shows one embodiment of a CNN
  • various other examples of implementing CNNs exist.
  • the pooling operation is used for the implementation of CNN in FIG. 1, the pooling operation may be used in other computing technology fields other than CNN.
  • the amount of computation of the pooling operation tends to increase as the size of the pooling window increases, and tends to increase as the size of the stride decreases. Also, the smaller the size of the stride, the higher the tendency for the same operation to be repeated during the pooling operation.
  • An object of the present invention is to provide a pooling method that reduces the amount of computation for pooling a one-dimensional array.
  • a method of pooling an input array according to a predetermined pooling rule may be provided.
  • the method may include a first step of selecting a first target array 110 as a target to be pooled from among the input arrays 100; a second step of calculating a plurality of sub values by pooling the plurality of parts 111 to 113 of the first target array 110 using the sub window 210 according to the pooling rule; and a pooling value calculating step of calculating a pooling value of the first target array by pooling the plurality of subvalues according to the pooling rule.
  • the first value obtained by pooling the plurality of subvalues according to the pooling rule and the remaining values of the first target array, which are values not pooled by the subwindow, are pooled according to the pooling rule.
  • a final pooling step of calculating a pooling value of the first target array may be included.
  • the step of calculating the pooling value may further include, before the step of final pooling, storing the first value in a first buffer.
  • the method may include selecting a second target array 120 as a target to be pooled from among the input arrays 100; and calculating a pooling value of the second target array by pooling values not pooled by the subwindow and the first value among the second target array 120 according to the pooling rule. .
  • the size of the second target array is equal to the size of the first target array, and the data size of a set of values having consecutive indices among values not pooled by the subwindow is smaller than the size of the subwindow.
  • a third step of storing the plurality of sub values in a plurality of buffers 31 to 33 may be further included between the second step and the pooling value calculation step.
  • the method may include selecting a third target array 130 as a target to be pooled from among the input arrays 100; determining an invalid buffer among the plurality of buffers, which is a buffer storing a value obtained by pulling data that does not exist in the third target array 130; checking the remaining portion 114 of the third target array 130 not pooled by the sub-window in the second step; calculating a second sub value by pooling the remaining portion 114 according to the pooling rule using the sub window; storing the second sub value in the invalid buffer; And values that were not considered in the process of determining the values stored in the plurality of buffers 31 to 33 and the values of the plurality of buffers of the third target array, that is, values that were not used, according to the pooling rule.
  • a fifth step of pooling and calculating a pooling value of the third target array may be further included.
  • the size of the third target array is the same as the size of the first target array, and indices of elements constituting the remaining part may be continuous.
  • the fifth step may include: storing a second value obtained by pooling the values stored in the plurality of buffers 31 to 33 according to the pooling rule in a second buffer; and pooling values of the third target array among the second value and the third target array by pooling values not considered in the process of determining the values of the plurality of buffers in the third target array according to the pooling rule, Calculating; may include.
  • the second buffer and the first buffer may be identical to each other.
  • the method may include selecting a third target array 130 as a target to be pooled from among the input arrays 100; determining an update target buffer, which is a buffer having a first updated value among the plurality of buffers; checking the remaining portion 114 of the third target array 130 not pooled by the sub-window in the second step; calculating a second sub value by pooling the remaining portion 114 according to the pooling rule using the sub window; storing the second sub value in the update target buffer; and pooling values stored in the plurality of buffers 31 to 33 and values not considered in the process of determining the values of the plurality of buffers among the third target array according to the pooling rule, A fifth step of calculating a pooling value of the target array may be further included.
  • the pooling value of the first target array is calculated by pooling remaining values not pooled by the subwindow among the plurality of subvalues and the first target array according to the pooling rule.
  • the size of the sub-window is smaller than the size of the first target array, each of the plurality of parts does not overlap with each other, and the size of each of the plurality of parts is the same as the size of the sub-window, , And the indices of the components constituting each part may be continuous.
  • the size of the subwindow may be 2, and the number of data having an odd-numbered index in the first target array may be N.
  • N pieces of data having an odd-numbered index of the first target array are stored in a recycling buffer having a size N, and the pooling After the value calculation step, selecting a new target array to be pooled among the input arrays 100; and updating a portion having the remaining values of the recycling buffer with data of one of the new target arrays.
  • Data of one of the new target arrays may not be included in data having odd indexes among the first target arrays among data having odd indexes among the new target arrays.
  • FIG. 1 illustrates a computational structure of a CNN according to an embodiment. It will be described with reference to FIG. 1 below.
  • FIG. 2 is a conceptual diagram illustrating a pooling method provided according to an embodiment of the present invention.
  • FIG. 3 is a flowchart illustrating a pooling method provided according to an embodiment of the present invention described in FIG. 2 .
  • FIG. 4 shows a specific method of executing part P28 shown in FIG. 2 according to an embodiment of the present invention.
  • FIG. 5 is a flowchart illustrating a specific method of executing step S140 shown in FIG. 3 according to an embodiment of the present invention.
  • FIG. 6 is a conceptual diagram illustrating a pooling method provided according to another embodiment of the present invention.
  • FIG. 7 is a flowchart illustrating a pooling method further developed from the pooling methods presented in FIGS. 3 and 5 using the method presented in FIG. 6 .
  • FIG. 8 is a conceptual diagram illustrating a pooling method provided according to another embodiment of the present invention.
  • FIG. 9 is a flowchart illustrating a pooling method in which the pooling method presented in FIG. 3 is further developed using the method presented in FIG. 8 .
  • FIG. 10 is a flowchart illustrating a pooling method provided according to an embodiment of the present invention.
  • FIG. 11 illustrates a specific method of executing part P85 shown in FIG. 8 according to an embodiment of the present invention.
  • 12a, 12b, 12c, and 12d illustrate a method of using a buffer provided according to an embodiment of the present invention.
  • FIG. 2 is a conceptual diagram illustrating a pooling method provided according to an embodiment of the present invention.
  • Part P21 of FIG. 2 shows an example of the input array 100 to be pooled.
  • Reference number 50 is a number representing the index of each element of the input array 100. For convenience, only indexes from 1 to 9 are displayed.
  • the input array 100 may be a one-dimensional array.
  • Numbers written in squares representing each element of the input array 100 indicate examples of data values of each element.
  • Part P22 of FIG. 2 shows the pooling window 200 .
  • the size of the pooling window 200 is '7'.
  • Parts P23 and P24 of FIG. 2 show the first target array 110 selected as a pooling target among the input arrays 100 .
  • the first target array 110 has the same size as the pulling window 200 .
  • the first target array 110 corresponds to indices 1 to 7 of the input array 100 .
  • Part P25 of FIG. 2 shows a sub window 210 provided according to an embodiment of the present invention.
  • the sub-window 210 may also be referred to as a sub-pooling window.
  • the size of the sub window 210 is '2'.
  • the size of the sub window 210 may be smaller than that of the first target array 110 .
  • the size of the sub window 210 may be smaller than 1/2 of the size of the first target array 110 . That is, the size of the sub window 210 may be smaller than the size of the pooling window 200 .
  • the size of the sub window 210 may be smaller than 1/2 of the size of the pooling window 200 .
  • Part P26 of FIG. 2 pools the plurality of parts 111 to 113 of the first target array 110 according to a predetermined pooling rule using the sub window 210 to obtain a plurality of sub values. It shows the process of generating them. 2 shows the case where the predetermined pooling rule is MAX pooling.
  • Sub values calculated by pooling the first portion 111, the second portion 112, and the third portion 113 using the sub window 210 are '7', '8', and It is '4'.
  • Part P27 of FIG. 2 shows a process of storing the plurality of sub values '7', '8', and '4' in the plurality of buffers 31 to 33, respectively.
  • the plurality of buffers 31 to 33 may be included in an internal memory provided to a hardware accelerator, a cache register included in a CPU, or included in a DRAM provided in a computing device.
  • Part P28 of FIG. 2 includes the plurality of subvalues '7', '8', and '4' and the remaining values of the first target array 110, which are values not pooled by the subwindow 210. It shows a process of calculating the final pooling value of the first target array 110 by pooling according to the pooling rule.
  • the remaining value which is a value not pooled by the subwindow 210, is a value '6' having an index of 1, as shown in part P26. Therefore, in part P28, '6', '7', '8', and '4' may be pooled according to the predetermined pooling rule to calculate a final pooling value.
  • the predetermined pooling rule is MAX pooling
  • the final pooling value is '8'.
  • the subwindow may not have values not pooled from the first target array 110 .
  • the size of the pooling window 200 is '6' and the size of the sub-window 210 is '2', there will be no value that is not pooled in the first target array 110 by the sub-window. may be This case may also be included in an embodiment of the present invention.
  • FIG. 3 is a flowchart illustrating a pooling method provided according to an embodiment of the present invention described in FIG. 2 .
  • the pooling method shown in FIG. 3 is a method of pooling the input array 100 according to a predetermined pooling rule.
  • a first target array 110 to be pooled may be selected from among the input arrays 100.
  • Step S110 may also be referred to as a first step.
  • step S120 a plurality of sub values may be calculated by pooling the plurality of portions 111 to 113 of the first target array 110 using the sub window 210 according to the pooling rule, respectively.
  • Step S120 may also be referred to as a second step.
  • step S130 the plurality of sub values may be stored in a plurality of buffers 31 to 33.
  • Step S130 may also be referred to as a third step.
  • step S140 the remaining values that are not pooled by the subwindow among the plurality of subvalues and the first target array are pooled according to the pooling rule to obtain the final pooled value of the first target array 110. can be calculated.
  • Step S140 may also be referred to as a pooling value calculation step or a fourth step.
  • the step S140 is a value not considered in the process of determining the values stored in the plurality of buffers 31 to 33 and the values of the plurality of buffers of the first target array 110. It may be a step of calculating a final pooling value of the first target array 110 by pooling them according to the pooling rule.
  • the size of the sub window 210 may be smaller than the size of the first target array 110 .
  • the size of the sub window 210 may be equal to or smaller than 1/2 of the size of the first target array 110 .
  • each of the plurality of parts 111 to 113 may not overlap with each other.
  • each of the plurality of parts 111 to 113 may be the same as the size of the sub window 210 .
  • the indices of the components constituting the respective parts 111 to 113 may be consecutive.
  • FIG. 4 shows a specific method of executing part P28 shown in FIG. 2 according to an embodiment of the present invention.
  • the part P28 may be divided into a part P281 and a part P282.
  • the first value '8' obtained by pooling the plurality of sub values '7', '8', and '4' according to the pooling rule may be stored in the first buffer 41. .
  • the remaining values that are not pooled by the subwindow 210 among the first value '8' and the first target array 110 are pooled according to the pooling rule, A final pooling value of the target array 110 may be calculated.
  • the remaining values that are not pooled by the subwindow 210 are '6' having an index of 1, as shown in part P26 of FIG. 2 . Therefore, in the part P282, '6' and '8' may be pooled according to the predetermined pooling rule to calculate a final pooling value.
  • the predetermined pooling rule is MAX pooling
  • the final pooling value is '8'.
  • FIG. 5 is a flowchart illustrating a specific method of executing step S140 shown in FIG. 3 according to an embodiment of the present invention.
  • Step S140 may include steps S141 and S142 below.
  • a first value obtained by pooling the plurality of sub values according to the pooling rule may be stored in a first buffer.
  • the pooling value of the first target array may be calculated by pooling remaining values, which are values not pooled by the subwindow, among the first value and the first target array according to the pooling rule.
  • FIG. 6 is a conceptual diagram illustrating a pooling method provided according to another embodiment of the present invention.
  • the pooling method presented in FIG. 6 applies the plurality of sub values '7', '8', and '4' stored in the plurality of buffers 31 to 33 to the pooling rule. It is assumed that the step of storing the first value '8' obtained by pooling according to the first buffer 41 has been performed.
  • the second target array 120 to be pooled may be selected from among the input arrays 100 .
  • the second target array 120 is different from the first target array 110 .
  • the first target array 110 is a set of indexes 1 to 7 of the input array 100
  • the second target array 120 is a set of indexes 2 to 7 of the input array 100. is a set of 8 That is, the second target array 120 is obtained by moving the pulling window 200 from the first target array 110 by one stride.
  • remaining values of the second target array 120 which are values not pooled by the subwindow 210 , may be checked.
  • indices 2 and 3 of the second target array 120 have already been pooled by the sub window 210 and the result is stored in the buffer 31, and the second target array 120 has been pooled.
  • Indexes 4 and 5 of the array 120 have already been pulled by the sub window 210 and the result is stored in the buffer 32, and indexes 6 and 7 of the second target array 120 have already been pulled by the sub window 210. It was pooled by window 210 and the result was stored in buffer 33.
  • index 8 of the second target array 120 has not yet been pulled by the sub window 210 .
  • the remaining values of the second target array 120 in the part P63 which are values not pooled by the subwindow 210, are '3' of the index 8.
  • the remaining value '3' and the first value '8', which are values not pooled by the subwindow 210, of the second target array 120 are determined by the pooling rule. By pooling according to, a final pooling value of the second target array may be calculated.
  • the final pooling value is '8'.
  • the data size (ex: 1) of a set of values (ex: value '3' of index 8) having a continuous index among values not pooled by the subwindow 210 in the second target array 120 may be smaller than the size of the subwindow (ex: 2).
  • values not pooled by the subwindow 210 among the second target array 120 may be 0 or 1.
  • the values not pooled by the subwindow 210 among the second target array 120 may be 0, 1, ..., K-1. It is understandable that there is
  • FIG. 7 is a flowchart illustrating a pooling method further developed from the pooling methods presented in FIGS. 3 and 5 using the method presented in FIG. 6 .
  • steps S150 and S160 are the same as those shown in FIGS. 3 and 5.
  • step S150 the second target array 120 to be pooled may be selected from among the input arrays 100.
  • step S160 the final pooling value of the second target array is calculated by pooling the first value and the remaining values that are not pooled by the subwindow among the second target array 120 according to the pooling rule. can do.
  • the size of the second target array 120 may be the same as that of the first target array 110 .
  • FIG. 8 is a conceptual diagram illustrating a pooling method provided according to another embodiment of the present invention.
  • the pooling method presented in FIG. 8 performs the step of storing the plurality of sub values '7', '8', and '4' in a plurality of buffers 31 to 33. assuming that one
  • a third target array 130 to be pooled may be selected from among the input arrays 100 .
  • the size of the third target array 130 may be the same as that of the first target array 110 .
  • a second buffer storing a value obtained by pulling data that does not exist in the third target array 130 among the plurality of buffers 31 to 33 may be determined. there is.
  • the value '4' having index 2 in the input array 100 is data that does not exist in the third target array 130 .
  • the buffer 31 stores a value obtained by pulling data that does not exist in the third target array 130 . Accordingly, in FIG. 8 , it can be determined that the second buffer is the buffer 31 .
  • the value stored in the second buffer may be regarded as an invalid value.
  • a new value may be stored in the second buffer.
  • the remaining portion 114 which is a portion that has never been pooled by the subwindow 210 , of the third target array 130 can be checked.
  • the data of indices 3 to 7 of the third target array 130 is already pulled by the subwindow 210 in part P26 of FIG. 2 .
  • only the data of indexes 8 and 9 of the third target array 130 is data that has not yet been pulled by the subwindow 210 . Therefore, the portion indicated by reference number 114 of the third target array 130 is the remaining portion.
  • a second sub value is calculated by pooling the remaining portion 114 according to the pooling rule using the sub window 210, and the second sub value is It can be stored in the second buffer.
  • the second sub value is '3' and the second buffer is the buffer 31 .
  • the indices of the components constituting the remaining part 114 may be continuous.
  • indices of elements constituting the remaining part 114 are consecutive natural numbers, such as 8 and 9, respectively.
  • a final pooling value of the third target array 130 may be calculated by pooling values not considered in the process of determining the values of the plurality of buffers 31 to 33 according to the pooling rule.
  • values not considered in the process of determining the values of the plurality of buffers 31 to 33 among the third target array 130 are '7' of the index 3.
  • the pooling rule is MAX pooling
  • the final pooling value of the third target array 130 is '8'.
  • FIG. 9 is a flowchart illustrating a pooling method in which the pooling method presented in FIG. 3 is further developed using the method presented in FIG. 8 .
  • Steps S110, S120, S130, and S140 in the flowchart shown in FIG. 9 are all the same as those shown in FIG.
  • a third target array 130 to be pooled may be selected from among the input arrays 100.
  • an invalid buffer which is a buffer storing a value obtained by pulling data that does not exist in the third target array 130, among the plurality of buffers 31 to 33 may be determined.
  • the invalid buffer may be the update target buffer. That is, among the plurality of buffers 31 to 33, a buffer storing a value obtained by pulling data that does not exist in the third target array 130 is a value that was recorded the earliest in the buffers 31 to 33. This may be a stored buffer.
  • step S173 the remaining portion 114, which is a portion of the third target array 130 that has not been pulled by the sub window, may be checked.
  • a second sub value may be calculated by pooling the remaining portion 114 according to the pooling rule using the sub window.
  • step S175 the second sub value may be stored in the invalid buffer.
  • step S176 the values stored in the plurality of buffers 31 to 33 and the values not considered in the process of determining the values of the plurality of buffers among the third target array 130 are determined according to the pooling rule. By pooling according to , a final pooling value of the third target array 130 may be calculated.
  • the size of the third target array 130 may be the same as that of the first target array 110 .
  • FIG. 10 is a flowchart illustrating a pooling method provided according to an embodiment of the present invention.
  • FIG. 8 may be described again as follows using the flowchart shown in FIG. 10 .
  • a third target array 130 to be pooled may be selected from among the input arrays 100.
  • an update target buffer which is a buffer having the first updated value among the plurality of buffers 31 to 33, may be determined.
  • the values included in the plurality of buffers 31 to 33 are '7', '8', and '4', respectively, and the first updated value is '7'.
  • the buffer having the first updated value '7' is the buffer 31. Therefore, in this case, the update target buffer is the buffer 31.
  • step S230 the remaining portion 114 of the third target array 130 that has not been pooled by the sub-window in the second step (step S120) may be checked.
  • a second sub value may be calculated by pooling the remaining portion 114 according to the pooling rule using the sub window.
  • step S250 the second sub value may be stored in the buffer 31 as the update target buffer.
  • step S260 values not considered in the process of determining the values stored in the plurality of buffers 31 to 33 and the values of the plurality of buffers among the third target array are determined according to the pooling rule. By pooling, a pooling value of the third target array may be calculated (step 5).
  • the method according to an embodiment of the present invention described with reference to FIGS. 8 to 10 explains the concept of reusing buffers for sub-pooling, which are buffers 31 to 33 for storing sub values obtained by pooling using sub-windows.
  • buffers 31 to 33 for storing sub values obtained by pooling using sub-windows.
  • Var_x 31-->32-->33- ->31-->32-->33-->31.
  • FIG. 11 illustrates a specific method of executing part P85 shown in FIG. 8 according to an embodiment of the present invention.
  • the part P85 may be divided into a part P851 and a part P852.
  • the second value '8' obtained by pooling the plurality of sub values '3', '8', and '4' according to the pooling rule may be stored in the second buffer 42. .
  • the values not considered in the process of determining the values of the plurality of buffers 31 to 33 among the third target array 130 are those shown in part P84 of FIG.
  • '7' and '8' may be pooled according to the predetermined pooling rule to calculate a final pooling value.
  • the predetermined pooling rule is MAX pooling
  • the final pooling value is '8'.
  • the first buffer 41 and the second buffer 42 may be the same.
  • FIGS. 12A, 12B, 12C, and 12D may be collectively referred to as FIG. 12 .
  • FIG. 12 illustrates a method of using a buffer provided according to an embodiment of the present invention.
  • the first target array 110 may be prepared by reading the data of the frontmost part of the input array 100 stored in DRAM or internal memory. At this time, all data of indices 1 to 7 may be read and stored in the data buffer.
  • values having odd indexes among values newly read from the DRAM or internal memory may be stored in the recycling buffers 71 to 74, respectively.
  • the order of storage may be performed in ascending order of index values. That is, the value with index 1 can be stored first, and the value with index 7 can be stored last. Therefore, the value with index 1 is the most recently stored value, and the value with index 7 is the most recently stored value.
  • Values stored in the recycling buffers 71 to 74 may be used for the aforementioned pooling.
  • the above-described plurality of sub values can be stored in the above-described plurality of buffers 31 to 33. there is.
  • sub values for values having a smaller index among the first target array 110 may be first generated and stored in a buffer, and sub values for values with a larger index may be generated later and stored in the buffer.
  • the value stored in the buffer 31 is the most recently stored value
  • the value stored in the buffer 33 is the most recently stored value.
  • data used to generate values of the plurality of buffers 31 to 33 described above may be deleted from the data buffer.
  • the pooling of the first target array 110 is based on the value stored the longest among the values stored in the recycling buffers and the values stored in the plurality of buffers 31 to 33. It is performed on values.
  • the value '6' stored in the recycling buffer 71 is the oldest stored value.
  • the second target array 120 may be determined by moving the pulling window 200 by a stride of 1 .
  • the values of the recycling buffers 71 to 74 are not updated. And, since the newly read value of index 8 is not used to update the value stored in the plurality of buffers 31 to 33, the value of index 8 is not deleted from the data buffer.
  • pooling of the second target array 120 is performed targeting the values stored in the plurality of buffers 31 to 33 and the newly read index 8 value.
  • the third target array 130 may be determined by moving the pulling window 200 by a stride of 1 .
  • the value of the recycling buffer 71 having the oldest stored value among the recycling buffers 71 to 74 is updated to '2' of the newly read index 9. 12D, among the recycle buffers 71 to 74, the recycle buffer 72 has the oldest stored value, and the recycle buffer 71 has the most recently stored value.
  • Values of the plurality of buffers may be updated by generating new sub values for values of indices 8 and 9, which are individually stored in the data buffer, among the third target array 130 .
  • the value of the buffer 31 having the oldest stored value among the plurality of buffers 31 to 33 may be updated with the newly created sub value '3'.
  • the buffer 32 has the oldest stored value, and the buffer 31 has the most recently stored value.
  • the pooling of the third target array 130 is based on the values stored in the oldest among the values stored in the recycling buffers and the values stored in the plurality of buffers 31 to 33. It is performed on values.
  • the value '7' stored in the recycling buffer 72 is the oldest stored value.
  • the pooling window 200 is moved by a stride of 1 to generate a fourth target array and a fifth target array. and the process of pooling them can be repeated.
  • the resources occupied by the data buffer can be minimized by updating the values of the plurality of buffers 31 to 33 and the plurality of recycling buffers 71 to 74 in a cyclic manner.
  • the present invention is a SoC for edge for processing semantic information from acquired images during the civil-military technology development project, a research project supported by the Ministry of Trade, Industry and Energy and the Defense Science Research Institute's Civil-Military Cooperation Promotion Agency, by Open Edge Technology Co., Ltd. (the project performing organization) and It was developed in the process of carrying out the AI accelerator (NPU) development during middleware development (Task number 1415170944, task number 20-CM-BD-02, research period 2020.12.24 ⁇ 2023.12.23).
  • AI accelerator NPU

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Computational Linguistics (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Neurology (AREA)
  • Complex Calculations (AREA)
  • Memory System (AREA)

Abstract

입력 어레이 중 풀링할 제1대상 어레이를 선택하는 제1단계, 상기 제1대상 어레이의 복수 개의 부분들을 서브 윈도우를 이용하여 각각 상기 풀링규칙에 따라 풀링하여 복수 개의 서브값들을 산출하는 제2단계, 상기 복수 개의 서브값들을 복수 개의 버퍼들 내에 저장하는 제3단계, 및 상기 복수 개의 서브값들 및 상기 제1대상 어레이 중 상기 서브윈도우가 풀링하지 않은 값들을 상기 풀링규칙에 따라 풀링하여, 상기 제1대상 어레이의 풀링값을 산출하는 풀링값 산출단계를 포함하며 풀링 방법을 공개한다.

Description

1차원 어레이 풀링 방법 및 이를 위한 장치
본 발명은 컴퓨팅 장치에서 풀링을 수행하는 방법 및 이 방법이 적용된 하드웨어 가속기에 관한 것이다.
CNN은 풀링 연산을 포함하는 복수 개의 연산단계를 수행한다. 미국등록특허 US10713816에는 심층 CNN 풀링 레이어를 특징으로서 이용하는 물체검출 방법이 제시되어 있다.
도 1은 일 실시예에 따른 CNN의 연산구조를 나타낸 것이다. 이하 도 1을 참조하여 설명한다.
우선, 내부메모리에 저장된 입력 이미지 데이터(51)에 복수 개의 커널들을 이용한 콘볼루션 연산을 수행하여 콘볼루션 레이어들(52)을 생성할 수 있다. 콘볼루션 레이어들(52)을 생성하는 단계는 상기 콘볼루션 연산을 수행한 결과 얻은 복수 개의 피쳐 맵들에 대하여 비선형 연산(ex: ReLU, Sigmoid, 또는, tanH)을 수행하는 단계를 포함할 수 있다.
그 다음 콘볼루션 레이어들(52)에 대한 풀링을 수행하여 풀링 레이어들(53)을 생성할 수 있다. 각각의 콘볼루션 레이어(52)는 M*N 행렬 형태로 표현될 수 있는 데이터를 포함할 수 있다. 이때, 풀링을 수행하기 위하여 상기 콘볼루션 레이어(52)보다 작은 디멘젼을 갖는 윈도우인 풀링 윈도우가 정의될 수 있다. 풀링 윈도우는 행 및 열 방향에 대하여 각각 Mp 및 Np의 크기를 가질 수 있다. 풀링 윈도우의 크기는 콘볼루션 레이어의 크기보다 작을 수 있다(M>=Mp 이고 N>Np, 또는 M>Mp 이고 N>=Np). 상기 풀링은 상기 콘볼루션 레이어에 상기 풀링 윈도우를 겹쳐 선택하는 Mp*Np 개의 데이터들로부터 이 보다 더 작은 개수의 데이터, 예컨대 1개의 데이터를 생성하는 연산이다. 예컨대 MAX 풀링은 상기 Mp*Np 개의 데이터들 중에서 가장 큰 값 1개를 선택하여 출력하는 연산이다. 예컨대 average 풀링은 상기 Mp*Np 개의 데이터들의 평균값을 출력하는 연산이다. 그 밖에 다른 규칙을 따르는 풀링이 정의될 수 있다. 상기 콘볼루션 레이어에 상기 풀링 윈도우를 겹칠 수 있는 경우의 수는 다양하다. 실시예에 따라 상기 콘볼루션 레이어 상에서 상기 풀링 윈도우를 이동시키는 규칙을 제한할 수 있다. 예컨대, 상기 풀링 윈도우를 상기 콘볼루션 레이어의 행 방향을 따라 SM 칸 씩 건너뛰어서 이동하도록 제한 경우 상기 풀링 연산의 행 방향 Stride는 SM인 것으로 지칭하고, 상기 풀링 윈도우를 상기 콘볼루션 레이어의 열 방향을 따라 SN 칸 씩 건너뛰어서 이동하도록 제한 경우 상기 풀링 연산의 열 방향 Stride는 SN인 것으로 지칭할 수 있다(SM 및 SN 는 자연수). Stride 의 크기가 커질수록, 풀링 연산의 결과로서 출력되는 풀링 레이어의 크기는 더 작아질 수 있다. 상술한 설명 외에도, 풀링 연산에 대한 구체적인 개념은 CNN을 설명하는 선행기술에 잘 제시되어 있다.
그 다음, 상기 풀링 레이어들(53)에 대한 플래트닝(flattening)을 수행하여 신경망(54)에 입력할 어레이를 생성할 수 있다.
그 다음, 상기 어레이를 상기 신경망(54)에 입력하여 상기 신경망(54)으로부터 출력을 생성할 수 있다.
도 1에서는 CNN의 일 실시예를 나타내었지만, CNN을 구현하는 다양한 다른 예가 존재한다. 또한, 도 1에서 풀링 연산이 CNN의 구현을 위해 이용되었지만, 풀링 연산은 CNN이 아닌 다른 컴퓨팅 기술분야에서도 사용될 수 있다.
풀링 연산의 연산량은 풀링 윈도우의 크기가 커지면 커지는 경향이 있고, Stride의 크기가 작을수록 키지는 경향이 있다. 또한 Stride의 크기가 작을수록 풀링 연산을 수행하는 과정에서 동일한 연산이 반복되는 경향이 높아진다.
본 발명에서는 1차원 어레이에 대한 풀링 연산을 위한 연산량을 감소시키는 풀링 방법을 제공하고자 한다.
본 발명의 일 관점에 따라 입력 어레이를 소정의 풀링규칙에 따라 풀링하는 방법이 제공될 수 있다. 상기 방법은, 상기 입력 어레이(100) 중 풀링할 대상인 제1대상 어레이(110)를 선택하는 제1단계; 상기 제1대상 어레이(110)의 복수 개의 부분들(111~113)을 서브 윈도우(210)를 이용하여 각각 상기 풀링규칙에 따라 풀링하여 복수 개의 서브값들을 산출하는 제2단계; 및 상기 복수 개의 서브값들을 상기 풀링규칙에 따라 풀링하여, 상기 제1대상 어레이의 풀링값을 산출하는 풀링값 산출단계;를 포함한다.
이때, 상기 풀링값 산출단계는, 상기 복수 개의 서브값들을 상기 풀링규칙에 따라 풀링하여 얻은 제1값 및 상기 제1대상 어레이 중 상기 서브윈도우가 풀링하지 않은 값인 나머지 값을 상기 풀링규칙에 따라 풀링하여, 상기 제1대상 어레이의 풀링값을 산출하는 단계인 최종풀링단계를 포함할 수 있다.
이때, 상기 풀링값 산출단계는, 상기 최종풀링단계 이전에, 상기 제1값을 제1버퍼에 저장하는 단계를 더 포함할 수 있다.
이때, 상기 방법은, 상기 입력 어레이(100) 중 풀링할 대상인 제2대상 어레이(120)를 선택하는 단계; 및 상기 제2대상 어레이(120) 중 상기 서브윈도우가 풀링하지 않은 값들 및 상기 제1값을 상기 풀링규칙에 따라 풀링하여, 상기 제2대상 어레이의 풀링값을 산출하는 단계를 더 포함할 수 있다.
이때, 상기 제2대상 어레이의 크기는 상기 제1대상 어레이의 크기와 동일하며, 상기 서브윈도우가 풀링하지 않은 값들 중 연속적인 인덱스를 갖는 한 세트의 값들의 데이터 크기는 상기 서브윈도우의 크기보다 작을 수 있다.
이때, 상기 제2단계 및 상기 풀링값 산출단계 사이에, 상기 복수 개의 서브값들을 복수 개의 버퍼들(31~33) 내에 저장하는 제3단계를 더 포함할 수 있다.
이때, 상기 방법은, 상기 입력 어레이(100) 중 풀링할 대상인 제3대상 어레이(130)를 선택하는 단계; 상기 복수 개의 버퍼들 중 상기 제3대상 어레이(130)에 존재하지 않는 데이터를 풀링한 값을 저장한 버퍼인 무효 버퍼(invalid buffer)를 결정하는 단계; 상기 제3대상 어레이(130) 중 상기 제2단계에서 상기 서브 윈도우에 의해 풀링되지 않은 나머지 부분(114)을 확인하는 단계; 상기 나머지 부분(114)을 상기 서브 윈도우를 이용하여 상기 풀링규칙에 따라 풀링하여 제2서브값을 산출하는 단계; 상기 제2서브값을 상기 무효 버퍼에 저장하는 단계; 및 상기 복수 개의 버퍼들(31~33) 내에 저장되어 있는 값들 및 상기 제3대상 어레이 중 상기 복수 개의 버퍼들의 값을 결정하는 과정에서 고려되지 않았던 값들, 즉 이용되지 않았던 값들을 상기 풀링규칙에 따라 풀링하여, 상기 제3대상 어레이의 풀링값을 산출하는 제5단계;를 더 포함할 수 있다.
이때, 상기 제3대상 어레이의 크기는 상기 제1대상 어레이의 크기와 동일하며, 상기 나머지 부분을 구성하는 구성요소들의 인덱스들은 연속적일 수 있다.
이때, 상기 제5단계는, 상기 복수 개의 버퍼들(31~33) 내에 저장되어 있는 값들을 상기 풀링규칙에 따라 풀링하여 얻은 제2값을 제2버퍼에 저장하는 단계; 및 상기 제2값 및 상기 제3대상 어레이 중 상기 제3대상 어레이 중 상기 복수 개의 버퍼들의 값을 결정하는 과정에서 고려되지 않았던 값들을 상기 풀링규칙에 따라 풀링하여, 상기 제3대상 어레이의 풀링값을 산출하는 단계;를 포함할 수 있다.
이때, 상기 제2버퍼와 상기 제1버퍼는 서로 동일한 것일 수 있다.
이때, 상기 방법은, 상기 입력 어레이(100) 중 풀링할 대상인 제3대상 어레이(130)를 선택하는 단계; 상기 복수 개의 버퍼들 중 가장 먼저 갱신된 값을 갖는 버퍼인 갱신대상버퍼를 결정하는 단계; 상기 제3대상 어레이(130) 중 상기 제2단계에서 상기 서브 윈도우에 의해 풀링되지 않은 나머지 부분(114)을 확인하는 단계; 상기 나머지 부분(114)을 상기 서브 윈도우를 이용하여 상기 풀링규칙에 따라 풀링하여 제2서브값을 산출하는 단계; 상기 제2서브값을 상기 갱신대상버퍼에 저장하는 단계; 및 상기 복수 개의 버퍼들(31~33) 내에 저장되어 있는 값들 및 상기 제3대상 어레이 중 상기 복수 개의 버퍼들의 값을 결정하는 과정에서 고려되지 않았던 값들을 상기 풀링규칙에 따라 풀링하여, 상기 제3대상 어레이의 풀링값을 산출하는 제5단계;를 더 포함할 수 있다.
이때, 상기 풀링값 산출단계에서, 상기 제1대상 어레이의 풀링값은, 상기 복수 개의 서브값들 및 상기 제1대상 어레이 중 상기 서브윈도우가 풀링하지 않은 나머지 값들을 상기 풀링규칙에 따라 풀링하여 산출되고, 상기 서브 윈도우의 크기는 상기 제1대상 어레이의 크기보다 작으며, 상기 복수 개의 부분들 각각은 서로에 대하여 오버랩되지 않고, 상기 복수 개의 부분들 각각의 크기는 상기 서브 윈도우의 크기와 동일하며, 그리고 상기 각각의 부분을 구성하는 구성요소들의 인덱스들은 연속적일 수 있다.
이때, 상기 서브 윈도우의 크기는 2이고, 상기 제1대상 어레이 중 홀수 번째 인덱스를 갖는 데이터의 개수는 N개일 수 있다. 그리고 상기 방법은, 상기 풀링값 산출단계에서 또는 상기 풀링값 산출단계 이전에, 상기 제1대상 어레이 중 홀수 번째 인덱스를 갖는 N개의 데이터를 크기 N을 갖는 재활용 버퍼에 모두 저장하도록 되어 있고, 상기 풀링값 산출단계 이후에, 상기 입력 어레이(100) 중 풀링할 대상인 새로운 대상 어레이를 선택하는 단계; 및 상기 재활용 버퍼 중 상기 나머지 값을 갖는 부분을, 상기 새로운 대상 어레이 중 하나의 데이터로 갱신하는 단계;를 더 포함할 수 있다.
그리고 상기 새로운 대상 어레이 중 하나의 데이터는, 상기 새로운 대상 어레이 중 홀수 번째 인덱스를 갖는 데이터 중 상기 제1대상 어레이 중 홀수 번째 인덱스를 갖는 데이터에 포함되지 않은 것일 수 있다.
본 발명에 따르면 1차원 어레이에 대한 풀링 연산을 위한 연산량을 감소시키는 풀링 방법을 제공할 수 있다.
도 1은 일 실시예에 따른 CNN의 연산구조를 나타낸 것이다. 이하 도 1을 참조하여 설명한다.
도 2는 본 발명의 일 실시예에 따라 제공되는 풀링 방법을 설명한 개념도이다.
도 3은 도 2에 설명한 본 발명의 일 실시예에 따라 제공되는 풀링 방법을 나타낸 순서도이다.
도 4는 본 발명의 일 실시예에 따라, 도 2에 제시한 파트(P28)을 실행하는 구체적인 방법을 나타낸 것이다.
도 5는 본 발명의 일 실시예에 따라, 도 3에 제시한 단계(S140)를 실행하는 구체적인 방법을 나타낸 순서도이다.
도 6은 본 발명의 다른 실시예에 따라 제공되는 풀링 방법을 설명한 개념도이다.
도 7은 도 6에 제시한 방법을 이용하여 도 3 및 도 5에 제시한 풀링 방법을 더 발전시킨 풀링 방법을 나타낸 순서도이다.
도 8은 본 발명의 다른 실시예에 따라 제공되는 풀링 방법을 설명한 개념도이다.
도 9는 도 8에 제시한 방법을 이용하여 도 3에 제시한 풀링 방법을 더 발전시킨 풀링 방법을 나타낸 순서도이다.
도 10은 본 발명의 일 실시예에 따라 제공되는 풀링 방법을 나타낸 순서도이다.
도 11은 본 발명의 일 실시예에 따라, 도 8에 제시한 파트(P85)을 실행하는 구체적인 방법을 나타낸 것이다.
도 12a, 도 12b, 도 12c, 및 도 12d는 본 발명의 일 실시예에 따라 제공되는 버퍼 사용방법을 설명한 것이다.
이하, 본 발명의 실시예를 첨부한 도면을 참고하여 설명한다. 그러나 본 발명은 본 명세서에서 설명하는 실시예에 한정되지 않으며 여러 가지 다른 형태로 구현될 수 있다. 본 명세서에서 사용되는 용어는 실시예의 이해를 돕기 위한 것이며, 본 발명의 범위를 한정하고자 의도된 것이 아니다. 또한, 이하에서 사용되는 단수 형태들은 문구들이 이와 명백히 반대의 의미를 나타내지 않는 한 복수 형태들도 포함한다.
도 2는 본 발명의 일 실시예에 따라 제공되는 풀링 방법을 설명한 개념도이다.
도 2의 파트(P21)는, 풀링을 수행하고자 하는 입력 어레이(100)의 예를 나타낸 것이다. 참조번호 50은 상기 입력 어레이(100)의 각 엘리먼트의 인덱스를 나타낸 숫자이다. 편의상 인덱스를 1부터 9까지만 표시하였다. 입력 어레이(100)는 1차원 어레이일 수 있다.
상기 입력 어레이(100)의 각 엘리먼트를 나타내는 사각형 내에 기록된 숫자는 각 엘리먼트가 갖는 데이터의 값의 예를 나타낸 것이다.
도 2의 파트(P22)는, 풀링 윈도우(200)를 나타낸 것이다. 도 2의 예에서 상기 풀링 윈도우(200)의 크기는 '7'이다.
도 2의 파트(P23) 및 파트(P24)는, 상기 입력 어레이(100) 중 풀링을 수행할 대상으로서 선택된 제1대상 어레이(110)를 나타낸 것이다. 상기 제1대상 어레이(110)의 크기는 상기 풀링 윈도우(200)와 동일한 크기를 갖는다. 도 2의 예에서 상기 제1대상 어레이(110)는 상기 입력 어레이(100) 중 인덱스 1 내지 7에 대응한다.
도 2의 파트(P25)는 본 발명의 일 실시예에 따라 제공되는 서브 윈도우(210)를 나타낸 것이다. 상기 서브 윈도우(210)는 서브 풀링 윈도우라고 지칭될 수도 있다. 도 2에 나타낸 예에서 상기 서브 윈도우(210)의 크기는 '2'이다.
상기 서브 윈도우(210)의 크기는 상기 제1대상 어레이(110)의 크기보다 작을 수 있다. 바람직하게는, 상기 서브 윈도우(210)의 크기는 상기 제1대상 어레이(110)의 크기의 1/2보다 작을 수 있다. 즉, 상기 서브 윈도우(210)의 크기는 상기 풀링 윈도우(200)의 크기보다 작을 수 있다. 바람직하게는, 상기 서브 윈도우(210)의 크기는 상기 풀링 윈도우(200)의 크기의 1/2보다 작을 수 있다.
도 2의 파트(P26)는, 상기 제1대상 어레이(110)의 복수 개의 부분들(111~113)을 상기 서브 윈도우(210)를 이용하여 각각 소정의 풀링규칙에 따라 풀링하여 복수 개의 서브값들을 산출하는 과정을 나타낸 것이다. 도 2에서는 상기 소정의 풀링규칙이 MAX 풀링인 경우를 나타내었다.
제1부분(111), 제2부분(112), 및 제3부분(113)을 각각, 상기 서브 윈도우(210)를 이용하여 풀링하여 산출된 서브값은 각각 '7', '8', 및 '4'이다.
도 2의 파트(P27)은, 상기 복수 개의 서브값들인 '7', '8', 및 '4'을 각각 복수 개의 버퍼들(31~33) 내에 저장하는 과정을 나타낸 것이다.
상기 복수 개의 버퍼들(31~33)은, 하드웨어 가속기에 제공된 내부 메모리에 포함된 것이거나, 또는 CPU에 포함된 캐시 레지스터이거나, 또는 컴퓨팅 장치에 제공된 DRAM에 포함된 것일 수 있다.
도 2의 파트(P28)는, 상기 복수 개의 서브값들 '7', '8', 및 '4' 및 상기 제1대상 어레이(110) 중 상기 서브윈도우(210)가 풀링하지 않은 값인 나머지 값을 상기 풀링규칙에 따라 풀링하여, 상기 제1대상 어레이(110)의 최종 풀링값을 산출하는 과정을 나타낸 것이다.
도 2에서, 상기 서브윈도우(210)가 풀링하지 않은 값인 나머지 값은 파트(P26)에 도시되어 있는 것과 같이, 인덱스 1을 갖는 값 '6'이다. 따라서 파트(P28)에서는 '6', '7', '8', 및 '4'를 상기 소정의 풀링규칙에 따라 풀링하여 최종 풀링값을 산출할 수 있다. 상기 소정의 풀링규칙이 MAX 풀링인 경우 상기 최종 풀링값은 '8'이다.
도 2에 제시한 예와 달리, 상기 서브윈도우가 상기 제1대상 어레이(110)에서 풀링하지 않은 값들이 없을 수도 있다. 예컨대, 풀링 윈도우(200)의 크기가 '6'이고, 서브 윈도우(210)의 크기가 '2'인 경우, 상기 서브윈도우가 상기 제1대상 어레이(110)에서 풀링하지 않은 값은 존재하지 않을 수도 있다. 이 경우도 본 발명의 실시예에 포함될 수 있다.
도 3은 도 2에 설명한 본 발명의 일 실시예에 따라 제공되는 풀링 방법을 나타낸 순서도이다.
도 3에 제시한 풀링 방법은 입력 어레이(100)를 소정의 풀링규칙에 따라 풀링하는 방법이다.
단계(S110)에서, 상기 입력 어레이(100) 중 풀링을 수행할 제1대상 어레이(110)를 선택할 수 있다. 단계(S110)는 제1단계라고 지칭될 수도 있다.
단계(S120)에서, 상기 제1대상 어레이(110)의 복수 개의 부분들(111~113)을 서브 윈도우(210)를 이용하여 각각 상기 풀링규칙에 따라 풀링하여 복수 개의 서브값들을 산출할 수 있다. 단계(S120)를 제2단계라고 지칭할 수도 있다.
단계(S130)에서, 상기 복수 개의 서브값들을 복수 개의 버퍼들(31~33) 내에 저장할 수 있다. 단계(S130)는 제3단계로 지칭할 수도 있다.
단계(S140)에서, 상기 복수 개의 서브값들 및 상기 제1대상 어레이 중 상기 서브윈도우가 풀링하지 않은 값인 나머지 값을 상기 풀링규칙에 따라 풀링하여, 상기 제1대상 어레이(110)의 최종 풀링값을 산출할 수 있다. 단계(S140)는 풀링값 산출단계 또는 제4단계라고 지칭할 수도 있다.
상기 단계(S140)은, 다른 말로, 상기 복수 개의 버퍼들(31~33) 내에 저장되어 있는 값들 및 상기 제1대상 어레이(110) 중 상기 복수 개의 버퍼들의 값을 결정하는 과정에서 고려되지 않았던 값들을 상기 풀링규칙에 따라 풀링하여, 상기 제1대상 어레이(110)의 최종 풀링값을 산출하는 단계일 수 있다.
이때, 상기 서브 윈도우(210)의 크기는 상기 제1대상 어레이(110)의 크기보다 작을 수 있다. 바람직하게는, 상기 서브 윈도우(210)의 크기는 상기 제1대상 어레이(110)의 크기의 1/2과 같거나 그 보다 작을 수 있다.
이때, 상기 복수 개의 부분들(111~113) 각각은 서로에 대하여 오버랩되지 않을 수 있다.
이때, 상기 복수 개의 부분들(111~113) 각각의 크기는 상기 서브 윈도우(210)의 크기와 동일할 수 있다.
이때, 상기 각각의 부분(111~113)을 구성하는 구성요소들의 인덱스들은 연속적일 수 있다.
도 4는 본 발명의 일 실시예에 따라, 도 2에 제시한 파트(P28)을 실행하는 구체적인 방법을 나타낸 것이다.
상기 파트(P28)는 파트(P281) 및 파트(P282)로 구분될 수 있다.
파트(P281)에서, 상기 복수 개의 서브값들 '7', '8', 및 '4'을 상기 풀링규칙에 따라 풀링하여 얻은 제1값인 '8'을 제1버퍼(41)에 저장할 수 있다.
파트(P282)에서, 상기 제1값('8') 및 상기 제1대상 어레이(110) 중 상기 서브윈도우(210)가 풀링하지 않은 값인 나머지 값을 상기 풀링규칙에 따라 풀링하여, 상기 제1대상 어레이(110)의 최종 풀링값을 산출할 수 있다.
도 2 및 도 4에서 상기 서브윈도우(210)가 풀링하지 않은 값인 나머지 값은 도 2의 파트(P26)에 도시되어 있는 것과 같이, 인덱스 1을 갖는 값 '6'이다. 따라서 파트(P282)에서는 '6' 및 '8'을 상기 소정의 풀링규칙에 따라 풀링하여 최종 풀링값을 산출할 수 있다. 상기 소정의 풀링규칙이 MAX 풀링인 경우 상기 최종 풀링값은 '8'이다.
도 5는 본 발명의 일 실시예에 따라, 도 3에 제시한 단계(S140)를 실행하는 구체적인 방법을 나타낸 순서도이다.
단계(S140)는 아래의 단계(S141) 및 단계(S142)를 포함할 수 있다.
단계(S141)에서, 상기 복수 개의 서브값들을 상기 풀링규칙에 따라 풀링하여 얻은 제1값을 제1버퍼에 저장할 수 있다.
단계(S142)에서, 상기 제1값 및 상기 제1대상 어레이 중 상기 서브윈도우가 풀링하지 않은 값인 나머지 값을 상기 풀링규칙에 따라 풀링하여, 상기 제1대상 어레이의 풀링값을 산출할 수 있다.
도 6은 본 발명의 다른 실시예에 따라 제공되는 풀링 방법을 설명한 개념도이다.
도 6에 제시한 풀링 방법은 도 4에 제시한 바와 같이, 복수 개의 버퍼들(31~33)에 저장된 상기 복수 개의 서브값들인 '7', '8', 및 '4'을 상기 풀링규칙에 따라 풀링하여 얻은 제1값인 '8'을 상기 제1버퍼(41)에 저장한 단계를 수행한 것을 전제로 한다.
도 6의 파트(P61) 및 파트(P62)에 제시한 바와 같이, 상기 입력 어레이(100) 중 풀링할 제2대상 어레이(120)를 선택할 수 있다.
상기 제2대상 어레이(120)는 상기 제1대상 어레이(110)와는 다른 것이다. 예컨대 도 2에서 상기 제1대상 어레이(110)는 상기 입력 어레이(100) 중 인덱스 1 내지 7의 집합이며, 도 6에서 상기 제2대상 어레이(120)는 상기 입력 어레이(100) 중 인덱스 2 내지 8의 집합이다. 즉, 상기 제2대상 어레이(120)는, 풀링 윈도우(200)를 상기 제1대상 어레이(110)로부터 스트라이드 1만큼 이동한 것이다.
도 6의 파트(P63)에 제시한 바와 같이, 상기 제2대상 어레이(120) 중 상기 서브윈도우(210)가 풀링하지 않은 값인 나머지 값을 확인할 수 있다.
파트(P63)에 제시한 바와 같이, 상기 제2대상 어레이(120) 중 인덱스 2 및 3은 이미 상기 서브 윈도우(210)에 의해 풀링되었으며 그 결과가 버퍼(31)에 저장되었고, 상기 제2대상 어레이(120) 중 인덱스 4 및 5는 이미 상기 서브 윈도우(210)에 의해 풀링되었으며 그 결과가 버퍼(32)에 저장되었고, 그리고 상기 제2대상 어레이(120) 중 인덱스 6 및 7은 이미 상기 서브 윈도우(210)에 의해 풀링되었으며 그 결과가 버퍼(33)에 저장되었다.
이에 비하여, 상기 제2대상 어레이(120) 중 인덱스 8은 아직 상기 서브 윈도우(210)에 의해 풀링되지 않았다.
즉, 파트(P63)에서 상기 제2대상 어레이(120) 중 상기 서브윈도우(210)가 풀링하지 않은 값인 나머지 값은 인덱스 8의 값 '3'이다.
도 6의 파트(P64)에 제시한 것과 같이, 상기 제2대상 어레이(120) 중 상기 서브윈도우(210)가 풀링하지 않은 값인 나머지 값 '3' 및 상기 제1값 '8'을 상기 풀링규칙에 따라 풀링하여, 상기 제2대상 어레이의 최종 풀링값을 산출할 수 있다.
상기 소정의 풀링규칙이 MAX 풀링인 경우 상기 최종 풀링값은 '8'이다.
이때, 상기 제2대상 어레이(120) 중 서브윈도우(210)가 풀링하지 않은 값들 중 연속적인 인덱스를 갖는 한 세트의 값들(ex: 인덱스 8의 값 '3')의 데이터 크기(ex: 1)는 상기 서브윈도우의 크기(ex: 2)보다 작을 수 있다. 도 6에 나타낸 예에서, 서브윈도우(210)의 크기는 2이므로, 상기 제2대상 어레이(120) 중 서브윈도우(210)가 풀링하지 않은 값들은 0개 또는 1개일 수 있다. 그러나 이와 다른 실시예, 예컨대 서브윈도우의 크기가 K인 경우라면, 상기 제2대상 어레이(120) 중 서브윈도우(210)가 풀링하지 않은 값들은 0, 1, ..., K-1개일 수 있다는 점을 이해할 수 있다.
도 6에 제시된 방법을 이용하면, 풀링 윈도우(200)가 스트라이트 1만큼 이동되었음에도 불구하고, 복수 개의 버퍼들(31~3)에 이미 저장되어 있는 값을 이용하였고, 제1버퍼(41)에 저장되어 있는 제1값과 인덱스 8의 값 '3'의 총 2개의 값만을 이용하여 최종 풀링값을 얻을 수 있다는 이점이 있다.
도 7은 도 6에 제시한 방법을 이용하여 도 3 및 도 5에 제시한 풀링 방법을 더 발전시킨 풀링 방법을 나타낸 순서도이다.
도 7에 나타낸 순서도에서 단계(S150) 및 단계(S160)를 제외한 단계들은 모두 도 3 및 도 5에 제시한 것과 동일하다.
단계(S150)에서, 상기 입력 어레이(100) 중 풀링할 제2대상 어레이(120)를 선택할 수 있다.
단계(S160)에서, 상기 제2대상 어레이(120) 중 상기 서브윈도우가 풀링하지 않은 값인 나머지 값 및 상기 제1값을 상기 풀링규칙에 따라 풀링하여, 상기 제2대상 어레이의 최종 풀링값을 산출할 수 있다.
이때, 상기 제2대상 어레이(120)의 크기는 상기 제1대상 어레이(110)의 크기와 동일할 수 있다.
도 8은 본 발명의 다른 실시예에 따라 제공되는 풀링 방법을 설명한 개념도이다.
도 8에 제시한 풀링 방법은 도 2에 제시한 바와 같이, 복수 개의 버퍼들(31~33)에 상기 복수 개의 서브값들인 '7', '8', 및 '4'을 저장한 단계를 수행한 것을 전제로 한다.
도 8의 파트(P81) 및 파트(P82)에 제시한 바와 같이, 상기 입력 어레이(100) 중 풀링할 제3대상 어레이(130)를 선택할 수 있다.
상기 제3대상 어레이(130)의 크기는 상기 제1대상 어레이(110)의 크기와 동일할 수 있다.
도 8의 파트(P83)에 제시한 바와 같이, 상기 복수 개의 버퍼들(31~33) 중 상기 제3대상 어레이(130)에 존재하지 않는 데이터를 풀링한 값을 저장한 제2버퍼를 결정할 수 있다.
예컨대, 입력 어레이(100) 중 인덱스 2를 갖는 값 '4'는 상기 제3대상 어레이(130)에 존재하지 않는 데이터이다. 그리고 도 8의 예에서, 버퍼(31)는 상기 제3대상 어레이(130)에 존재하지 않는 데이터를 풀링한 값을 저장한 것이다. 따라서 도 8에서 상기 제2버퍼는 버퍼(31)인 것으로 결정될 수 있다.
이제, 상기 제2버퍼에 저장된 값은 무효인 값으로 간주할 수 있다. 그리고 상기 제2버퍼에는 새로운 값을 저장할 수 있다.
도 8의 파트(P84)에 나타낸 것과 같이, 상기 제3대상 어레이(130) 중 상기 서브윈도우(210)에 의해 풀링된 적이 없던 부분인 나머지 부분(114)을 확인할 수 있다.
예컨대, 상기 제3대상 어레이(130) 중 인덱스 3 내지 7의 데이터는 이미 도 2의 파트(P26)에서 서브윈도우(210)에 의해 풀링된 데이터이다. 그리고 상기 제3대상 어레이(130) 중 인덱스 8 및 9의 데이터만이 아직 서브윈도우(210)에 의해 풀링된 적이 없는 데이터이다. 따라서 상기 제3대상 어레이(130) 중 참조번호 114로 지시한 부분이 상기 나머지 부분이다.
그리고 도 8의 파트(P84)에 나타낸 것과 같이, 상기 나머지 부분(114)을 상기 서브윈도우(210)를 이용하여 상기 풀링규칙에 따라 풀링하여 제2서브값을 산출하고, 상기 제2서브값은 상기 제2버퍼에 저장할 수 있다. 도 8에 나타낸 예에서, 상기 제2서브값은 '3'이고, 상기 제2버퍼는 버퍼(31)이다.
이때, 상기 나머지 부분(114)을 구성하는 구성요소들의 인덱스들은 연속적일 수 있다. 예컨대 상기 나머지 부분(114)을 구성하는 구성요소들의 인덱스들은 각각 8 및 9로서 연속적인 자연수들이다.
도 8의 파트(P85)에 나타낸 것과 같이, 상기 복수 개의 버퍼들(31~33) 내에 저장되어 있는 값들 '3', '8', 및 '4', 및 상기 제3대상 어레이(130) 중 상기 복수 개의 버퍼들(31~33)의 값을 결정하는 과정에서 고려되지 않았던 값들을 상기 풀링규칙에 따라 풀링하여, 상기 제3대상 어레이(130)의 최종 풀링값을 산출할 수 있다.
여기서, 상기 제3대상 어레이(130) 중 상기 복수 개의 버퍼들(31~33)의 값을 결정하는 과정에서 고려되지 않았던 값들은, 인덱스 3의 값 '7'이다. 상기 풀링규칙이 MAX 풀링인 경우, 상기 제3대상 어레이(130)의 최종 풀링값은 '8'이다.
도 9는 도 8에 제시한 방법을 이용하여 도 3에 제시한 풀링 방법을 더 발전시킨 풀링 방법을 나타낸 순서도이다.
도 9에 나타낸 순서도에서 단계(S110), 단계(S120), 단계(S130), 및 단계(S140)는 모두 도 3에 제시한 것과 동일하다.
단계(S171)에서, 상기 입력 어레이(100) 중 풀링할 제3대상 어레이(130)를 선택할 수 있다.
단계(S172)에서, 상기 복수 개의 버퍼들(31~33) 중 상기 제3대상 어레이(130)에 존재하지 않는 데이터를 풀링한 값을 저장한 버퍼인 무효버퍼를 결정할 수 있다.
여기서, 상기 무효버퍼는 상기 갱신대상버퍼일 수 있다. 즉, 상기 복수 개의 버퍼들(31~33) 중 상기 제3대상 어레이(130)에 존재하지 않는 데이터를 풀링한 값을 저장한 버퍼는, 상기 버퍼(31~33)에서 가장 오래전에 기록되었던 값이 저장되어 있는 버퍼일 수 있다.
단계(S173)에서, 상기 제3대상 어레이(130) 중 상기 서브 윈도우에 의해 풀링된 적이 없는 부분인 나머지 부분(114)을 확인할 수 있다.
단계(S174)에서, 상기 나머지 부분(114)을 상기 서브 윈도우를 이용하여 상기 풀링규칙에 따라 풀링하여 제2서브값을 산출할 수 있다.
단계(S175)에서, 상기 제2서브값을 상기 무효버퍼에 저장할 수 있다.
단계(S176)에서, 상기 복수 개의 버퍼들(31~33) 내에 저장되어 있는 값들 및 상기 제3대상 어레이(130) 중 상기 복수 개의 버퍼들의 값을 결정하는 과정에서 고려되지 않았던 값들을 상기 풀링규칙에 따라 풀링하여, 상기 제3대상 어레이(130)의 최종 풀링값을 산출할 수 있다.
이때, 상기 제3대상 어레이(130)의 크기는 상기 제1대상 어레이(110)의 크기와 동일할 수 있다.
도 10은 본 발명의 일 실시예에 따라 제공되는 풀링 방법을 나타낸 순서도이다.
도 8에 제시한 실시예는 도 10에 나타낸 순서도를 이용하여 다음과 같이 다시 설명할 수도 있다.
단계(S210)에서, 도 8의 파트(P81) 및 파트(P82)에 제시한 바와 같이, 상기 입력 어레이(100) 중 풀링할 제3대상 어레이(130)를 선택할 수 있다.
단계(S220)에서, 상기 복수 개의 버퍼들(31~33) 중 가장 먼저 갱신된 값을 갖는 버퍼인 갱신대상버퍼를 결정할 수 있다. 예컨대 도 8에서, 상기 복수 개의 버퍼들(31~33)에 포함된 값은 각각 '7', '8', '4' 이며, 이 중 가장 먼저 갱신된 값은 '7'이다. 상기 가장 먼저 갱신된 값 '7'을 갖는 버퍼는 버퍼(31)이다. 따라서 이 경우 상기 갱신대상버퍼는 버퍼(31)이다.
단계(S230)에서, 상기 제3대상 어레이(130) 중 상기 제2단계(단계(S120))에서 상기 서브 윈도우에 의해 풀링되지 않은 나머지 부분(114)을 확인할 수 있다.
단계(S240)에서, 상기 나머지 부분(114)을 상기 서브윈도우를 이용하여 상기 풀링규칙에 따라 풀링하여 제2서브값을 산출할 수 있다.
단계(S250)에서, 상기 제2서브값을 상기 갱신대상버퍼인 버퍼(31)에 저장할 수 있다.
단계(S260)에서, 상기 복수 개의 버퍼들(31~33) 내에 저장되어 있는 값들 및 상기 제3대상 어레이 중 상기 복수 개의 버퍼들이 갖는 값을 결정하는 과정에서 고려되지 않았던 값들을 상기 풀링규칙에 따라 풀링하여, 상기 제3대상 어레이의 풀링값을 산출할 수 있다(제5단계).
도 8 내지 도 10을 이용하여 설명한 본 발명의 일 실시예에 따른 방법은, 서브윈도우를 이용하여 풀링하여 얻은 서브값들을 저장하는 버퍼(31~33)인 서브 풀링용 버퍼를 재사용하는 개념을 설명한 것이다. 즉, 상기 버퍼(31~33) 모두에 소정의 데이터가 저장된 상태에서, 새로운 데이터를 저장할 필요가 있을 때에, 상기 버퍼(31~33)에서 가장 오래전에 기록되었던 값을 버릴 수 있다. 예컨대 도 8의 예에서, 상기 서브 풀링용 버퍼에는 인덱스 31, 32, 33으로 표시된다. 이 인덱스 값을 갖는 한 개의 변수 Var_x가 정의될 수 있다. 이때, 상기 서브 풀링용 버퍼에 한 개의 값을 기록할 때마다 위 변수 Var_x의 값을 순환적(cyclic)으로 증가시키거나 감소시킬 수 있다 (ex: Var_x= 31-->32-->33-->31-->32-->33-->31...). 그리고 이때, 상기 버퍼(31~33) 모두에 소정의 데이터가 저장된 상태에서 새로운 데이터를 저장할 필요가 있을 때, 상기 새로운 데이터는 서브 풀링용 버퍼 중 상기 변수가 현재 가리키는 인덱스를 갖는 버퍼에 저장할 수 있다.
도 11은 본 발명의 일 실시예에 따라, 도 8에 제시한 파트(P85)을 실행하는 구체적인 방법을 나타낸 것이다.
상기 파트(P85)는 파트(P851) 및 파트(P852)로 구분될 수 있다.
파트(P851)에서, 상기 복수 개의 서브값들 '3', '8', 및 '4'을 상기 풀링규칙에 따라 풀링하여 얻은 제2값인 '8'을 제2버퍼(42)에 저장할 수 있다.
파트(P852)에서, 상기 제2값('8') 및 상기 제3대상 어레이(130) 중 상기 복수 개의 버퍼들의 값을 결정하는 과정에서 고려되지 않았던 값들을 상기 풀링규칙에 따라 풀링하여, 상기 제3대상 어레이(130)의 최종 풀링값을 산출할 수 있다.
도 8 및 도 11에서, 상기 제3대상 어레이(130) 중 상기 복수 개의 버퍼들(31~33)의 값을 결정하는 과정에서 고려되지 않았던 값들은 도 8의 파트(P84)에 도시되어 있는 것과 같이, 인덱스 3을 갖는 값 '7'이다. 따라서 파트(P852)에서는 '7' 및 '8'을 상기 소정의 풀링규칙에 따라 풀링하여 최종 풀링값을 산출할 수 있다. 상기 소정의 풀링규칙이 MAX 풀링인 경우 상기 최종 풀링값은 '8'이다.
이때, 상기 제1버퍼(41)와 상기 제2버퍼(42)는 동일한 것일 수 있다.
이하 도 12a, 도 12b, 도 12c, 및 도 12d를 통칭하여 도 12라고 지칭할 수 있다.
도 12는 본 발명의 일 실시예에 따라 제공되는 버퍼 사용방법을 설명한 것이다.
도 12a의 윗 부분을 참조하여 설명하면, DRAM 또는 내부 메모리에 저장된 상기 입력 어레이(100) 중 가장 앞 부분의 데이터를 읽어 들여 상기 제1대상 어레이(110)를 준비할 수 있다. 이때, 인덱스 1 내지 7의 모든 데이터를 읽어서 데이터 버퍼에 저장할 수 있다.
도 12a의 아랫 부분을 참조하여 설명하면, 재활용 버퍼(71~74)에는 각각 상기 DRAM 또는 내부 메모리로부터 새로 읽어온 값들 중 홀수의 인덱스를 갖는 값들을 저장할 수 있다. 상기 저장의 순서는 인덱스 값의 오름차 순으로 실행할 수 있다. 즉, 인덱스 1인 값을 먼저 저장하고, 인덱스 7인 값을 가장 나중에 저장할 수 있다. 따라서, 상기 인덱스 1인 값이 가장 오래 전에 저장된 값이고, 인덱스 7인 값이 가장 최근에 저장된 값이다. 상기 재활용 버퍼(71~74)에 저장된 값들은, 상술한 풀링을 위해 사용될 수 있다.
도 12b의 윗 부분을 참조하여 설명하면, 제1대상 어레이(110) 중 일부를 상기 서브 윈도우를 이용하여 풀링함으로써 상술한 복수 개의 서브값들을 상술한 복수 개의 버퍼들(31~33) 내에 저장할 수 있다.
이때, 상기 제1대상 어레이(110) 중 더 작은 인덱스를 갖는 값들에 대한 서브값을 먼저 생성하여 버퍼에 저장하고, 더 큰 인덱스를 갖는 값들에 대한 서브값을 나중에 생성하여 버퍼에 저장할 수 있다. 예컨대 도 12b의 윗 부분에서, 버퍼(31)에 저장된 값이 가장 오래 전에 저장된 값이고, 버퍼(33)에 저장된 값이 가장 최근에 저장된 값이다.
도 12b의 중간 부분을 참조하여 설명하면, 상술한 복수 개의 버퍼들(31~33)의 값을 생성하기 위해 이용된 데이터들은 상기 데이터 버퍼에서 삭제될 수 있다.
도 12b의 아랫 부분을 참조하여 설명하면, 상기 제1대상 어레이(110)에 대한 풀링은 상기 재활용 버퍼들에 저장된 값들 중 가장 오래전에 저장된 값, 그리고 상기 복수 개의 버퍼들(31~33)에 저장된 값들을 대상으로 수행된다. 도 12b에서 재활용 버퍼(71)에 저장된 값 '6'이 가장 오래전에 저장된 값이다.
도 12c를 참조하여 설명하면, 상기 풀링 위도우(200)를 stride 1만큼 이동시켜서 상기 제2대상 어레이(120)를 결정할 수 있다.
이때, 입력 어레이(100) 중 인덱스 2 내지 인덱스 7에 대한 풀링 결과는 이미 상기 복수 개의 버퍼들(31~33)에 저장되어 있기 때문에, 입력 어레이(100) 중 인덱스 2 내지 인덱스 7의 개별 값들은 필요하지 않다. 따라서 상기 제2대상 어레이(120)의 풀링을 위해 필요한 정보로서 상기 입력 어레이(100) 중 인덱스 8인 값만 읽어 오면 충분하다. 따라서 DRAM 또는 내부 메모리에 저장된 상기 입력 어레이(100) 중 인덱스 2~8의 값들을 모두 읽지 않고 인덱스 8의 값만을 읽으므로 DRAM 또는 내부 메모리에 연결된 인터커넥트(interconnect)의 자원을 절약할 수 있다는 효과가 있다.
이때, 상기 DRAM 또는 내부 메모리로부터 새로 읽어온 값들 중 홀수의 인덱스를 갖는 값이 없기 때문에, 재활용 버퍼(71~74)의 값을 갱신하지는 않는다. 그리고 상기 새로 읽어온 인덱스 8의 값은 상기 복수 개의 버퍼들(31~33)에 저장된 값을 갱신하는 데에 사용되지 않았기 때문에, 상기 인덱스 8의 값을 상기 데이터 버퍼로부터 삭제하지는 않는다.
그리고 상기 제2대상 어레이(120)에 대한 풀링은 상기 복수 개의 버퍼들(31~33)에 저장된 값들, 그리고 상기 새로 읽어온 인덱스 8의 값을 대상으로 수행된다.
도 12d의 상측 부분을 참조하여 설명하면, 상기 풀링 위도우(200)를 stride 1만큼 이동시켜서 상기 제3대상 어레이(130)를 결정할 수 있다.
이때, 입력 어레이(100) 중 인덱스 4 내지 인덱스 7에 대한 풀링 결과는이미 상기 복수 개의 버퍼들(32~33)에 저장되어 있기 때문에, 입력 어레이(100) 중 인덱스 4 내지 인덱스 7의 개별 값들은 필요하지 않다. 또한 상기 인덱스 8의 값은 아직 삭제되지 않은 상태이다. 또한 상기 인덱스 3의 값은 이미 재활용 버퍼(72)에 저장되어 있는 상태이다.
따라서 상기 제3대상 어레이(130)의 풀링을 위해 필요한 정보로서 상기 입력 어레이(100) 중 인덱스 9인 값만 읽어 오면 충분하다. 따라서 DRAM 또는 내부 메모리에 저장된 상기 입력 어레이(100) 중 인덱스 3~8의 값들을 모두 읽지 않고 인덱스 9의 값만을 읽으므로 DRAM 또는 내부 메모리에 연결된 인터커넥트의 자원을 절약할 수 있다는 효과가 있다.
이때, 상기 DRAM 또는 내부 메모리로부터 새로 읽어온 값은 홀수(=9)의 인덱스를 갖는 값이다. 이 경우, 재활용 버퍼(71~74) 중 가장 오래 전에 저장된 값을 갖는 것인 재활용 버퍼(71)의 값을 상기 새로 읽어온 인덱스 9의 값 '2'로 갱신한다. 이제, 도 12d에서 재활용 버퍼(71~74) 중 가장 오래 전에 저장된 값을 갖는 것은 재활용 버퍼(72)이고, 가장 최근에 저장된 값을 갖는 것은 재활용 버퍼(71)이다.
상기 제3대상 어레이(130) 중 상기 데이터 버퍼에 개별적으로 저장되어 있는, 인덱스 8 및 9의 값들에 대한 서브값을 새로 생성하여 상기 복수 개의 버퍼들의 값을 갱신할 수 있다. 이때, 복수 개의 버퍼(31~33) 중 가장 오래 전에 저장된 값을 갖는 것인 버퍼(31)의 값을 상기 새로 생성한 서브값 '3'으로 갱신할 수 있다. 이제, 도 12d에서 상기 복수 개의 버퍼(31~33) 중 가장 오래 전에 저장된 값을 갖는 것은 버퍼(32)이고, 가장 최근에 저장된 값을 갖는 것은 버퍼(31)이다.
도 12d의 중간 부분을 참조하여 설명하면, 인덱스 8 및 9의 값들은 복수 개의 버퍼의 값을 갱신하는데 사용되었으므로 상기 데이터 버퍼로부터 삭제될 수 있다.
도 12d의 아랫 부분을 참조하여 설명하면, 상기 제3대상 어레이(130)에 대한 풀링은 상기 재활용 버퍼들에 저장된 값들 중 가장 오래전에 저장된 값, 그리고 상기 복수 개의 버퍼들(31~33)에 저장된 값들을 대상으로 수행된다. 도 12d에서 재활용 버퍼(72)에 저장된 값 '7'이 가장 오래전에 저장된 값이다.
도 12d에 제시한 제3대상 어레이(130)를 풀링하는 단계 이후에, 도 12c 및 도 12d와 같이 상기 풀링 위도우(200)를 stride 1만큼 이동시켜서 제4대상 어레이, 제5대상 어레이 등을 생성하고, 이들을 풀링하는 과정은 반복될 수 있다.
각 대상 어레이의 인덱스가 짝수인 경우 도 12c와 같은 원리로 처리되며, 홀수인 경우 도 12d와 같은 원리로 처리될 수 있다는 점을 이해할 수 있다.
도 12에 제시한 실시예에 따르면, 상기 복수 개의 버퍼들(31~33) 및 상기 복수 개의 재활용 버퍼들(71~74)의 값을 사이클릭 방식으로 갱신함으로써 상기 데이터 버퍼가 차지하는 자원을 최소화할 수 있으며, 상기 입력 데이터(100)가 저장된 DRAM 또는 내부 메모리에 연결된 인터커넥트에 대한 사용량을 줄일 수 있다는 효과가 있다. 또한, DRAM 또는 내부 메모리로부터 읽어오는 데이터의 양이 감소하기 때문에 더 빠른 속도로 풀링을 수행할 수 있는 효과가 있다.
상술한 본 발명의 실시예들을 이용하여, 본 발명의 기술 분야에 속하는 자들은 본 발명의 본질적인 특성에서 벗어나지 않는 범위 내에 다양한 변경 및 수정을 용이하게 실시할 수 있을 것이다. 특허청구범위의 각 청구항의 내용은 본 명세서를 통해 이해할 수 있는 범위 내에서 인용관계가 없는 다른 청구항에 결합될 수 있다.
<사사-Acknowledgement>
본 발명은, 오픈엣지테크놀로지 주식회사(과제수행기관)가, 산업통상자원부와 국방과학연구소 민군협력진흥원의 지원으로 이루어진 연구사업인 민군겸용기술개발사업 중 획득영상에서 Semantic 정보처리를 위한 엣지용 SoC 및 미들웨어 개발 중 AI 가속기(NPU) 개발(과제고유번호 1415170944, 과제번호 20-CM-BD-02, 연구기간 2020.12.24 ~ 2023.12.23) 연구과제를 수행하는 과정에서 개발된 것이다.

Claims (11)

  1. 입력 어레이를 소정의 풀링규칙에 따라 풀링하는 방법으로서,
    상기 입력 어레이 중 풀링할 대상인 제1대상 어레이를 선택하는 제1단계;
    상기 제1대상 어레이의 복수 개의 부분들을 서브 윈도우를 이용하여 각각 상기 풀링규칙에 따라 풀링하여 복수 개의 서브값들을 산출하는 제2단계; 및
    상기 복수 개의 서브값들을 상기 풀링규칙에 따라 풀링하여, 상기 제1대상 어레이의 풀링값을 산출하는 풀링값 산출단계;
    를 포함하는,
    풀링 방법.
  2. 제1항에 있어서,
    상기 풀링값 산출단계는,
    상기 복수 개의 서브값들을 상기 풀링규칙에 따라 풀링하여 얻은 제1값과 나머지 값을 상기 풀링규칙에 이해 풀링하여, 상기 제1대상 어레이의 풀링값을 산출하는 단계인 최종풀링단계;
    를 포함하며,
    상기 나머지 값은 상기 제1대상 어레이 중 상기 서브윈도우를 이용하여 풀링하지 않은 값인,
    풀링 방법.
  3. 제2항에 있어서,
    상기 입력 어레이 중 풀링할 대상인 제2대상 어레이를 선택하는 단계; 및
    상기 제2대상 어레이 중 상기 서브윈도우가 풀링하지 않은 값들 및 상기 제1값을 상기 풀링규칙에 따라 풀링하여, 상기 제2대상 어레이의 풀링값을 산출하는 단계;
    를 더 포함하며,
    상기 제2대상 어레이는 상기 제1대상 어레이와 다르며,
    상기 제1대상 어레이 중 복수 개의 서브값들을 산출하는 과정에서 사용되었던 제1세트의 값들은 모두 상기 제2대상 어레이에 포함되어 있는,
    풀링 방법.
  4. 제3항에 있어서,
    상기 제2대상 어레이의 크기는 상기 제1대상 어레이의 크기와 동일하며,
    상기 제2대상 어레이 중 상기 제1세트의 값들을 제외한 나머지 값들 중에서 연속적인 인덱스를 갖는 제2세트의 값들의 데이터 크기는 상기 서브윈도우의 크기보다 작은,
    풀링 방법.
  5. 제1항에 있어서, 상기 제2단계 및 상기 풀링값 산출단계 사이에, 상기 복수 개의 서브값들을 복수 개의 버퍼들 내에 저장하는 제3단계를 더 포함하는, 풀링 방법.
  6. 제5항에 있어서,
    상기 입력 어레이 중 풀링할 대상인 제3대상 어레이를 선택하는 단계;
    상기 복수 개의 버퍼들 중 상기 제3대상 어레이에 존재하지 않는 데이터를 풀링한 결과를 저장한 버퍼인 무효 버퍼(invalid buffer)를 결정하는 단계;
    상기 제3대상 어레이 중 상기 제2단계에서 상기 서브 윈도우에 의해 풀링되지 않은 나머지 부분을 확인하는 단계;
    상기 나머지 부분을 상기 서브 윈도우를 이용하여 상기 풀링규칙에 따라 풀링하여 제2서브값을 산출하는 단계;
    상기 제2서브값을 상기 무효 버퍼에 저장하는 단계; 및
    상기 복수 개의 버퍼들 내에 저장되어 있는 값들 및 상기 제3대상 어레이 중 상기 복수 개의 버퍼들의 값을 결정하는 과정에서 고려되지 않았던 값들을 상기 풀링규칙에 따라 풀링하여, 상기 제3대상 어레이의 풀링값을 산출하는 제5단계;
    를 더 포함하는,
    풀링 방법.
  7. 제6항에 있어서,
    상기 제3대상 어레이의 크기는 상기 제1대상 어레이의 크기와 동일하며,
    상기 나머지 부분을 구성하는 구성요소들의 인덱스들은 연속적인,
    풀링 방법.
  8. 제6항에 있어서,
    상기 제5단계는,
    상기 복수 개의 버퍼들 내에 저장되어 있는 값들을 상기 풀링규칙에 따라 풀링하여 얻은 제2값을 제2버퍼에 저장하는 단계; 및
    상기 제3대상 어레이 중 상기 복수 개의 버퍼들의 값을 결정하는 과정에서 고려되지 않았던 값들 및 상기 제2값을 상기 풀링규칙에 따라 풀링하여, 상기 제3대상 어레이의 풀링값을 산출하는 단계;
    를 포함하는,
    풀링 방법.
  9. 제5항에 있어서,
    상기 입력 어레이(100) 중 풀링할 대상인 제3대상 어레이(130)를 선택하는 단계;
    상기 복수 개의 버퍼들 중 가장 먼저 갱신된 값을 갖는 버퍼인 갱신대상버퍼를 결정하는 단계;
    상기 제3대상 어레이(130) 중 상기 제2단계에서 상기 서브 윈도우에 의해 풀링되지 않은 나머지 부분(114)을 확인하는 단계;
    상기 나머지 부분(114)을 상기 서브 윈도우를 이용하여 상기 풀링규칙에 따라 풀링하여 제2서브값을 산출하는 단계;
    상기 제2서브값을 상기 갱신대상버퍼에 저장하는 단계; 및
    상기 복수 개의 버퍼들 내에 저장되어 있는 값들 및 상기 제3대상 어레이 중 상기 복수 개의 버퍼들의 값을 결정하는 과정에서 고려되지 않았던 값들을 상기 풀링규칙에 따라 풀링하여, 상기 제3대상 어레이의 풀링값을 산출하는 제5단계;
    를 더 포함하는,
    풀링 방법.
  10. 제1항에 있어서,
    상기 풀링값 산출단계에서, 상기 제1대상 어레이의 풀링값은, 상기 복수 개의 서브값들 및 상기 제1대상 어레이 중 상기 서브윈도우가 풀링하지 않은 나머지 값들을 상기 풀링규칙에 따라 풀링하여 산출되고,
    상기 서브 윈도우의 크기는 상기 제1대상 어레이의 크기보다 작으며,
    상기 복수 개의 부분들 각각은 서로에 대하여 오버랩되지 않고,
    상기 복수 개의 부분들 각각의 크기는 상기 서브 윈도우의 크기와 동일하며, 그리고
    상기 각각의 부분을 구성하는 구성요소들의 인덱스들은 연속적인,
    풀링 방법.
  11. 제2항에 있어서,
    상기 서브 윈도우의 크기는 2이고, 상기 제1대상 어레이 중 홀수 번째 인덱스를 갖는 데이터의 개수는 N개이며,
    상기 풀링값 산출단계에서 또는 상기 풀링값 산출단계 이전에, 상기 제1대상 어레이 중 홀수 번째 인덱스를 갖는 N개의 데이터를 크기 N을 갖는 재활용 버퍼에 모두 저장하도록 되어 있고,
    상기 풀링값 산출단계 이후에, 상기 입력 어레이(100) 중 풀링할 대상인 새로운 대상 어레이를 선택하는 단계; 및
    상기 재활용 버퍼 중 상기 나머지 값을 갖는 부분을, 상기 새로운 대상 어레이 중 하나의 데이터로 갱신하는 단계;
    를 더 포함하며,
    상기 새로운 대상 어레이 중 하나의 데이터는, 상기 새로운 대상 어레이 중 홀수 번째 인덱스를 갖는 데이터 중 상기 제1대상 어레이 중 홀수 번째 인덱스를 갖는 데이터에 포함되지 않은 것인,
    풀링 방법.
PCT/KR2022/006215 2021-11-09 2022-04-29 1차원 어레이 풀링 방법 및 이를 위한 장치 WO2023085535A1 (ko)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR1020210153244A KR102395743B1 (ko) 2021-11-09 2021-11-09 1차원 어레이 풀링 방법 및 이를 위한 장치
KR10-2021-0153244 2021-11-09

Publications (1)

Publication Number Publication Date
WO2023085535A1 true WO2023085535A1 (ko) 2023-05-19

Family

ID=81583114

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2022/006215 WO2023085535A1 (ko) 2021-11-09 2022-04-29 1차원 어레이 풀링 방법 및 이를 위한 장치

Country Status (2)

Country Link
KR (1) KR102395743B1 (ko)
WO (1) WO2023085535A1 (ko)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190266784A1 (en) * 2018-02-27 2019-08-29 Stmicroelectronics S.R.L. Data volume sculptor for deep learning acceleration
KR20200100812A (ko) * 2018-01-04 2020-08-26 테슬라, 인크. 하드웨어 기반 풀링을 위한 시스템 및 방법
US20210073569A1 (en) * 2018-05-30 2021-03-11 SZ DJI Technology Co., Ltd. Pooling device and pooling method
KR20210036715A (ko) * 2019-09-26 2021-04-05 삼성전자주식회사 뉴럴 프로세싱 장치 및 뉴럴 프로세싱 장치에서 뉴럴 네트워크의 풀링을 처리하는 방법
KR102317668B1 (ko) * 2016-10-27 2021-10-26 구글 엘엘씨 신경망 연산 타일

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102317668B1 (ko) * 2016-10-27 2021-10-26 구글 엘엘씨 신경망 연산 타일
KR20200100812A (ko) * 2018-01-04 2020-08-26 테슬라, 인크. 하드웨어 기반 풀링을 위한 시스템 및 방법
US20190266784A1 (en) * 2018-02-27 2019-08-29 Stmicroelectronics S.R.L. Data volume sculptor for deep learning acceleration
US20210073569A1 (en) * 2018-05-30 2021-03-11 SZ DJI Technology Co., Ltd. Pooling device and pooling method
KR20210036715A (ko) * 2019-09-26 2021-04-05 삼성전자주식회사 뉴럴 프로세싱 장치 및 뉴럴 프로세싱 장치에서 뉴럴 네트워크의 풀링을 처리하는 방법

Also Published As

Publication number Publication date
KR102395743B1 (ko) 2022-05-09

Similar Documents

Publication Publication Date Title
WO2021054706A1 (en) Teaching gan (generative adversarial networks) to generate per-pixel annotation
WO2018030772A1 (ko) 감응식 교통 신호 제어 방법 및 그 장치
WO2019098538A1 (en) Device and method for processing convolution operation using kernel
WO2021201422A1 (ko) Ar에 적용 가능한 의미적인 분할 방법 및 시스템
WO2020204364A2 (ko) 단어의 문맥 정보와 형태론적 정보를 고려한 단어 임베딩 방법 및 장치
WO2019235828A1 (ko) 투 페이스 질병 진단 시스템 및 그 방법
EP3942481A1 (en) Method of performing, by electronic device, convolution operation at certain layer in neural network, and electronic device therefor
WO2020246655A1 (ko) 상황 인지 방법 및 이를 수행하는 장치
WO2021010671A2 (ko) 뉴럴 네트워크 및 비국소적 블록을 이용하여 세그멘테이션을 수행하는 질병 진단 시스템 및 방법
WO2022146050A1 (ko) 우울증 진단을 위한 인공지능 연합학습 방법 및 시스템
WO2023085535A1 (ko) 1차원 어레이 풀링 방법 및 이를 위한 장치
WO2020141720A1 (en) Apparatus and method for managing application program
WO2023113437A1 (ko) 메모리를 이용하는 의미론적 영상 분할 장치 및 방법
WO2023177108A1 (en) Method and system for learning to share weights across transformer backbones in vision and language tasks
WO2023120829A1 (ko) 어레이 풀링 방법 및 이를 위한 장치
WO2022139327A1 (en) Method and apparatus for detecting unsupported utterances in natural language understanding
WO2022164236A1 (en) Method and system for searching target node related to queried entity in network
WO2021235701A1 (en) Method for performing adjustable continual learning on deep neural network model by using selective deep generative replay module and device using the same
WO2022255561A1 (ko) 고효율 풀링 방법 및 이를 위한 장치
WO2021020848A2 (ko) 인공 신경망을 위한 행렬 연산기 및 행렬 연산 방법
WO2020263065A1 (en) Method and apparatus for managing neural network models
WO2021002523A1 (ko) 뉴로모픽 장치
WO2020045903A1 (ko) Cnn을 이용하여 크기 독립적으로 물체를 검출하는 방법 및 장치
WO2023121263A1 (ko) 전자 장치 및 전자 장치의 제어 방법
WO2023177025A1 (ko) 이력 현상을 이용한 파라미터 양자화 기반 인공 신경망 연산 방법 및 장치

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22892958

Country of ref document: EP

Kind code of ref document: A1