WO2024014631A1 - 데이터 스케일을 고려한 콘볼루션 데이터의 양자화 방법, 이를 위한 하드웨어 가속기, 및 이를 이용한 컴퓨팅 장치 - Google Patents

데이터 스케일을 고려한 콘볼루션 데이터의 양자화 방법, 이를 위한 하드웨어 가속기, 및 이를 이용한 컴퓨팅 장치 Download PDF

Info

Publication number
WO2024014631A1
WO2024014631A1 PCT/KR2022/021109 KR2022021109W WO2024014631A1 WO 2024014631 A1 WO2024014631 A1 WO 2024014631A1 KR 2022021109 W KR2022021109 W KR 2022021109W WO 2024014631 A1 WO2024014631 A1 WO 2024014631A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
output
input
channel
scale
Prior art date
Application number
PCT/KR2022/021109
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 WO2024014631A1 publication Critical patent/WO2024014631A1/ko

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/15Correlation function computation including computation of convolution operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • G06N20/10Machine learning using kernel methods, e.g. support vector machines [SVM]
    • 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/04Architecture, e.g. interconnection topology
    • G06N3/048Activation functions
    • 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 technology for performing operations in a computing device, to an addition operation technology considering the scale of a number, and in particular to a technology to quantize convolution data according to the characteristics of a scheduled subsequent operation. .
  • Signal processing technology used to implement artificial intelligence can be implemented as software or as a hardware accelerator for fast processing.
  • the neural network used for machine learning there are many layers that perform various calculations, and a lot of data can be calculated in each layer.
  • problems may occur due to an environment in which the size of the internal memory or internal buffer provided inside the hardware accelerator is limited. In other words, if the size of one set of data that is the target of operation is smaller than the size of the internal memory or internal buffer, one set of data is divided into two subsets, each is calculated separately, sub result values are calculated, and the sub result values are calculated. The resulting values must be recombined.
  • the sub-result values are stored in the internal memory or internal buffer and then go through a process of being read again, but there is a problem that an unwanted quantization error of data may occur in this process.
  • This quantization error may be an error that would not occur if one set of data was not divided into two subsets and calculated separately.
  • Prior technologies related to quantization of data in neural network technology include Korean Patent Application Nos. 1020217011986, 1020200110330, 1020170150707, 1020200082108, and 1020207038081.
  • FIGS. 1 to 5 These contents are prior knowledge known to the inventor of the present invention, and at least some of them may not be disclosed to unspecified persons at the time of filing this patent application.
  • the present invention utilizes the concept of scale of numbers or data used by computing devices.
  • Computing devices express numbers in the form of N-bit numbers using binary numbers.
  • the N-bit number includes the Most Significant Bit (MSB) and the Least Significant Bit (LSB).
  • MSB Most Significant Bit
  • LSB Least Significant Bit
  • the scale of the N-bit number can be defined as the size of the number represented by the LSB of the N-bit number.
  • the N-bit number can be defined by the minimum absolute value other than 0 (zero) that can be expressed.
  • decimal numbers '128' and '1' which are two numbers each expressed by 2 bits, can be considered.
  • the decimal number '128' may be expressed as '01' according to binary notation
  • the decimal number '1' may be expressed as '01' according to binary notation
  • the first scale which is the scale of the 2-bit number representing the decimal number '128'
  • the second scale which is the scale of the 2-bit number representing the decimal number '1'
  • the first scale is 128 times larger than the second scale.
  • Figure 1a shows the configuration of input activation 710, one of the objects for mathematical operation according to the present invention.
  • input activation may also be referred to as first input data.
  • the input activation 710 may be a three-dimensional array consisting of a first dimension, a second dimension, and a third dimension.
  • the first dimension, the second dimension, and the third dimension of the input activation 710 may be referred to as an input channel dimension, a height dimension, and a width dimension, respectively.
  • the data size of the input activation 710 shown in FIG. 1A is proportional to ci*h*w.
  • sc_ai1 may be, for example, decimal 1, or may be, for example, decimal 128, or may be another value.
  • Figure 1b shows the configuration of a weight 740, another object of mathematical operations according to the present invention.
  • the weight 740 may also be referred to as second input data.
  • the weight 740 may be a four-dimensional array consisting of a first dimension, a second dimension, a third dimension, and a fourth dimension.
  • the first dimension, the second dimension, the third dimension, and the fourth dimension of the weight 740 may be referred to as an output channel dimension, an input channel dimension, a height dimension, and a width dimension, respectively.
  • the data size of the weight 740 shown in FIG. 1B is proportional to co*ci*r*s.
  • the first scale sc_w1 and the second scale sc_w2 are values that can be set independently of each other.
  • the first scale sc_w1 may be proportional to the decimal number 1, for example, and the second scale sc_w2 may be proportional to the decimal number 128, for example.
  • FIGS. 1C and 1D are additional examples provided to further explain the concepts explained in FIGS. 1A and 1B.
  • Figure 1c shows an example in which the input activation 710 consists of six input channels 711 to 716.
  • Figure 1d shows an example in which the weight 740 consists of two output channels (741 and 742), and each output channel consists of six input channels (ex: 7411 to 7416).
  • 2A to 2C are conceptual diagrams illustrating a convolution operation between the input activation 710 and the weight 740.
  • the circular symbol surrounding the letter 'x' represents a first mathematical operation object placed to the left of the symbol and a second mathematical operation object disposed to the right of the symbol. It is a symbol representing the convolution operation between
  • output activation 750 can be generated by performing a convolution operation on the input activation 710 and the weight 740.
  • Output activation may be referred to herein as output data.
  • the output activation 750 may be a three-dimensional array consisting of a first dimension, a second dimension, and a third dimension.
  • the first dimension, the second dimension, and the third dimension of the output activation 750 may be referred to as an output channel dimension, a height dimension, and a width dimension, respectively.
  • the data size of the output activation 750 shown in FIGS. 2A to 2C is proportional to co*ho*wo.
  • Figure 3A shows the main structure of some of the computing devices used in one embodiment of the present invention.
  • the computing device 1 includes a dynamic random access memory (DRAM) 130, a hardware accelerator 110, a bus 700 connecting the DRAM 130 and the hardware accelerator 110, and other devices connected to the bus 700. It may include hardware 99 and a main processor 160.
  • DRAM 130 may be referred to as memory 130.
  • the computing device 1 may further include a power supply unit, a communication unit, a user interface, a storage unit 170, and peripheral device units not shown.
  • the bus 700 may be shared by the hardware accelerator 110, other hardware 99, and the main processor 160.
  • the hardware accelerator 110 includes a DMA unit (Direct Memory Access part) 20, a control unit 40, an internal memory 30, an input buffer 650, a data operation unit 610, and an output buffer 640. can do.
  • DMA unit Direct Memory Access part
  • Some or all of the data temporarily stored in the internal memory 30 may be provided from the DRAM 130 through the bus 700. At this time, in order to move data stored in the DRAM 130 to the internal memory 30, the control unit 40 and the DMA unit 20 may control the internal memory 30 and the DRAM 130.
  • Data stored in the internal memory 30 may be provided to the data calculation unit 610 through the input buffer 650.
  • Output values generated by the operation of the data calculation unit 610 may be stored in the internal memory 30 through the output buffer 640.
  • the output values stored in the internal memory 30 may be written to the DRAM 130 under the control of the control unit 40 and the DMA unit 20.
  • the control unit 40 can collectively control the operations of the DMA unit 20, the internal memory 30, and the data operation unit 610.
  • the data calculation unit 610 may perform a first calculation function during a first time period and a second calculation function during a second time period.
  • one data operation unit 610 is shown within the hardware accelerator 110.
  • a plurality of data calculation units 610 shown in FIG. 3A may be provided in the hardware accelerator 110 to perform operations requested by the control unit 40 in parallel. there is.
  • the data calculation unit 610 may output the output data sequentially according to a given order over time, rather than all at once.
  • Figures 3b to 3e compare the size of the storage space for storing the mathematical calculation object for the convolution operation with the size of the mathematical calculation object.
  • the buffer may be part of the internal memory 30 shown in FIG. 3A.
  • a first storage space allocated for input activation 710 may be defined, and a second storage space allocated for weights may be defined.
  • the sizes of the first storage space and the second storage space may be limited.
  • the input activation 710 can be split for each input channel and, for example, only the input activation 711 and 712 can be stored and used in the first storage space.
  • the weight 740 is split for each input channel, for example, input activation 7411 and 7412 of the first output channel and input activation 7421 of the second output channel. 7422) can be stored and used in the second storage space.
  • the other one may also have to be split for each input channel.
  • Figure 4 shows the concept of splitting weights for each input channel for convolution operation.
  • FIG. 5 shows a method of calculating the output activation 750 shown in (b) of FIG. 2 using the split data.
  • the input activation 710 and the weight 740 are split for each input channel, so it can be assumed that the size of the buffer required for the convolution operation is sufficiently large.
  • the input activations (711 to 713) are expressed in the first scale
  • the weights (7411 to 7413) of the first output channel are expressed in the second scale
  • the weights (7421 to 7423) of the second output channel are expressed in the first scale. It may be expressed in 3 scale.
  • the first scale, the second scale, and the third scale may be values set independently of each other.
  • the output activation 751 of the first output channel and the output activation 752 of the second output channel may be expressed in scale.
  • the present invention seeks to provide a technology to reduce quantization errors that occur in the process of dividing data into two or more groups when calculating or processing data in a hardware accelerator.
  • a data calculation method may be provided, comprising: generating calculation data, wherein the output data of the first output channel and the output data of the second output channel are expressed in different scales.
  • output data of the kth output channel may also be referred to as ‘convolution data of the kth output channel.’
  • the second input data may be composed of a plurality of output channels including the first output channel and the second output channel.
  • the plurality of output channels may mean data constituting the plurality of output channels.
  • the step of generating the output data includes: a first step of preparing, by the computing device, a first set of first split data obtained by splitting the first input data for each input channel;
  • the computing device prepares a first set of second split data obtained by splitting the first output channel among the second input data for each input channel, and inputs the second output channel among the second input data.
  • the computing device generates output data of the first output channel by convolving the first split data of the first set with the first split data of the first set for each input channel, and
  • a third step of generating output data of the second output channel by convolving the second split data with the first split data of the first set for each input channel.
  • the 'first output channel among the second input data' refers to a portion of the second input data corresponding to the first output channel
  • the 'second output channel among the second input data' refers to the portion of the second input data corresponding to the first output channel. It may refer to another part of the second input data corresponding to the second output channel.
  • the computing device prepares the first set of second split data by expressing it at a first scale, and prepares the second set of second split data by expressing it at a second scale. May include steps.
  • the first split data of the first set is convolved with the second split data of the first set expressed in the first scale.
  • the first set of first split data may be convolved with the second set of second split data expressed in the second scale.
  • the average rate of change of the output of the input data input to the second calculation function with respect to the input of the second calculation function is the average of the output of the input data input to the first calculation function with respect to the input of the first calculation function.
  • the second scale may have a value smaller than the first scale.
  • the average rate of change of the output with respect to the input of the first operation function in a predetermined first section of the input data input to the first operation function is the rate of change in the second section of the input data input to the second operation function.
  • the first scale has a value smaller than the second scale, and the first section is based on the statistical value of the output data of the first output channel. is determined, and the second section can be determined based on the statistical value of the output data of the second output channel.
  • the average rate of change of the output with respect to the input of the first operation function in a predetermined first section of the input data input to the first operation function is the rate of change in the second section of the input data input to the second operation function.
  • the first scale may have a value smaller than the second scale.
  • the first section is a section including the average value of the output data of the first output channel and may be a section including data of a predetermined first ratio among the output data of the first output channel. For example, there are a total of 100 values constituting the output data of the first output channel, and each of the 100 values may have a predetermined value. At this time, the 'average value of output data values of the first output channel' is the average value of the 100 values. And if the first ratio is set to 80%, the 'data of the first ratio' may mean 80 data out of the 100 data.
  • the second section is a section including the average value of the output data of the second output channel and may be a section including data of a predetermined second ratio among the output data of the second output channel.
  • the first input data may be input activation input to a specific layer of the neural network
  • the second input data may be a weight or kernel input to the specific layer of the neural network.
  • the data calculation method includes: storing, by the computing device, the generated first calculation data and second calculation data in a volatile memory or a non-volatile memory; calculating, by the computing device, an output value of the neural network using the stored first calculation data and the second calculation data; and converting, by the computing device, a predetermined image stored in the computing device using the calculated output value of the neural network.
  • the data operation method is, before the step of generating the output data, the computing device determines the first scale of the input data required by the first operation function and the scale of the input data required by the second operation function. Further comprising: searching and obtaining from memory, wherein between the first step and the second step, the computing device generates a value representing the first set of second split data at the first scale. It may further include generating a value expressing the second split data of the second set at the second scale.
  • a hardware accelerator including volatile memory and a computing device including non-volatile memory may be provided.
  • the hardware accelerator reads first input data and second input data from at least one of the volatile memory and the non-volatile memory; generating output data including output data of a first output channel and output data of a second output channel from the first input data and the second input data; And generating first operation data by applying a first operation function to the output data of the first output channel, and generating second operation data by applying a second operation function to the output data of the second output channel. step; is supposed to be executed. And the output data of the first output channel and the output data of the second output channel are expressed in different scales.
  • the second input data may be composed of a plurality of output channels including the first output channel and the second output channel.
  • the step of generating the output data includes: preparing a first set of first split data obtained by splitting the first input data for each input channel; A first set of second split data obtained by splitting the first output channel among the second input data for each input channel is prepared, and a first set of second split data obtained by splitting the second output channel among the second input data for each input channel is prepared.
  • a second step of preparing a second set of second split data and convolving the first set of second split data with the first split data of the first set for each input channel to generate output data of the first output channel, and generating the second split data of the second set.
  • a third step of generating output data of the second output channel by convolving the first split data of the first set for each input channel.
  • the second step may include preparing the first set of second split data by expressing it at a first scale, and expressing the second split data of the second set at a second scale. there is.
  • the average rate of change of the output of the input data input to the second calculation function with respect to the input of the second calculation function is the average of the output of the input data input to the first calculation function with respect to the input of the first calculation function.
  • the second scale may have a value smaller than the first scale.
  • the first input data may be input activation input to a specific layer of the neural network
  • the second input data may be a weight or kernel input to the specific layer of the neural network.
  • the first scale may be larger than the second scale.
  • the number of bits representing the output data of the first output channel may be the same as the number of bits representing the output data of the second output channel.
  • Figure 1a shows the configuration of input activation, one of the objects of mathematical operations according to the present invention.
  • Figure 1b shows the configuration of weights, another object of mathematical operations according to the present invention.
  • Figure 1c shows an example in which input activation consists of six input channels.
  • Figure 1d shows an example in which the weight consists of two output channels, and each output channel consists of six input channels.
  • 2A to 2C are conceptual diagrams illustrating a convolution operation between the input activation and the weight.
  • Figure 3A shows the main structure of some of the computing devices used in an embodiment of the present invention
  • Figures 3B to 3E show the size of the storage space for storing the mathematical operation object for the convolution operation and the mathematical calculation object's size. This is a size comparison.
  • Figure 4 shows the concept of splitting weights for each input channel for convolution operation.
  • FIG. 5 shows a method of calculating the output activation shown in (b) of FIG. 2 using the split data.
  • Figure 6a shows an example of a subsequent calculation process using the output activation described in Figure 5.
  • FIG 6b expands the concept presented in Figure 6a.
  • Figures 7a and 7b show a structure in which different operation functions are applied to each output channel of output activation output by a specific layer of a neural network, according to an embodiment of the present invention.
  • FIGS. 8A and 8B are intended to explain another reason why output activation of different output channels should be expressed in different scales.
  • FIGS. 8C, 8D, and 8E are intended to explain another reason why output activation of different output channels should be expressed in different scales, respectively.
  • Figure 9a is a flowchart showing a method of calculating input activation according to an embodiment of the present invention.
  • Figure 9b is a flowchart showing a method of generating convolution data for each output channel according to an embodiment of the present invention.
  • Figures 10a and 10b show the derivatives of the Sigmoid function and the Exponent function, which are different operation functions provided as examples in the present invention.
  • Figure 11 is a flowchart showing a method of calculating input activation according to another embodiment of the present invention.
  • Figure 12 is a flowchart showing a data operation method provided according to an embodiment of the present invention.
  • Figure 6a shows an example of a subsequent calculation process using the output activation described in Figure 5.
  • the output activation 750 may be composed of an output activation 751 of the first output channel and an output activation 752 of the second output channel.
  • control unit 40 stores the generated output activation 750 in internal memory (SRAM) or external memory (DRAM), and then reads the output activation 750 again when necessary. Subsequent calculations can be performed using this.
  • SRAM internal memory
  • DRAM external memory
  • control unit 40 stores the output activation 751 of the first output channel and the output activation 752 of the second output channel in internal memory (SRAM) or external memory (DRAM). , After that, when necessary, the output activation 751 of the first output channel and the output activation 752 of the second output channel can be read again and a subsequent operation using them can be performed.
  • SRAM internal memory
  • DRAM external memory
  • the subsequent calculation can be performed independently for each of the two output channels, and different calculations can be performed for different output channels.
  • the output activation 751 of the first output channel may be calculated using the first operation function provided by the first operation unit 210, and the output activation 752 of the second output channel may be performed using the second operation function. Calculation may be performed using the second calculation function provided by the calculation unit 220.
  • first operation data 761 can be generated
  • second operation data 762 may be generated.
  • Figure 6b shows a method of calculating output activation according to a preferred embodiment of the present invention, and is an expanded illustration of the concept of the present invention presented in Figure 6a.
  • the output activation 750 may be composed of a plurality of output channels (ex: 5) (ex: 751 to 755).
  • the output activation 750 may be composed of output activations of the first output channel to output activations of the fifth output channel (751, 752, 753, 754, 755).
  • the first operation unit 210 provides An operation may be performed using one operation function, and the output activations 754 to 755 of the second group of output channels may be operated using a second operation function provided by the second operation unit 220.
  • the first group and the second group may each be composed of output activations of one or more output channels.
  • the output activations (ex: 751 to 755) of the plurality of output channels may first be merged into the final output activation (750). Then, at a necessary point, the output activation 750 will be divided into output activations (ex: 751 to 753) of the output channels of the first group and output activations (ex: 754 to 755) of the output channels of the second group. You can.
  • the operation data (761 to 763) of the first group can be generated, and the operation data (761 to 763) of the first group of output channels can be generated.
  • a second group of operation data 764 to 765 can be generated.
  • Figure 6c shows a method of calculating output activation according to a preferred embodiment of the present invention, and is a modified version of the concept presented in Figure 6b.
  • the process of merging the output activations (ex: 751 to 755) of the plurality of output channels into the final output activation (750) may not be performed. Instead, the calculated output activations (ex: 751 to 753) of the output channels of the first group are directly input to the first operation unit 210, and the calculated output activations of the output channels of the second group (ex: 754 to 755) can be directly input into the second operation unit 220.
  • the output activations (ex: 751 to 753) of the first group of output channels may be first stored in volatile or non-volatile memory. Next, the output activations (ex: 751 to 753) of the output channels of the first group output from the memory may be input to the first operation unit 210.
  • the output activations of the second group of output channels may be first stored in volatile or non-volatile memory.
  • the output activations (ex: 754 to 755) of the output channels of the second group output from the memory may be input to the first operation unit 210.
  • a first group of output channels consisting of one or more output channels is input to a specific operation unit, and one or more output channels other than the output channels are input to a specific operation unit.
  • the second group of output channels consisting of can be input to another calculation unit.
  • the first calculation function provided by the first calculation unit 210 may be a Sigmoid calculation function.
  • the second operation function provided by the second operation unit 220 may be an Exponent operation function.
  • the amount of change in output data relative to the amount of change in input data ( ⁇ i), which is the amount of change in input data can be expressed as ⁇ o1.
  • the amount of change in output data relative to the amount of change in input data ( ⁇ i), which is the amount of change in input data can be expressed as ⁇ o2.
  • the output value of the Exponent calculation function is more sensitive to the amount of change in the input than the Sigmoid calculation function. That is, the output value of the first operation function may be more sensitive to the amount of change in the input than the second operation function.
  • the value of input data input to a specific operation function may include a quantization error that exists depending on the scale of the input data.
  • the quantization error of the input data is propagated to the output data output by the specific operation function.
  • the quantization error input to the given arithmetic function may be further amplified and output.
  • the Exponent operation function can amplify the quantization error of the input data to a greater extent than the Sigmoid operation function.
  • the quantization error of the output activation 752 of the second output channel processed with the Exponent operation function is amplified to a greater extent than the quantization error of the output activation 751 of the first output channel processed with the Sigmoid operation function. If the quantization error of data is amplified to different sizes for each output channel and then transmitted, there is a problem that serious data errors may occur.
  • the scale represents the input data, which is the data input to each calculation function, required for each calculation function.
  • the scale of input data required for a specific operation function may be determined as a specific value or a value within a certain range.
  • information that the scale of the input data required by the first operation function is the first value and the scale of the input data required by the second operation function is the second value can be stored in advance. By comparing the first value and the second value, it can be confirmed which of the first value and the second value is larger.
  • the calculation process of the output activation 752 of the second output channel and the calculation process of the output activation 752 of the second output channel can be controlled so that the second scale is smaller than the first scale.
  • the first scale and the second scale can be designed to be the same very small value, without considering the relative difference between the first scale and the second scale. You can. However, assuming that the computing power and memory of the computing device 1 are not large enough, it is desirable to define the first scale and the second scale as different values.
  • FIGS. 8A and 8B are intended to explain another reason why output activation of different output channels should be expressed in different scales.
  • Figure 8a shows a situation where the output activation 751 of the first output channel is input to the first operation function provided by the first operation unit 210, for example, the Sigmoid function.
  • the value of each element of the output activation 751 of the first output channel can be represented by the letter i.
  • the case where each element of the output activation 751 of the first output channel is expressed at the first scale (S1) and the case where it is expressed at the second scale (S2) are shown in the middle and bottom of FIG. 8A, respectively. ) is presented in.
  • the first scale is larger than the second scale.
  • each element of the output activation 751 of the first output channel is expressed in 4 bits, so that a total of 16 values can be expressed.
  • the 16 dotted lines shown in each graph of FIG. 8A represent the 16 values.
  • the values output by the Sigmoid function are virtually the same, and when input values less than a predetermined negative second value are input to the Sigmoid function.
  • the values output by the Sigmoid function are virtually identical. Therefore, the input value input to the Sigmoid function, that is, each element of the output activation 751 of the first output channel needs to express a value greater than the predetermined positive first value and a value less than the predetermined negative second value. There is no Therefore, there is no need to express the output activation 751 of the first output channel in the first scale S1.
  • the output activation 751 of the first output channel can be expressed as a second scale (S2) smaller than the first scale (S1).
  • S2 second scale
  • S1 the first scale
  • Figure 8b shows a situation where the output activation 754 of the fourth output channel is input to a second operation function provided by the second operation unit 220, for example, the Exponent function.
  • each element of the output activation 754 of the fourth output channel is expressed in the first scale (S1) and the second scale (S2) in the middle and bottom of FIG. 8B, respectively. ) is presented in.
  • the first scale is larger than the second scale.
  • each element of the output activation 754 of the fourth output channel is expressed in 4 bits, so that a total of 16 values can be expressed.
  • the 16 dotted lines shown in each graph of FIG. 8B represent the 16 values.
  • the output activation 754 of the fourth output channel is divided into the first scale and the second scale. No matter which scale is expressed, there is no particularly advantageous effect.
  • the value of the scale representing the output activation 754 of the fourth output channel can be optimized according to the range of values of the output activation 754 of the fourth output channel. However, this optimization is only due to the range of values of the output activation 754 of the fourth output channel and not the operation function into which the output activation 754 of the fourth output channel is input.
  • the region of interest of the input data that significantly changes the output value of the Sigmoid function may be limited to R0.
  • the region of interest of the input data that significantly changes the output value of the Exponent function is not limited to R0, but can be determined as R1, R2, and other regions.
  • the smaller the region of interest of the input data that causes a significant change in the output value of a specific calculation function the more advantageous it may be to set the scale representing the input data to a smaller value.
  • the output activation input to the Exponent function it is desirable for the output activation input to the Exponent function to have a smaller scale than the output activation input to the Sigmoid function.
  • the output activation input to the Sigmoid function it is desirable that the output activation input to the Sigmoid function have a smaller scale than the output activation input to the Exponent function.
  • the size of the scale determined according to the two different perspectives may be contradictory. That is, in any given situation, whether to set the scale of the output activation input to the first operation function to a larger value or a smaller value than the scale of the output activation input to the second operation function depends on the bits of data representing the output activations. The numbers and output activations may vary depending on the statistical characteristics of their values.
  • Figure 8c is intended to explain another reason why output activation of different output channels should be expressed in different scales.
  • FIG. 8C shows a situation where the output activation 751 of the first output channel is input to the first operation function f1(i) provided by the first operation unit 210
  • the bottom part of FIG. 8C (bottom) shows a situation where the output activation 754 of the second output channel is input to the second operation function f2(i) provided by the second operation unit 220.
  • the first operation function is a function that not only saturates for negative input values, but also saturates for positive input values. That is, the first operation function may be a function that saturates in both directions.
  • the second operation function is a function that not only saturates for negative input values, but also saturates for positive input values. That is, the second operation function may be a function that saturates in both directions.
  • the saturation value for negative input may be expressed as o sl
  • the saturation value for positive input may be expressed as o sr
  • the input value at which negative saturation, i.e., left-side saturation, begins can be expressed as i sl
  • the input value at which positive saturation, i.e., right-side saturation, begins can be expressed as i sr
  • the input value i sl may be the largest value among the input values that provide an output value with a predetermined difference from the saturation value o sl
  • the input value i sr may be the output value with a predetermined difference from the saturation value o sr . It may be the smallest value among the provided input values.
  • the input section between the input value i sl and the input value i sr may be referred to as a non-saturated section, and the other sections may be referred to as a saturated section.
  • the non-saturated section the change in output in response to the change in input is above a certain level, but in the saturated section, the change in output in response to the change in input is very small. Therefore, it can be understood that even if the values belonging to the saturation range among the input values input to the calculation function (first calculation function or second calculation function) are not accurately expressed, the influence reflected on the output of the calculation function can be ignored. there is.
  • the difference between the input value i sl and the input value i sr can be defined as the size of the unsaturated section (L ns ).
  • the size (L ns_f1 ) of the unsaturated section for the first operation function f1 is larger than the size (L ns_f2 ) of the unsaturated section for the second operation function f2.
  • each element of the output activation 751 of the first output channel is expressed in a first scale (S1)
  • each element of the output activation 754 of the second output channel is expressed in a second scale (S1). It can be expressed as S2).
  • the first scale is the first scale. It is understandable that it is advantageous to decide larger than 2 scale. This is particularly useful when the number of bits representing each element of the output activation 751 of the first output channel and each element of the output activation 754 of the second output channel are the same.
  • Figure 8d is intended to explain another reason why output activation of different output channels should be expressed in different scales.
  • FIG. 8D shows a situation where the output activation 751 of the first output channel is input to the first operation function f1(i) provided by the first operation unit 210
  • the bottom part of FIG. 8D shows a situation where the output activation 754 of the second output channel is input to the second operation function f2(i) provided by the second operation unit 220.
  • the second operation function is a function that not only saturates for negative input values, but also saturates for positive input values. That is, the second operation function may be a function that saturates in both directions.
  • the first operation function is a function that saturates for negative input values but does not saturate for positive input values. That is, the first operation function may be a function that saturates only in one direction.
  • the saturation value o sl for negative input the saturation value o sr for positive input
  • the input value i sl where left saturation starts the saturation value o sr for positive input
  • the input value i sl where left saturation starts the saturation value o sr for positive input
  • the input value i sl where left saturation starts the saturation value o sr for positive input
  • the input value i sl where left saturation starts the right saturation You can define i sr as the input value from which .
  • the saturation value o sl for negative input and the input value i sl where left saturation begins are defined, but the saturation value o sr for positive input and the input value i s where right saturation begins is not defined.
  • the size (L ns_f1 ) of the non-saturated section for the first operation function f1 is infinite. Therefore, in the example shown in FIG. 8D, the size (L ns_f2 ) of the unsaturated section for the second operation function f2 is smaller than the size (L ns_f1 ) of the unsaturated section for the first operation function f1.
  • each element of the output activation 751 of the first output channel is expressed in a first scale (S1)
  • each element of the output activation 754 of the second output channel is expressed in a second scale (S1). It can be expressed as S2).
  • the first scale is the first scale. It is understandable that it is advantageous to decide larger than 2 scale. This is particularly useful when the number of bits representing each element of the output activation 751 of the first output channel and each element of the output activation 754 of the second output channel are the same.
  • Figure 8e is intended to explain another reason why output activation of different output channels should be expressed in different scales.
  • FIG. 8E shows a situation where the output activation 751 of the first output channel is input to the first operation function f1(i) provided by the first operation unit 210
  • the bottom part of FIG. 8E (bottom) shows a situation where the output activation 754 of the second output channel is input to the second operation function f2(i) provided by the second operation unit 220.
  • the second operation function is a function that not only saturates for negative input values, but also saturates for positive input values. That is, the second operation function may be a function that saturates in both directions.
  • the first operation function is a function that does not saturate even for negative input values and does not saturate for positive input values.
  • the saturation value o sl for negative input the saturation value o sr for positive input
  • the input value i sl where left saturation starts the saturation value o sr for positive input
  • the input value i sl where left saturation starts the saturation value o sr for positive input
  • the input value i sl where left saturation starts the saturation value o sr for positive input
  • the input value i sl where left saturation starts the right saturation You can define i sr as the input value from which .
  • the saturation value o sl for negative input the saturation value o sr for positive input
  • the input value i sl where left saturation starts the input value i sr where right saturation starts undefined
  • the size (L ns_f1 ) of the non-saturated section for the first operation function f1 is infinite. Therefore, in the example shown in FIG. 8E, the size (L ns_f2 ) of the unsaturated section for the second operation function f2 is smaller than the size (L ns_f1 ) of the unsaturated section for the first operation function f1.
  • each element of the output activation 751 of the first output channel is expressed in a first scale (S1)
  • each element of the output activation 754 of the second output channel is expressed in a second scale (S1). It can be expressed as S2).
  • the first scale is the first scale. It is understandable that it is advantageous to decide larger than 2 scale. This is particularly useful when the number of bits representing each element of the output activation 751 of the first output channel and each element of the output activation 754 of the second output channel are the same.
  • Figure 9a is a flowchart showing a method of calculating input activation according to an embodiment of the present invention.
  • a method of calculating input activation according to an embodiment of the present invention may include the following steps.
  • a first set of first split data obtained by splitting the first input data for each input channel may be prepared.
  • the first input data may mean input activation input to a specific layer of the neural network.
  • step S121 a first set of second split data obtained by splitting the first output channel among the second input data consisting of a plurality of output channels for each input channel may be prepared.
  • the second input data may be a kernel or weight used in the specific layer.
  • step S122 a second set of second split data obtained by splitting the second output channel among the second input data (kernel or weight) for each input channel may be prepared.
  • step S131 the first split data of the first set and the second split data of the first set may be convolved for each input channel to generate convolution data of the first output channel.
  • the convolution data of the first output channel may mean the output activation of the first output channel among the output activations output by the layer.
  • step S132 the first split data of the first set and the second split data of the second set may be convolved for each input channel to generate convolution data of the second output channel.
  • the convolution data of the second output channel may mean the output activation of the second output channel among the output activations output by the layer.
  • first operation data may be generated by applying a first operation function to the convolution data of the first output channel.
  • second operation data may be generated by applying a second operation function to the convolution data of the second output channel.
  • the convolution data of the first output channel and the convolution data of the second output channel may constitute output activation output by the layer.
  • the output activation may include convolution data of an output channel other than the first output channel and the second output channel.
  • Steps S121 and S122 may be processed in parallel.
  • Steps S131 and S132 may be processed in parallel.
  • Steps S141 and S142 may be processed in parallel.
  • Figure 9b is a flowchart showing a method of generating convolution data for each output channel.
  • the first calculation function and the second calculation function are different calculation functions, and the first scale and the second scale may be different values.
  • the first scale may be larger than the second scale.
  • the first scale may be smaller than the second scale.
  • the size of the scale required for input data input to a specific calculation function may have the following characteristics.
  • a derived function (derivatives) of the first operation function can be defined for the first section of the first input data. Additionally, it is assumed that the derivative of the second operation function can be defined for the second section of the second input data.
  • Figure 7a shows the Sigmoid function and its derivative
  • Figure 7b shows the Exponent function and its derivative
  • Figure 10a also shows the derivative of the Sigmoid
  • Figure 10b also shows the derivative of the Exponent function.
  • the first section may refer to a section in which most values of the first input data are concentrated
  • the second section may refer to a section in which most values of the second input data are concentrated.
  • Figure 10a illustrates the distribution of the first input data.
  • the section where most values of the first input data are concentrated is [a1 to a3].
  • the first input data consists of a total of 1000 values, and x1% (ex: 90%) of these exist in the interval [a1 to a3]
  • the first interval may be the interval [a1 to a3]. .
  • Figure 10b illustrates the distribution of the second input data.
  • the section where most values of the second input data are concentrated is [-a1 to a3].
  • the second input data consists of a total of 1000 values, and x2% (ex: 90%) of these exist in the interval [-a1 to a3]
  • the second interval is the interval [-a1 to a3]. You can.
  • the first section and the second section may be predetermined sections regardless of statistics of the first input data and the second input data.
  • the integral value of the absolute value of the value of the first derivative in the first section can be defined as the first integral value (see the hatched portion in FIG. 10A), and the integral value of the absolute value of the value of the first derivative in the first section can be defined as the first integral value (see hatched portion in FIG. 10A), and the integral value of the absolute value of the value of the first derivative in the first section can be defined as the first integral value
  • the integral value of the absolute value of the value can be defined as the second integral value (see hatched portion in FIG. 10b).
  • the size of the second scale required for the input data input to the second operation function is required for the input data input to the first operation function. It can be determined to be a value smaller than the size of the first scale.
  • the average value of the change rate of the output with respect to the input of the first operation function in the first section is the first integral value. This may mean that it is greater than the average value of the change rate of the output with respect to the input of the second operation function in the second section. That is, the error amplification rate between the input and output of the second operation function in the second section, which is the section of interest among the second input data, is greater than the error amplification rate of the first operation in the first section, which is the section of interest among the first input data. This may mean that the error amplification rate between the input and output of the function is greater.
  • the size of the first scale required for the input data input to the first operation function is required for the input data input to the second operation function. It can be determined as a value smaller than the size of the second scale.
  • Figure 11 is a flowchart showing a method of calculating input activation according to another embodiment of the present invention.
  • step S200 a first scale, which is the scale of the input data required by the first operation function, and a second scale, which is the scale of the input data required by the second operation function, may be obtained.
  • a first set of first split data obtained by splitting the first input data for each input channel may be prepared.
  • the first input data may mean input activation input to a specific layer of the neural network.
  • step S220 a first set of second split data obtained by splitting the first output channel for each input channel among the second input data consisting of a plurality of output channels is prepared, and the second split data of the second input data is prepared.
  • a second set of second split data obtained by splitting the output channels for each input channel can be prepared.
  • the second input data may be a kernel or weight used in the specific layer.
  • step S230 a value expressing the second split data of the first set at a first scale may be generated, and a value expressing the second split data of the second set at a second scale may be generated.
  • step 240 the first set of second split data expressed in the first scale is convolved with the first set of first split data for each input channel to generate convolution data of the first output channel.
  • the second split data of the second set expressed in the second scale may be convolved with the first split data of the first set for each input channel to generate convolution data of the second output channel.
  • step S250 first operation data is generated by applying a first operation function to the convolution data of the first output channel, and a second operation function is applied to the convolution data of the second output channel. Second operation data can be generated.
  • the convolution data of the first output channel and the convolution data of the second output channel may constitute output activation output by the layer.
  • the output activation may include convolution data of an output channel other than the first output channel and the second output channel.
  • the first calculation function, the second calculation function, the first scale, and the second scale may have the following characteristics.
  • the integral value of the absolute value of the first derivative which is the derivative of the first operation function
  • the integral value of the absolute value of the second derivative which is the derivative of the second operation function
  • the input input to the second operation function is used to smooth the level of quantization error of the output values of the first operation function and the second operation function.
  • the size of the second scale required for the data may be determined to be smaller than the size of the first scale required for the input data input to the first operation function.
  • the The size of the first scale required for the input data may be determined to be smaller than the size of the second scale required for the input data input to the second operation function.
  • Figure 12 is a flowchart showing a data operation method provided according to an embodiment of the present invention.
  • the data operation method provided according to an embodiment of the present invention may be an image conversion method.
  • the image conversion method may include the following steps.
  • the computing device may generate output data including output data of the first output channel and output data of the second output channel from the first input data and the second input data.
  • step S320 the computing device generates first operation data by applying a first operation function to the output data of the first output channel, and applies a second operation function to the output data of the second output channel.
  • the second operation data can be generated by applying .
  • the output data of the first output channel and the output data of the second output channel may be expressed in different scales.
  • the first input data may be input activation input to a specific layer of the neural network
  • the second input data may be a weight or kernel input to the specific layer of the neural network.
  • the computing device may store the generated first and second calculation data in volatile memory or non-volatile memory.
  • the computing device may calculate an output value of the neural network using the stored first calculation data and the second calculation data.
  • the computing device may convert a predetermined image stored in the computing device using the calculated output value of the neural network.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computational Linguistics (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Neurology (AREA)
  • Algebra (AREA)
  • Databases & Information Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Medical Informatics (AREA)
  • Complex Calculations (AREA)

Abstract

입력 액티베이션을 입력채널 별로 스플릿 하여 얻은 제1세트의 제1스플릿 데이터를 준비하는 단계, 가중치 중 제1출력채널 및 제2출력채널을 각각 입력채널 별로 스플릿 하여 얻은 제1세트의 제2스플릿 데이터 및 제2세트의 제2스플릿 데이터를 준비하는 단계, 상기 제1세트의 제2스플릿 데이터 및 상기 제2세트의 제2스플릿 데이터를 각각 제1스케일 및 제2스케일로 표현한 값을 생성하는 단계, 상기 제1스케일로 표현된 상기 제1세트의 제2스플릿 데이터를 상기 제1세트의 제1스플릿 데이터와 입력채널 별로 콘볼루션 하여 제1출력채널의 콘볼루션 데이터를 생성하고, 상기 제2스케일로 표현된 상기 제2세트의 제2스플릿 데이터를 상기 제1세트의 제1스플릿 데이터와 입력채널 별로 콘볼루션 하여 제2출력채널의 콘볼루션 데이터를 생성하는 단계, 및 상기 제1출력채널의 콘볼루션 데이터에 대하여 제1연산함수를 적용하여 제1연산데이터를 생성하고 상기 제2출력채널의 콘볼루션 데이터에 대하여 제2연산함수를 적용하여 제2연산데이터를 생성하는 단계를 포함하는, 데이터 연산방법이 공개된다.

Description

데이터 스케일을 고려한 콘볼루션 데이터의 양자화 방법, 이를 위한 하드웨어 가속기, 및 이를 이용한 컴퓨팅 장치
본 발명은 컴퓨팅 장치에서 연산을 수행하는 기술에 관한 것으로서, 숫자(number)의 스케일을 고려한 덧셈 연산 기술에 관한 것이며, 특히 예정되어 있는 후속 연산의 특성에 따라 콘볼루션 데이터를 양자화 하는 기술에 관한 것이다.
신경망 등 인공지능의 구현을 위해 이용되는 신호처리기술은 소프트웨어로 구현되거나 또는 빠른 처리를 위해 하드웨어 가속기로서 구현될 수 있다. 머신러닝을 위해 이용되는 신경망에서는 각종 연산을 수행하는 레이어들이 다수 존재하며, 각 레이어 에서는 많은 데이터들이 연산될 수 있다. 이러한 데이터 연산이 하드웨어 가속기에 의해 이루어지는 경우, 하드웨어 가속기 내부에 제공되는 내부 메모리 또는 내부 버퍼의 크기가 제한된다는 환경 때문에 문제가 발생할 수 있다. 즉, 연산의 대상이 되는 한 세트의 데이터의 크기가 내부 메모리 또는 내부 버퍼의 크기보다 작다면, 한 세트의 데이터를 2개의 서브세트로 나누어 각각 따로 계산하여 서브 결과 값들을 산출한 다음, 그 서브 결과 값들을 다시 결합하는 과정을 거쳐야 한다. 이때, 상기 서브 결과 값들이 내부 메모리 또는 내부 버퍼에 저장되었다가 다시 읽히는 과정을 거치는데, 이 과정에서 원하지 않는 데이터의 양자화 오차가 발생할 수 있다는 문제가 있다. 이러한 양자화 오차는 한 세트의 데이터를 2개의 서브세트로 나누어 따로 계산하지 않았더라면 발생하지 않는 오차일 수 있다.
신경망 기술에서 데이터의 양자화에 관련된 선행기술로는 대한민국 특허출원번호 1020217011986, 1020200110330, 1020170150707, 1020200082108, 및 1020207038081 등이 있다.
이하, 도 1 내지 도 5를 이용하여 본 발명의 이해를 위해 알아두어야 할 기술 내용을 간단히 설명한다. 이 내용들은 본 발명의 발명자가 알고 있는 사전지식으로서, 이 중 적어도 일부는 본 특허출원 시에 불특정인에게 공개되지 않은 내용일 수 있다.
본 발명은 컴퓨팅 장치가 사용하는 숫자 또는 데이터의 스케일이라는 개념을 이용한다. 컴퓨팅 장치는 이진수(binary number)를 이용한 N비트 숫자(N-bit number)의 형태로 숫자를 표현한다. 이때 상기 N비트 숫자는 MSB(Most Significant Bit) 및 LSB(Least Significant Bit)를 포함한다. 여기서 상기 N비트 숫자의 스케일은 상기 N비트 숫자의 LSB가 표현하는 수의 크기로 정의될 수 있다. 즉, 상기 N비트 숫자가 표현할 수 있는 0(영)이 아닌 최소 절대 값에 의해 정의될 수 있다. 상기 스케일이라는 개념의 이해를 돕기 위해, 예컨대 각각 2비트로 표현되는 두 개의 수인 '128' 및 '1'이라는 십진수들을 고려해 볼 수 있다. 여기서 상기 십진수 '128'은 이진수 표기법에 따라 '01'로 표현되고 상기 십진수 '1'은 이진수 표기법에 따라 '01'로 표현될 수 있다. 이때, 상기 십진수 '128'을 나타내는 2비트 숫자의 스케일인 제1스케일은 십진수 128에 비례하는 값이고, 상기 십진수 '1'을 나타내는 2비트 숫자의 스케일인 제2스케일은 십진수 1에 비례하는 값이다. 즉, 상기 제1스케일은 상기 제2스케일에 비하여 128배 만큼 크다.
도 1a는 본 발명에 따른 수학연산의 대상(object for mathematical operation) 중 하나인 입력 액티베이션(710)의 구성을 나타낸 것이다. 본 명세서에서 입력 액티베이션은 제1입력 데이터로 지칭될 수도 있다.
상기 입력 액티베이션(710)은 제1차원(a first dimension), 제2차원, 및 제3차원으로 이루어진 3차원 어레이일 수 있다. 상기 입력 액티베이션(710)의 상기 제1차원, 상기 제2차원, 및 상기 제3차원은 각각 입력채널 차원, 높이 차원, 및 폭 차원으로 지칭될 수 있다. 도 1a에 제시한 상기 입력 액티베이션(710)은 제1차원의 크기 ci, 제2차원의 크기 h, 및 제3차원의 크기 w가 각각 3, 2, 및 4인 예이다(ci=3, h=2, w=4). 도 1a에 제시한 상기 입력 액티베이션(710)의 데이터 크기는 ci*h*w에 비례한다.
본 명세서에서 상기 입력 액티베이션(710) 중 상기 입력채널의 인덱스가 k인 부분은 '입력 액티베이션[ci]=k'라고 표현할 수 있다. 도 1a에서 입력 액티베이션[ci]=1은 참조번호 711로 나타내고, 입력 액티베이션[ci]=2은 참조번호 712로 나타내고, 그리고 입력 액티베이션[ci]=3은 참조번호 713으로 나타낸다.
상기 입력 액티베이션[ci]=1(711), 상기 입력 액티베이션[ci]=2(712), 및 상기 입력 액티베이션[ci]=3(713)의 스케일은 서로 동일할 수 있다. 즉, 상기 입력 액티베이션(710)을 구성하는 모든 숫자들의 스케일은 서로 동일하며, 상기 스케일은 'sc_ai1'으로 표현될 수 있다. sc_ai1은 예컨대 십진수 1일 수도 있고, 또는 예컨대 십진수 128일 수도 있고, 또는 다른 값일 수 있다.
도 1b는 본 발명에 따른 수학연산의 대상 중 다른 하나인 가중치(740)의 구성을 나타낸 것이다.
본 명세서에서 상기 가중치(740)는 제2입력 데이터로 지칭될 수도 있다.
상기 가중치(740)는 제1차원(a first dimension), 제2차원, 제3차원, 및 제4차원으로 이루어진 4차원 어레이일 수 있다. 상기 가중치(740)의 상기 제1차원, 상기 제2차원, 상기 제3차원, 및 상기 제4차원은 각각 출력채널 차원, 입력채널 차원, 높이 차원, 및 폭 차원으로 지칭될 수 있다. 도 1b에 제시한 상기 가중치(740)는 제1차원의 크기 co, 제2차원의 크기 ci, 제3차원의 크기 r, 및 제4차원의 크기 s가 각각 2, 3, 2, 및 2인 예이다(co=2, ci=3, r=2, s=2). 도 1b에 제시한 상기 가중치(740)의 데이터 크기는 co*ci*r*s에 비례한다.
본 명세서에서 상기 가중치(740) 중 상기 출력채널의 인덱스가 k인 부분은 '가중치[co]=k'라고 표현할 수 있다. 도 1b에서 가중치[co]=1은 참조번호 741로 나타내고, 가중치[co]=2은 참조번호 742로 나타낸다.
상기 가중치[co]=1(741)를 구성하는 모든 숫자들의 스케일인 제1스케일은 서로 동일하며, 상기 제1스케일은 'sc_w1'으로 표현될 수 있다.
상기 가중치[co]=2(742)를 구성하는 모든 숫자들의 스케일인 제2스케일은 서로 동일하며, 상기 제2스케일은 'sc_w2'으로 표현될 수 있다.
상기 제1스케일 sc_w1과 상기 제2스케일 sc_w2는 서로 독립적으로 설정(set)될 수 있는 값이다.
*상기 제1스케일 sc_w1은 예컨대 십진수 1에 비례하고, 상기 제2스케일 sc_w2는 예컨대 십진수 128에 비례할 수 있다.
도 1c 및 도 1d는, 도 1a 및 도 1b에 설명한 개념을 부연설명하기 위해 추가적으로 제시한 예이다.
도 1c는 입력 액티베이션(710)이 6개의 입력채널들(711~716)로 이루어진 예를 나타낸 것이다.
도 1d는 가중치(740)가 2개의 출력채널들(741, 742)로 이루어지고, 각 출력채널은 6개의 입력채널(ex: 7411~7416)로 이루어진 예를 나타낸 것이다.
도 2a 내지 도 2c는 상기 입력 액티베이션(710)과 상기 가중치(740) 간의 콘볼루션 연산을 설명하는 개념도이다.
도 2a 내지 도 2c 및 본 명세서에 제시된 기호로서, 문자 'x'를 감싸고 있는 원형의 기호는, 상기 기호의 왼쪽에 배치된 제1수학연산 대상과 상기 기호의 오른쪽에 배치된 제2수학연산 대상 간의 콘볼루션 연산을 나타내는 기호이다.
도 2a에 제시된 것과 같이, 상기 입력 액티베이션(710)과 상기 가중치(740)에 관한 콘볼루션 연산을 수행하면 출력 액티베이션(750)이 생성될 수 있다. 본 명세서에서 출력 액티베이션은 출력 데이터로 지칭될 수도 있다.
상기 출력 액티베이션(750)은 제1차원, 제2차원, 및 제3차원으로 이루어진 3차원 어레이일 수 있다. 상기 출력 액티베이션(750)의 상기 제1차원, 상기 제2차원, 및 상기 제3차원은 각각 출력채널 차원, 높이 차원, 및 폭 차원으로 지칭될 수 있다. 도 2a 내지 도 2c에 제시한 상기 출력 액티베이션(750)은 제1차원의 크기 co, 제2차원의 크기 ho, 및 제3차원의 크기 wo가 각각 2, 2, 및 3인 예이다(c0=2, ho=2, wo=3). 도 2a 내지 도 2c에 제시한 상기 출력 액티베이션(750)의 데이터 크기는 co*ho*wo에 비례한다.
본 명세서에서 상기 출력 액티베이션(750) 중 상기 출력채널의 인덱스가 k인 부분은 '출력 액티베이션[co]=k'라고 표현할 수 있다. 도 2a 내지 도 2c에서 출력 액티베이션[co]=1은 참조번호 751로 나타내고, 출력 액티베이션[co]=2은 참조번호 752로 나타낸다.
도 2b는 제1출력 액티베이션인 상기 출력 액티베이션[co]=1(751)을 생성하는 방법을 나타낸 것이다. 상기 출력 액티베이션[co]=1(751)은 상기 입력 액티베이션(710)과 제1출력에 대응하는 상기 가중치[co]=1(741)에 대한 콘볼루션 연산에 의해 생성된다.
도 2c는 제2출력 액티베이션인 상기 출력 액티베이션[co]=2(752)를 생성하는 방법을 나타낸 것이다. 상기 출력 액티베이션[co]=2(752)은 상기 입력 액티베이션(710)과 제2출력에 대응하는 상기 가중치[co]=2(742)에 대한 콘볼루션 연산에 의해 생성된다.
도 3a는 본 발명의 일 실시예에서 이용되는 컴퓨팅 장치 중 일부의 주요 구조를 나타낸 것이다.
컴퓨팅 장치(1)는, DRAM(Dynamic Random Access Memory)(130), 하드웨어 가속기(110), DRAM(130)와 하드웨어 가속기(110)를 연결하는 버스(700), 및 버스(700)에 연결된 타 하드웨어들(99) 및 메인 프로세서(160)를 포함할 수 있다. 여기서 DRAM(130)은 메모리(130)로 지칭될 수 있다.
그 밖에 컴퓨팅 장치(1)는 도시되지 않은 전원부, 통신부, 사용자 인터페이스, 저장부(170), 및 주변 장치부들을 더 포함할 수 있다. 버스(700)는 상기 하드웨어 가속기(110)와 타 하드웨어들(99), 그리고 메인 프로세서(160)가 공유할 수도 있다.
상기 하드웨어 가속기(110)는 DMA부(Direct Memory Access part)(20), 제어부(40), 내부 메모리(30), 입력버퍼(650), 데이터 연산부(610), 및 출력버퍼(640)를 포함할 수 있다.
내부 메모리(30)에 임시 저장되는 데이터의 일부 또는 전부는 버스(700)를 통해 DRAM(130)으로부터 제공될 수 있다. 이때, DRAM(130)에 저장되어 있는 데이터를 내부 메모리(30)로 이동시키기 위하여, 제어부(40)와 DMA부(20)가 내부 메모리(30) 및 DRAM(130)을 제어할 수도 있다.
내부 메모리(30)에 저장되어 있던 데이터는 입력버퍼(650)를 통해 데이터 연산부(610)에게 제공될 수 있다.
상기 데이터 연산부(610)가 동작하여 생성된 출력값들은 출력버퍼(640)을 거쳐 상기 내부 메모리(30)에 저장될 수 있다. 상기 내부 메모리(30)에 저장된 상기 출력값들은 제어부(40) 및 DMA부(20)의 제어에 의해 DRAM(130)에 기록될 수도 있다.
제어부(40)는 DMA부(20), 내부 메모리(30), 및 상기 데이터 연산부(610)의 동작을 총괄하여 제어할 수 있다.
일 구현 예에서, 상기 데이터 연산부(610)는 제1시구간 동안에는 제1연산기능을 수행하고 제2시구간 동안에는 제2연산기능을 수행할 수 있다.
도 3a에는, 상기 데이터 연산부(610)는 상기 하드웨어 가속기(110) 내에 1개가 제시되어 있다. 그러나 도시하지 않은 변형된 일 실시예에서, 도 3a에 나타낸 상기 데이터 연산부(610)는 상기 하드웨어 가속기(110) 내에 복수 개 제공되어 각각 제어부(40)에 의해 요청된 연산을 병렬적으로 수행할 수도 있다.
일 구현 예에서, 상기 데이터 연산부(610)는 그 출력데이터를 한 번에 출력하지 않고 시간에 따라 주어진 순서에 따라 순차적으로 출력할 수 있다.
도 3b 내지 도 3e는 콘볼루션 연산을 위해 수학연산 대상을 저장하는 저장 공간의 크기와 상기 수학연산 대상의 크기를 비교한 것이다. 상기 버퍼는 도 3a에 제시한 내부메모리(30)의 일부일 수 있다. 예컨대, 상기 내부메모리(30)에는 입력 액티베이션(710)을 위해 할당된 제1저장 공간이 정의되어 있고, 그리고 가중치를 위해 할당된 제2저장 공간이 정의되어 있을 수 있다. 상기 제1저장 공간 및 상기 제2저장 공간의 크기는 한정되어 있을 수 있다.
도 3b에 나타낸 것과 같이, 상기 입력 액티베이션(710)의 크기가 상기 제1저장 공간의 크기보다 크면 상기 입력 액티베이션(710) 전체가 상기 제1저장 공간에 입력될 수 없다는 문제가 발생한다. 이러한 문제를 해결하기 위하여, 도 3c에 나타낸 것과 같이, 상기 입력 액티베이션(710)을 입력채널 별로 스플릿 하여, 예컨대 입력 액티베이션(711, 712)만을 상기 제1저장 공간에 저장하여 이용할 수 있다.
마찬가지로 도 3d에 나타낸 것과 같이, 상기 가중치(740)의 크기가 상기 제2저장 공간의 크기보다 크면 상기 가중치(740) 전체가 상기 제2저장 공간에 입력될 수 없다는 문제가 발생한다. 이러한 문제를 해결하기 위하여, 도 3e에 나타낸 것과 같이, 상기 가중치(740)을 입력채널 별로 스플릿 하여, 예컨대 제1출력채널의 입력 액티베이션(7411, 7412) 및 제2출력채널의 입력 액티베이션(7421, 7422)만을 상기 제2저장 공간에 저장하여 이용할 수 있다.
내부메모리의 크기가 작다는 이유 때문에, 상기 입력 액티베이션(710) 및 상기 가중치(740) 중 어느 하나를 입력채널 별로 스플릿하면, 다른 하나도 입력채널 별로 스플릿 해야 할 수 있다.
도 4는 콘볼루션 연산을 위해 가중치를 입력채널 별로 스플릿 하는 개념을 나타낸 것이다.
본 명세서에서 상기 가중치(740) 중 상기 출력채널 인덱스가 k이고 상기 입력채널 인덱스가 j인 부분은 '가중치[co]=k,[ci]=j'라고 표현할 수 있다. 도 4에서 가중치[co]=1,[ci]=1, 가중치[co]=1,[ci]=2, 가중치[co]=1,[ci]=3, 가중치[co]=2,[ci]=1, 가중치[co]=2,[ci]=2, 가중치[co]=2,[ci]=3은 각각 참조번호 7411, 7412, 7413, 7421, 7422, 및 7423으로 나타낸다.
도 5는 상기 스플릿 데이터를 이용하여 도 2의 (b)에 제시한 상기 출력 액티베이션(750)을 산출하는 방법을 나타낸 것이다.
도 5에 제시한 실시예에서, 상기 입력 액티베이션(710) 및 상기 가중치(740)가 입력채널 별로 스플릿 되었으므로 콘볼루션 연산에 필요한 버퍼의 크기를 충분히 큰 것으로 가정할 수 있다.
이하 도 5를 참조하여 설명한다.
상기 입력 액티베이션[ci]=1(711)과 상기 가중치[co]=1,[ci]=1(7411)에 대한 콘볼루션 연산을 수행하여 출력 액티베이션[co]=1,[ci]=1(7511)을 산출할 수 있다.
상기 입력 액티베이션[ci]=2(712)과 상기 가중치[co]=1,[ci]=2(7412)에 대한 콘볼루션 연산을 수행하여 출력 액티베이션[co]=1,[ci]=2(7512)을 산출할 수 있다.
상기 입력 액티베이션[ci]=3(713)과 상기 가중치[co]=1,[ci]=3(7413)에 대한 콘볼루션 연산을 수행하여 출력 액티베이션[co]=1,[ci]=3(7513)을 산출할 수 있다.
상기 입력 액티베이션[ci]=1(711)과 상기 가중치[co]=2,[ci]=1(7421)에 대한 콘볼루션 연산을 수행하여 출력 액티베이션[co]=2,[ci]=1(7521)을 산출할 수 있다.
상기 입력 액티베이션[ci]=2(712)과 상기 가중치[co]=2,[ci]=2(7422)에 대한 콘볼루션 연산을 수행하여 출력 액티베이션[co]=2,[ci]=2(7522)을 산출할 수 있다.
상기 입력 액티베이션[ci]=3(713)과 상기 가중치[co]=2,[ci]=3(7423)에 대한 콘볼루션 연산을 수행하여 출력 액티베이션[co]=2,[ci]=3(7523)을 산출할 수 있다.
이제, 상기 출력 액티베이션[co]=1,[ci]=1(7511), 상기 출력 액티베이션[co]=1,[ci]=2(7512), 및 상기 출력 액티베이션[co]=1,[ci]=3(7513)에 대하여, 엘레먼트 별 덧셈 연산(element-wise adding operation)(P101)을 수행하여 상기 출력 액티베이션[co]=1(751)을 산출할 수 있다.
그리고 상기 출력 액티베이션[co]=2,[ci]=1(7521), 상기 출력 액티베이션[co]=2,[ci]=2(7522), 및 상기 출력 액티베이션[co]=2,[ci]=3(7523)에 대하여, 엘레먼트별 덧셈 연산(element-wise adding operation)(P102)을 수행하여 상기 출력 액티베이션[co]=2(752)을 산출할 수 있다.
그 다음, 상기 출력 액티베이션[co]=1(751)과 상기 출력 액티베이션[co]=2(752)를 결합하여 상기 출력 액티베이션(750)을 생성할 수 있다.
상술한 엘레먼트별 덧셈 연산(P101, P102) 과정에서, 각 출력 액티베이션[co]=k,[ci]=j을 버퍼에 기록하는 과정이 수행될 수 있는데, 이 과정에서 데이터의 양자화 오류가 발생할 수 있다.
입력 액티베이션(711~713)들은 제1스케일로 표현된 것이고, 제1출력채널의 가중치(7411~7413)들은 제2스케일로 표현된 것이고, 그리고 제2출력채널의 가중치(7421~7423)들은 제3스케일로 표현된 것일 수 있다. 여기서 상기 제1스케일, 상기 제2스케일, 및 상기 제3스케일은 서로에 대하여 독립적으로 설정된 값일 수 있다. 그 결과, 제1출력채널의 출력 액티베이션(751) 및 제2출력채널의 출력 액티베이션(752)은 서로 스케일로 표현된 것일 수 있다.
상술한 내용은 본 명세서에서 특허 받고자 하는 발명의 의해를 돕기 위하여 발명자가 이해하고 있는 내용을 제시한 것이다. 상술한 내용 중 일부는 본 발명의 특허출원 이전에 불특정인에게 공개되어 있지 않은 것일 수 있다.
본 발명에서는 하드웨어 가속기에서 데이터를 연산하거나 처리할 때에, 데이터를 2개 그룹 이상으로 나누어 처리하는 과정에서 발생하는 양자화 오류를 감소시키는 기술을 제공하고자 한다.
본 발명의 일 관점에 따라, 컴퓨팅 장치가, 제1입력 데이터와 제2입력 데이터로부터 제1출력채널의 출력데이터 및 제2출력채널의 출력데이터를 포함하는 출력 데이터를 생성하는 단계; 및 상기 컴퓨팅 장치가, 상기 제1출력채널의 출력데이터에 대하여 제1연산함수를 적용하여 제1연산데이터를 생성하고, 상기 제2출력채널의 출력데이터에 대하여 제2연산함수를 적용하여 제2연산데이터를 생성하는 단계;를 포함하며, 상기 제1출력채널의 출력데이터와 상기 제2출력채널의 출력데이터는 서로 다른 스케일로 표현된 것을 특징으로 하는, 데이터 연산방법이 제공될 수 있다.
본 명세서에서 '제k출력채널의 출력데이터'는 '제k출력채널의 콘볼루션 데이터'라고 지칭할 수도 있다.
이때, 상기 제2입력 데이터는 상기 제1출력채널 및 상기 제2출력채널을 포함하는 복수 개의 출력채널들로 구성되어 있을 수 있다. 여기서 상기 복수 개의 출력채널들이란 상기 복수 개의 출력채널들을 구성하는 데이터들을 의미할 수 있다.
이때, 상기 출력 데이터를 생성하는 단계는, 상기 컴퓨팅 장치가, 상기 제1입력 데이터를 입력채널 별로 스플릿 하여 얻은 제1세트의 제1스플릿 데이터를 준비하는 제1단계; 상기 컴퓨팅 장치가, 상기 제2입력 데이터 중 상기 제1출력채널을 상기 입력채널 별로 스플릿 하여 얻은 제1세트의 제2스플릿 데이터를 준비하고, 상기 제2입력 데이터 중 상기 제2출력채널을 상기 입력채널 별로 스플릿 하여 얻은 제2세트의 제2스플릿 데이터를 준비하는 제2단계; 및 상기 컴퓨팅 장치가, 상기 제1세트의 제2스플릿 데이터를 상기 제1세트의 제1스플릿 데이터와 입력채널 별로 콘볼루션 하여 상기 제1출력채널의 출력데이터를 생성하고, 상기 제2세트의 제2스플릿 데이터를 상기 제1세트의 제1스플릿 데이터와 입력채널 별로 콘볼루션 하여 상기 제2출력채널의 출력데이터를 생성하는 제3단계;를 포함하라 수 있다.
여기서, 상기 '제2입력 데이터 중 상기 제1출력채널'은 상기 제1출력채널에 해당하는 상기 제2입력 데이터의 일부분을 의미하고, 상기 '제2입력 데이터 중 상기 제2출력채널'은 상기 제2출력채널에 해당하는 상기 제2입력 데이터의 다른 일부분을 의미할 수 있다.
이때, 상기 제2단계는, 상기 컴퓨팅 장치가, 상기 제1세트의 제2스플릿 데이터를 제1스케일로 표현하여 준비하고, 상기 제2세트의 제2스플릿 데이터를 제2스케일로 표현하여 준비하는 단계를 포함할 수 있다.
이때, 상기 제3단계에서, 상기 제1출력채널의 출력데이터를 생성하기 위해, 상기 제1세트의 제1스플릿 데이터는 상기 제1스케일로 표현된 상기 제1세트의 제2스플릿 데이터와 콘볼루션 되고, 상기 제2출력채널의 출력데이터를 생성하기 위해, 상기 제1세트의 제1스플릿 데이터는 상기 제2스케일로 표현된 상기 제2세트의 제2스플릿 데이터와 콘볼루션 될 수 있다.
이때, 상기 제2연산함수에 입력되는 입력데이터의 상기 제2연산함수의 입력에 대한 출력의 평균변화율이 상기 제1연산함수에 입력되는 입력데이터의 상기 제1연산함수의 입력에 대한 출력의 평균변화율보다 큰 경우, 상기 제2스케일은 상기 제1스케일보다 작은 값을 가질 수 있다.
이때, 상기 제1연산함수에 입력되는 입력데이터의 소정의 제1구간에서의 상기 제1연산함수의 입력에 대한 출력의 평균변화율이 상기 제2연산함수에 입력되는 입력데이터의 제2구간에서의 상기 제2연산함수의 입력에 대한 출력의 평균변화율보다 큰 경우, 상기 제1스케일은 상기 제2스케일보다 작은 값을 가지며, 상기 제1구간은 상기 제1출력채널의 출력데이터의 통계 값을 기초로 결정되고, 상기 제2구간은 상기 제2출력채널의 출력데이터의 통계 값을 기초로 결정될 수 있다.
이때, 상기 제1연산함수에 입력되는 입력데이터의 소정의 제1구간에서의 상기 제1연산함수의 입력에 대한 출력의 평균변화율이 상기 제2연산함수에 입력되는 입력데이터의 제2구간에서의 상기 제2연산함수의 입력에 대한 출력의 평균변화율보다 큰 경우, 상기 제1스케일은 상기 제2스케일보다 작은 값을 가질 수 있다.
그리고 상기 제1구간은 상기 제1출력채널의 출력데이터의 값들의 평균값을 포함하는 구간으로서 상기 제1출력채널의 출력데이터들 중 소정의 제1비율의 데이터들을 포함하는 구간일 수 있다. 예컨대 제1출력채널의 출력데이터들을 구성하는 값들이 총 100개이고, 상기 100개의 값들이 각각 소정의 값을 가질 수 있다. 이때 '상기 제1출력채널의 출력데이터의 값들의 평균값'은 상기 100개의 값들의 평균값이다. 그리고 상기 제1비율이 80%로 설정되었다면, 상기 '제1비율의 데이터들'은 상기 100개의 데이터들 중 80개의 데이터를 의미할 수 있다.
그리고 상기 제2구간은 상기 제2출력채널의 출력데이터의 값들의 평균값을 포함하는 구간으로서 상기 제2출력채널의 출력데이터들 중 소정의 제2비율의 데이터들을 포함하는 구간일 수 있다.
이때, 상기 제1입력 데이터는 신경망의 특정 레이어에 입력되는 입력 액티베이션이고, 상기 제2입력 데이터는 상기 신경망의 상기 특정 레이어에 입력되는 가중치 또는 커널일 수 있다.
이때, 상기 데이터 연산방법은, 상기 컴퓨팅 장치가, 상기 생성한 제1연산데이터 및 제2연산데이터를 휘발성 메모리 또는 비휘발성 메모리에 저장하는 단계; 상기 컴퓨팅 장치가, 상기 저장된 상기 제1연산데이터 및 상기 제2연산데이터를 이용하여 상기 신경망의 출력값을 산출하는 단계; 및 상기 컴퓨팅 장치가, 상기 산출된 상기 신경망의 출력값을 이용하여 상기 컴퓨팅 장치에 저장되어 있는 소정의 이미지를 변환하는 단계;를 더 포함할 수 있다.
이때, 상기 데이터 연산방법은, 상기 출력 데이터를 생성하는 단계 이전에, 상기 컴퓨팅 장치가, 상기 제1연산함수가 요구하는 입력데이터의 제1스케일 및 상기 제2연산함수가 요구하는 입력데이터의 스케일을 메모리로부터 탐색하여 획득하는 단계;를 더 포함하고, 상기 제1단계와 상기 제2단계 사이에, 상기 컴퓨팅 장치가, 상기 제1세트의 제2스플릿 데이터를 상기 제1스케일로 표현한 값을 생성하고, 상기 제2세트의 제2스플릿 데이터를 상기 제2스케일로 표현한 값을 생성하는 단계를 더 포함할 수 있다.
본 발명의 일 관점에 따라, 휘발성 메모리를 포함하는 하드웨어 가속기 및 비휘발성 메모리를 포함하는 컴퓨팅 장치가 제공될 수 있다. 이때, 상기 하드웨어 가속기가, 상기 휘발성 메모리 및 상기 비휘발성 메모리 중 적어도 하나로부터 제1입력 데이터와 제2입력 데이터를 읽는 단계; 상기 제1입력 데이터와 상기 제2입력 데이터로부터 제1출력채널의 출력데이터 및 제2출력채널의 출력데이터를 포함하는 출력 데이터를 생성하는 단계; 및 상기 제1출력채널의 출력데이터에 대하여 제1연산함수를 적용하여 제1연산데이터를 생성하고, 상기 제2출력채널의 출력데이터에 대하여 제2연산함수를 적용하여 제2연산데이터를 생성하는 단계;를 실행하도록 되어 있다. 그리고 상기 제1출력채널의 출력데이터와 상기 제2출력채널의 출력데이터는 서로 다른 스케일로 표현되어 있다.
이때, 상기 제2입력 데이터는 상기 제1출력채널 및 상기 제2출력채널을 포함하는 복수 개의 출력채널들로 구성되어 있을 수 있다. 그리고 상기 출력 데이터를 생성하는 단계는, 상기 제1입력 데이터를 입력채널 별로 스플릿 하여 얻은 제1세트의 제1스플릿 데이터를 준비하는 제1단계; 상기 제2입력 데이터 중 상기 제1출력채널을 상기 입력채널 별로 스플릿 하여 얻은 제1세트의 제2스플릿 데이터를 준비하고, 상기 제2입력 데이터 중 상기 제2출력채널을 상기 입력채널 별로 스플릿 하여 얻은 제2세트의 제2스플릿 데이터를 준비하는 제2단계; 및 상기 제1세트의 제2스플릿 데이터를 상기 제1세트의 제1스플릿 데이터와 입력채널 별로 콘볼루션 하여 상기 제1출력채널의 출력데이터를 생성하고, 상기 제2세트의 제2스플릿 데이터를 상기 제1세트의 제1스플릿 데이터와 입력채널 별로 콘볼루션 하여 상기 제2출력채널의 출력데이터를 생성하는 제3단계;를 포함할 수 있다.
이때, 상기 제2단계는, 상기 제1세트의 제2스플릿 데이터를 제1스케일로 표현하여 준비하고, 상기 제2세트의 제2스플릿 데이터를 제2스케일로 표현하여 준비하는 단계를 포함할 수 있다.
이때, 상기 제2연산함수에 입력되는 입력데이터의 상기 제2연산함수의 입력에 대한 출력의 평균변화율이 상기 제1연산함수에 입력되는 입력데이터의 상기 제1연산함수의 입력에 대한 출력의 평균변화율보다 큰 경우, 상기 제2스케일은 상기 제1스케일보다 작은 값을 가질 수 있다.
이때, 상기 제1입력 데이터는 신경망의 특정 레이어에 입력되는 입력 액티베이션이고, 상기 제2입력 데이터는 상기 신경망의 상기 특정 레이어에 입력되는 가중치 또는 커널일 수 있다. 그리고 상기 하드웨어 가속기가, 상기 생성한 제1연산데이터 및 제2연산데이터를 상기 휘발성 메모리 및 상기 비휘발성 메모리 중 적어도 어느 하나에 저장하는 단계; 상기 저장된 상기 제1연산데이터 및 상기 제2연산데이터를 이용하여 상기 신경망의 출력값을 산출하는 단계; 및 상기 산출된 상기 신경망의 출력값을 이용하여 상기 컴퓨팅 장치에 저장되어 있는 소정의 이미지를 변환하는 단계;를 더 실행하도록 되어 있을 수 있다.
이때, 상기 제1연산함수의 비포화 구간의 크기가 상기 제2연산함수의 비포화 구간의 크기보다 큰 경우, 상기 제1스케일은 상기 제2스케일보다 클 수 있다.
이때, 상기 제1출력채널의 출력데이터를 표현하는 비트수와 상기 제2출력채널의 출력데이터를 표현하는 비트수와 동일할 수 있다.
본 발명에 따르면, 하드웨어 가속기에서 데이터를 연산하거나 처리할 때에, 데이터를 2개 그룹 이상으로 나누어 처리하는 과정에서 발생하는 양자화 오류를 감소시키는 기술을 제공할 수 있다.
도 1a는 본 발명에 따른 수학연산의 대상 중 하나인 입력 액티베이션의 구성을 나타낸 것이다.
도 1b는 본 발명에 따른 수학연산의 대상 중 다른 하나인 가중치의 구성을 나타낸 것이다.
도 1c는 입력 액티베이션이 6개의 입력채널들로 이루어진 예를 나타낸 것이다.
도 1d는 가중치가 2개의 출력채널들로 이루어지고, 각 출력채널은 6개의 입력채널로 이루어진 예를 나타낸 것이다.
도 2a 내지 도 2c는 상기 입력 액티베이션과 상기 가중치 간의 콘볼루션 연산을 설명하는 개념도이다.
도 3a는 본 발명의 일 실시예에서 이용되는 컴퓨팅 장치 중 일부의 주요 구조를 나타낸 것이고, 도 3b 내지 도 3e는 콘볼루션 연산을 위해 수학연산 대상을 저장하는 저장 공간의 크기와 상기 수학연산 대상의 크기를 비교한 것이다.
도 4는 콘볼루션 연산을 위해 가중치를 입력채널 별로 스플릿 하는 개념을 나타낸 것이다.
도 5는 상기 스플릿 데이터를 이용하여 도 2의 (b)에 제시한 상기 출력 액티베이션을 산출하는 방법을 나타낸 것이다.
도 6a은 도 5에서 설명한 출력 액티베이션을 이용한 후속 연산과정의 예를 나타낸 것이다.
도 6b는 도 6a에 제시한 개념을 확장한 것이다.
도 7a 및 도 7b는 본 발명의 일 실시예에 따라, 신경망의 특정 레이어가 출력한 출력 액티베이션의 각 출력채널에 서로 다른 연산함수가 적용되는 구조를 나타낸 것이다.
도 8a 및 도 8b는 서로 다른 출력채널의 출력 액티베이션이 서로 다른 스케일로 표현되어야 하는 또 다른 이유를 설명하기 위한 것이다.
도 8c, 도 8d, 및 도 8e는 각각, 서로 다른 출력채널의 출력 액티베이션이 서로 다른 스케일로 표현되어야 하는 또 다른 이유를 설명하기 위한 것이다.
도 9a는 본 발명의 일 실시예에 따라 입력 액티베이션을 연산하는 방법을 나타낸 순서도이다.
도 9b는 본 발명의 일 실시예에 따라 각 출력채널의 콘볼루션 데이터를 생성하는 방법을 나타낸 순서도이다.
도 10a 및 도 10b는 본 발명에서 예시로서 제공하는 서로 다른 연산함수들인 Sigmoid 함수와 Exponent 함수의 도함수를 나타낸 것이다.
도 11은 본 발명의 다른 실시예에 따라 입력 액티베이션을 연산하는 방법을 나타낸 순서도이다.
도 12는 본 발명의 일 실시예에 따라 제공되는 데이터 연산방법을 나타낸 순서도이다.
이하, 본 발명의 실시예를 첨부한 도면을 참고하여 설명한다. 그러나 본 발명은 본 명세서에서 설명하는 실시예에 한정되지 않으며 여러 가지 다른 형태로 구현될 수 있다. 본 명세서에서 사용되는 용어는 실시예의 이해를 돕기 위한 것이며, 본 발명의 범위를 한정하고자 의도된 것이 아니다. 또한, 이하에서 사용되는 단수 형태들은 문구들이 이와 명백히 반대의 의미를 나타내지 않는 한 복수 형태들도 포함한다.
도 6a는 도 5에서 설명한 출력 액티베이션을 이용한 후속 연산과정의 예를 나타낸 것이다.
예컨대 도 5에 제시한 것과 같이, 상기 출력 액티베이션(750)은 제1출력채널의 출력 액티베이션(751) 및 제2출력채널의 출력 액티베이션(752)으로 구성될 수 있다.
일 실시예에서, 상기 제어부(40)는 상기 생성된 상기 출력 액티베이션(750)은 내부 메모리(SRAM) 또는 외부 메모리(DRAM)에 저장하고, 그 후 필요한 시점에 상기 출력 액티베이션(750)을 다시 읽어 이를 이용한 후속 연산을 수행할 수 있다.
또는 다른 실시예에서, 상기 제어부(40)는 상기 제1출력채널의 출력 액티베이션(751)과 상기 제2출력채널의 출력 액티베이션(752)을 내부 메모리(SRAM) 또는 외부 메모리(DRAM)에 저장하고, 그 후 필요한 시점에 상기 제1출력채널의 출력 액티베이션(751)과 상기 제2출력채널의 출력 액티베이션(752)을 다시 읽어 이를 이용한 후속 연산을 수행할 수 있다.
이때, 상기 후속 연산은 상기 두 개의 출력채널들 각각에 대하여 독립적으로 이루어질 수 있으며, 서로 다른 출력채널에 대해서는 서로 다른 연산이 이루어질 수 있다. 예컨대 상기 제1출력채널의 출력 액티베이션(751)에 대해서는 제1연산부(210)가 제공하는 제1연산함수에 의한 연산일 이루어질 수 있고, 상기 제2출력채널의 출력 액티베이션(752)에 대해서는 제2연산부(220)가 제공하는 제2연산함수에 의한 연산이 이루어질 수 있다. 상기 제1출력채널의 출력 액티베이션(751)이 상기 제1연산함수에 의해 처리되면 제1연산데이터(761)가 생성될 수 있고, 상기 제2출력채널의 출력 액티베이션(752)이 상기 제2연산함수에 의해 처리되면 제2연산데이터(762)가 생성될 수 있다.
이때, 상기 제1연산함수와 상기 제2연산함수가 서로 다르다면, 상기 제1연산부에 입력되는 제1입력데이터(ex 751)에 대해 요구되는 제1스케일(=제1해상도, 제1양자화 오류)과, 상기 제2연산부에 입력되는 제2입력데이터(ex 752)에 대해 요구되는 제2스케일(=제2해상도, 제2양자화 오류)은 서로 다를 수 있다. 즉, 상기 제1입력데이터가 표현 가능한 0이 아닌 최소 절대값은, 상기 제2입력데이터가 표현 가능한 0이 아닌 최소 절대값과 다를 수 있다.
도 6b는 본 발명의 바람직한 일 실시예에 따라 출력 액티베이션을 연산하는 방법을 나타낸 것으로서, 도 6a에 제시한 본 발명의 개념을 확장하여 예시한 것이다.
상기 출력 액티베이션(750)은 복수 개(ex: 5개)의 출력채널들(ex: 751~755)로 구성될 수 있다. 예컨대 도 6b에 제시한 것과 같이, 상기 출력 액티베이션(750)은 제1출력채널의 출력 액티베이션 내지 제5출력채널의 출력 액티베이션들((751, 752, 753, 754, 755)로 구성될 수 있다.
본 발명의 일 실시예에서, 상기 복수 개의 출력채널들의 출력 액티베이션(751~755) 중 제1그룹의 출력채널들의 출력 액티베이션(ex: 751~753)에 대해서는 제1연산부(210)가 제공하는 제1연산함수에 의한 연산일 이루어질 수 있고, 제2그룹의 출력채널들의 출력 액티베이션(754~755)에 대해서는 제2연산부(220)가 제공하는 제2연산함수에 의한 연산이 이루어질 수 있다. 여기서 상기 제1그룹과 상기 제2그룹은 각각 한 개 또는 복수 개의 출력채널들의 출력 액티베이션들로 구성될 수 있다.
이때, 상기 복수 개의 출력채널들의 출력 액티베이션들(ex: 751~755)은 최종적인 출력 액티베이션(750)으로 먼저 병합(merge)될 수 있다. 그 후 필요한 시점에, 상기 출력 액티베이션(750)은 상기 제1그룹의 출력채널들의 출력 액티베이션(ex: 751~753) 및 상기 제2그룹의 출력채널들의 출력 액티베이션(754~755)들로 분할될 수 있다.
상기 제1그룹의 출력채널들의 출력 액티베이션(751~753)이 상기 제1연산함수에 의해 처리되면 제1그룹의 연산데이터(761~763)가 생성될 수 있고, 상기 제2그룹의 출력채널들의 출력 액티베이션(754~755)이 상기 제2연산함수에 의해 처리되면 제2그룹의 연산데이터(764~765)가 생성될 수 있다.
이때, 상기 제1연산함수와 상기 제2연산함수가 서로 다르다면, 상기 제1연산부에 입력되는 제1입력데이터(ex 751~753)에 대해 요구되는 제1스케일(=제1해상도, 제1양자화 오류)과, 상기 제2연산부에 입력되는 제2입력데이터(ex 754~755)에 대해 요구되는 제2스케일(=제2해상도, 제2양자화 오류)은 서로 다를 수 있다. 즉, 상기 제1입력데이터가 표현 가능한 0이 아닌 최소 절대값은, 상기 제2입력데이터가 표현 가능한 0이 아닌 최소 절대값과 다를 수 있다.
도 6c는 본 발명의 바람직한 일 실시예에 따라 출력 액티베이션을 연산하는 방법을 나타낸 것으로서, 도 6b에 제시한 개념을 변형한 것이다.
도 6c의 방법에서는, 상기 복수 개의 출력채널들의 출력 액티베이션들(ex: 751~755)을 최종적인 출력 액티베이션(750)으로 병합(merge)하는 과정을 수행하지 않을 수 있다. 그 대신, 산출된 상기 제1그룹의 출력채널들의 출력 액티베이션(ex: 751~753)을 직접 상기 제1연산부(210)에 입력하고, 산출된 상기 제2그룹의 출력채널들의 출력 액티베이션(ex: 754~755)을 직접 상기 제2연산부(220)에 입력할 수 있다.
상기 제1그룹의 출력채널들의 출력 액티베이션(ex: 751~753)은 휘발성의 또는 비휘발성의 메모리에 먼저 저장될 수 있다. 그 다음, 상기 메모리로부터 출력된 상기 제1그룹의 출력채널들의 출력 액티베이션(ex: 751~753)들이 상기 제1연산부(210)에 입력될 수 있다.
마찬가지로, 제2그룹의 출력채널들의 출력 액티베이션(ex: 754~755)은 휘발성의 또는 비휘발성의 메모리에 먼저 저장될 수 있다. 그 다음, 상기 메모리로부터 출력된 상기 제2그룹의 출력채널들의 출력 액티베이션(ex: 754~755)들이 상기 제1연산부(210)에 입력될 수 있다.
도 6b와 도 6c에 나타낸 것과 같이, 생성된 모든 출력채널들 중 한 개 또는 복수 개의 출력채널들로 구성된 제1그룹의 출력채널들이 특정 연산부에 입력되고, 이와는 다른 한 개 또는 복수 개의 출력채널들로 구성된 제2그룹의 출력채널들이 또 다른 연산부에 입력될 수 있다.
도 7a에 나타낸 것과 같이, 예컨대, 제1연산부(210)가 제공하는 제1연산함수는 Sigmoid 연산함수일 수 있다.
도 7b에 나타낸 것과 같이, 예컨대, 제2연산부(220)가 제공하는 제2연산함수는 Exponent 연산함수일 수 있다.
Sigmoid 연산함수의 경우 입력데이터의 변화량인 입력변화량(Δi)에 대한 출력데이터의 변화량을 Δo1라고 표시할 수 있다. 그리고 Exponent 연산함수의 경우 입력데이터의 변화량인 입력변화량(Δi)에 대한 출력데이터의 변화량을 Δo2라고 표시할 수 있다.
이때, 도 7a 및 도 7b를 살펴보면, 동일한 입력변화구간(Δi)이 주어졌을 때에 상기 Δo2가 상기 Δo1보다 클 가능성이 더 크다. 즉, Exponent 연산함수는 Sigmoid 연산함수에 비하여, 그 출력 값이 입력의 변화량에 더 민감하다. 즉, 제1연산함수는 제2연산함수보다 그 출력 값이 입력의 변화량에 더 민감할 수 있다.
여기서, 특정 연산함수에 입력되는 입력데이터의 값에는 상기 입력데이터의 스케일에 따라 존재하는 양자화 오류가 포함되어 있을 수 있다. 상기 입력데이터의 양자화 오류는 상기 특정 연산함수가 출력하는 출력데이터에 전파된다. 주어진 연산함수의 입력에 대한 출력의 변화량이 더 커질수록, 상기 주어진 연산함수에 입력된 양자화 오류가 더 증폭되어 출력될 수 있다.
예컨대 Exponent 연산함수와 Sigmoid 연산함수에 각각, 동일한 스케일로 표현된 동일한 입력데이터를 입력하는 경우를 가정할 수 있다. 이때, 0보다 큰 값을 갖는 입력데이터의 거의 대부분에 대하여 Exponent 연산함수는 Sigmoid 연산함수에 비하여 입력데이터의 양자화 오류를 더 큰 폭으로 증폭시킬 수 있다. 이로 인해 Exponent 연산함수로 처리하는 제2출력채널의 출력 액티베이션(752)의 양자화 오류가 Sigmoid 연산함수로 처리하는 제1출력채널의 출력 액티베이션(751)의 양자화 오류보다 더 크게 증폭된다. 데이터의 양자화 오류가 출력채널 별로 서로 다른 크기로 증폭되어 전달되는 경우, 심각한 데이터 오류가 발생할 수 있다는 문제가 있다.
연산함수의 출력 단까지 전파된 오류를 출력채널 별로 평탄화하기(equalizing) 위해서는 각 출력채널의 출력 액티베이션에 적용되는 연산함수의 종류를 미리 파악할 필요가 있다. 그리고 각 연산함수 별로 요구되는, 각 연산함수에 입력되는 데이터인 입력데이터를 표현하는 스케일(=입력데이터의 LSB가 나타내는 값)을 미리 정의하여 둘 필요가 있다. 이때, 특정 연산함수에 대해 요구되는 입력데이터의 스케일은 특정 값으로 결정될 수도 있고, 일정 범위의 값으로 결정될 수도 있다.
예컨대 제1연산함수가 요구하는 입력데이터의 스케일이 제1값이고, 제2연산함수가 요구하는 입력데이터의 스케일이 제2값이라는 정보를 미리 저장해 둘 수 있다. 상기 제1값과 제2값을 서로 비교하여 상기 제1값과 제2값 중 어느 것이 더 큰지 확인할 수 있다.
또는 예컨대, 제1연산함수가 요구하는 입력데이터의 스케일이, 제2연산함수에 요구하는 입력데이터의 스케일과 동일한지, 또는 더 큰지, 또는 더 작은지를 미리 저장해 둘 수 있다.
본 발명의 일 실시예에 따르면, 상기 제2출력채널의 출력 액티베이션(752)의 스케일인 제2스케일이 상기 제1출력채널의 출력 액티베이션(751)의 스케일인 제1스케일보다 더 작을 필요가 있다면, 상기 제2스케일이 상기 제1스케일보다 더 작게 되도록, 상기 제2출력채널의 출력 액티베이션(752)의 산출 프로세스와 상기 제2출력채널의 출력 액티베이션(752)의 산출 프로세스를 제어할 수 있다.
컴퓨팅 장치(1)의 연산 파워와 메모리가 충분히 크다면, 상기 제1스케일과 상기 제2스케일의 상대적인 차이를 고려하지 않고, 상기 제1스케일과 상기 제2스케일을 매우 작은 동일한 값이 되도록 설계할 수 있다. 그러나 컴퓨팅 장치(1)의 연산 파워와 메모리가 충분히 크지 않다고 가정한다면, 상기 제1스케일과 제2스케일을 서로 다른 값으로 정의하는 것이 바람직하다.
도 8a 및 도 8b는 서로 다른 출력채널의 출력 액티베이션이 서로 다른 스케일로 표현되어야 하는 또 다른 이유를 설명하기 위한 것이다.
도 8a는 제1출력채널의 출력 액티베이션(751)이 제1연산부(210)가 제공하는 제1연산함수, 예컨대 Sigmoid 함수에 입력되는 상황을 나타낸 것이다. 이때, 제1출력채널의 출력 액티베이션(751)의 각 요소의 값을 문자 i로 나타낼 수 있다. 이때, 제1출력채널의 출력 액티베이션(751)의 각 요소가 제1스케일(S1)으로 표현된 경우와 제2스케일(S2)로 표현된 경우가 각각 도 8a의 중간(middle) 및 아래(bottom)에 제시되어 있다. 이때, 상기 제1스케일이 상기 제2스케일보다 큰 경우를 가정할 수 있다. 그리고 제1출력채널의 출력 액티베이션(751)의 각 요소가 4비트로 표현되어 총 16가지의 값을 표현할 수 있다고 가정할 수 있다. 도 8a의 각 그래프에 나타낸 16개의 점선들은 상기 16가지의 값들을 나타낸 것이다.
이제 도 8a의 중간에 배치된 그래프를 참조하여 설명한다. 제1출력채널의 출력 액티베이션(751)의 각 요소가 가질 수 있는 가장 큰 3개의 값들(R1)을 상기 Sigmoid 함수에 입력하였을 때에, Sigmoid 함수들로부터 출력되는 3개의 값들 간에는 큰 차이가 없다. 또한, 제1출력채널의 출력 액티베이션(751)의 각 요소가 가질 수 있는 가장 작은 3개의 값들(R2)을 상기 Sigmoid 함수에 입력하였을 때에, Sigmoid 함수들로부터 출력되는 3개의 값들 간에는 큰 차이가 없다. 즉, 소정의 양의 제1값보다 큰 입력값들이 Sigmoid 함수에 입력되는 경우 Sigmoid 함수가 출력하는 값들은 사실상 거의 동일하며, 소정의 음의 제2값보다 작은 입력값들이 Sigmoid 함수에 입력되는 경우 Sigmoid 함수가 출력하는 값들은 사실상 거의 동일하다. 따라서 Sigmoid 함수에 입력되는 입력값, 즉 제1출력채널의 출력 액티베이션(751)의 각 요소는 상기 소정의 양의 제1값보다 큰 값 및 상기 소정의 음의 제2값보다 작은 값을 표현할 필요가 없다. 따라서, 즉 제1출력채널의 출력 액티베이션(751)을 상기 제1스케일(S1)으로 표현할 필요가 없다.
그 보다는, 도 8a의 아래에 배치된 그래프와 같이, 즉 제1출력채널의 출력 액티베이션(751)을 상기 제1스케일(S1)보다 작은 제2스케일(S2)로 표현할 수 있다. 이렇게 하면, 동일한 4개의 비트를 이용하여 즉 제1출력채널의 출력 액티베이션(751)의 정밀도를 향상시킬 수 있을 뿐만 아니라, Sigmoid 함수가 출력하는 값들의 정밀도 역시 향상시킬 수 있다는 장점이 있다.
이와 같이, 예컨대 Sigmoid 함수에 입력되어야 하는 특정 출력채널의 출력 액티베이션은, 상대적으로 작은 스케일로 표현되는 것이 유리할 수 있다는 점을 이해할 수 있다.
도 8b는 제4출력채널의 출력 액티베이션(754)이 제2연산부(220)가 제공하는 제2연산함수, 예컨대 Exponent 함수에 입력되는 상황을 나타낸 것이다.
이때, 제4출력채널의 출력 액티베이션(754)의 각 요소가 제1스케일(S1)으로 표현된 경우와 제2스케일(S2)로 표현된 경우가 각각 도 8b의 중간(middle) 및 아래(bottom)에 제시되어 있다. 이때, 상기 제1스케일이 상기 제2스케일보다 큰 경우를 가정할 수 있다. 그리고 제4출력채널의 출력 액티베이션(754)의 각 요소가 4비트로 표현되어 총 16가지의 값을 표현할 수 있다고 가정할 수 있다. 도 8b의 각 그래프에 나타낸 16개의 점선들은 상기 16가지의 값들을 나타낸 것이다.
도 8a에 제시한 예와는 달리, 제4출력채널의 출력 액티베이션(754)이 입력되는 연산함수가 Exponent인 경우에는, 제4출력채널의 출력 액티베이션(754)을 상기 제1스케일 및 제2스케일 중 어떤 스케일로 표현하더라도 특별히 유리한 효과가 발생하지는 않는다. 다만, 제4출력채널의 출력 액티베이션(754)이 갖는 값들의 레인지에 따라 제4출력채널의 출력 액티베이션(754)을 표현하는 스케일의 값을 최적화할 수는 있다. 그러나 이러한 최적화는, 제4출력채널의 출력 액티베이션(754)이 갖는 값들의 레인지에 의한 것일 뿐, 제4출력채널의 출력 액티베이션(754)이 입력되는 연산함수에 의한 것은 아니다.
이러한 특징을 다른 관점으로 설명할 수 있다. 즉, 도 8a의 Sigmoid 함수의 경우, Sigmoid 함수의 출력값에 유의미한 변화를 주는 입력데이터의 관심영역은 R0에 한정될 수 있다. 이에 비하여, 도 8b의 Exponent 함수의 경우, Exponent 함수의 출력값에 유의미한 변화를 주는 입력데이터의 관심영역은 R0에 한정되지 않고, R1, R2 및 이 외의 영역으로 결정될 수 있다. 즉, 특정 연산함수의 출력값이 유의미한 변화를 주는 입력데이터의 관심영역이 그 작을수록, 상기 입력데이터를 표현하는 스케일을 더 작은 값으로 설정하는 것이 유리할 수 있다.
도 8a 및 도 8b와 함께 설명한 위 내용들을 살펴보면, 특정 출력채널의 출력 액티베이션이 입력되는 연산함수의 종류에 따라서는, 상기 연산함수의 특성에 근거하여 특정 출력채널의 출력 액티베이션의 스케일의 크기를 감소시키는 것이 유리할 수 있다는 점을 이해할 수 있다. 따라서 서로 다른 연산함수에 입력되는 서로 다른 출력 액티베이션들의 스케일을 서로 다른 값으로 설정할 필요가 있다는 점이 이해될 수 있다.
도 7a 및 도 7b에서 설명한 제1관점에 따르면, Exponent 함수에 입력되는 출력 액티베이션이 Sigmoid 함수에 입력되는 출력 액티베이션보다 더 작은 스케일을 갖는 것이 바람직하였다. 이에 비하여, 도 8a 및 도 8b에서 설명한 제2관점에 따르면, Sigmoid 함수에 입력되는 출력 액티베이션이 Exponent 함수에 입력되는 출력 액티베이션보다 더 작은 스케일을 갖는 것이 바람직하였다. 즉, 서로 다른 2개의 관점에 따라 결정된 스케일의 크기가 상반될 수 있음을 알 수 있다. 즉, 어떤 주어진 상황에서 제1연산함수에 입력되는 출력 액티베이션의 스케일을 제2연산함수에 입력되는 출력 액티베이션의 스케일보다 큰 값으로 설정할 것인지 아니면 작은 값으로 설정할 것인지는, 출력 액티베이션들을 표현하는 데이터의 비트수 및 출력 액티베이션들이 갖는 값들의 통계적 특성에 따라 변화할 수 있다.
도 8c는 서로 다른 출력채널의 출력 액티베이션이 서로 다른 스케일로 표현되어야 하는 또 다른 이유를 설명하기 위한 것이다.
도 8c의 상측부(top)는 제1출력채널의 출력 액티베이션(751)이 제1연산부(210)가 제공하는 제1연산함수 f1(i)에 입력되는 상황을 나타낸 것이고, 도 8c의 하측부(bottom)는 제2출력채널의 출력 액티베이션(754)이 제2연산부(220)가 제공하는 제2연산함수 f2(i)에 입력되는 상황을 나타낸 것이다.
이때, 상기 제1연산함수는 음의 입력값에 대하여 포화(saturation)될 뿐만 아니라 양의 입력값에 대하여도 포화되는 함수이다. 즉, 상기 제1연산함수는 양쪽 방향으로 포화되는 함수일 수 있다. 도 8c에서는 그 예시로서 f1(i)=Sigmoid(i)를 예시하였다.
또한, 상기 제2연산함수는 음의 입력값에 대하여 포화될 뿐만 아니라 양의 입력값에 대하여도 포화되는 함수이다. 즉, 상기 제2연산함수는 양쪽 방향으로 포화되는 함수일 수 있다. 도 8c에서는 그 예시로서 f2(i)=Sigmoid(2i)를 예시하였다.
이때, 상기 제1연산함수 및 제2연산합수에 모두에 대하여, 음의 입력에 대한 포화값을 osl이라고 표시하고, 양의 입력에 대한 포화값을 osr이라고 표시할 수 있다. 그리고, 음의 포화, 즉, 좌측 포화가 시작되는 입력값을 isl이라고 표현하고, 양의 포화, 즉, 우측 포화가 시작되는 입력값을 isr이라고 표현할 수 있다. 이때, 입력값을 isl은 포화값 osl로부터 소정의 차이를 갖는 출력값을 제공하는 입력값들 중 가장 큰 값일 수 있고, 입력값을 isr은 포화값 osr로부터 소정의 차이를 갖는 출력값을 제공하는 입력값들 중 가장 작은 값일 수 있다.
이때, 입력값 isl과 입력값 isr 사이의 입력구간을 비포화 구간이라고 지칭하고, 그 외의 구간을 포화 구간이라고 지칭할 수 있다. 상기 비포화 구간에서는 입력의 변화에 대한 출력의 변화가 일정 수준 이상이지만, 상기 포화 구간에서는 입력 변화에 대한 출력의 변화가 매우 작다. 따라서 상기 연산함수(제1연산함수 또는 제2연산함수)에 입력되는 입력값들 중 상기 포화 구간에 속하는 값들은 정확하게 표현하지 않더라도 상기 연산함수의 출력에 반영되는 영향은 무시할 수 있다는 점을 이해할 수 있다.
이때, 상기 각 연산합수에서, 입력값 isl과 입력값 isr 간의 차이값을 비포화 구간의 크기(Lns)로 정의할 수 있다. 도 8c에 제시한 예에서, 상기 제1연산함수 f1에 대한 상기 비포화 구간의 크기(Lns_f1)는 상기 제2연산함수 f2에 대한 상기 비포화 구간의 크기(Lns_f2)보다 크다.
본 발명의 일 실시예에서, 제1출력채널의 출력 액티베이션(751)의 각 요소는 제1스케일(S1)으로 표현되고, 제2출력채널의 출력 액티베이션(754)의 각 요소는 제2스케일(S2)로 표현될 수 있다. 이때, 상기 제1연산함수 f1에 대한 상기 비포화 구간의 크기(Lns_f1)가 상기 제2연산함수 f2에 대한 상기 비포화 구간의 크기(Lns_f2)보다 큰 경우, 상기 제1스케일은 상기 제2스케일보다 크게 결정되는 것이 유리하다는 점을 이해할 수 있다. 이는, 특히, 제1출력채널의 출력 액티베이션(751)의 각 요소 및 제2출력채널의 출력 액티베이션(754)의 각 요소를 표현하는 비트수가 서로 동일한 경우에 유용하다.
도 8d는 서로 다른 출력채널의 출력 액티베이션이 서로 다른 스케일로 표현되어야 하는 또 다른 이유를 설명하기 위한 것이다.
도 8d의 상측부(top)는 제1출력채널의 출력 액티베이션(751)이 제1연산부(210)가 제공하는 제1연산함수 f1(i)에 입력되는 상황을 나타낸 것이고, 도 8d의 하측부(bottom)는 제2출력채널의 출력 액티베이션(754)이 제2연산부(220)가 제공하는 제2연산함수 f2(i)에 입력되는 상황을 나타낸 것이다.
이때, 상기 제2연산함수는 음의 입력값에 대하여 포화(saturation)될 뿐만 아니라 양의 입력값에 대하여도 포화되는 함수이다. 즉, 상기 제2연산함수는 양쪽 방향으로 포화되는 함수일 수 있다. 도 8d에서는 그 예시로서 f2(i)=Sigmoid(i)를 예시하였다.
그러나 상기 제1연산함수는 음의 입력값에 대하여 포화되지만 양의 입력값에 대하여는 포화되지 않는 함수이다. 즉, 상기 제1연산함수는 일측 방향으로만 포화되는 함수일 수 있다. 도 8d에서는 그 예시로서 f1(i)=Exponent(i)를 예시하였다.
이때, 상기 제2연산함수에 대하여, 도 8c에 설명한 것과 같이, 음의 입력에 대한 포화값 osl, 양의 입력에 대한 포화값 osr, 좌측 포화가 시작되는 입력값 isl, 그리고 우측 포화가 시작되는 입력값을 isr을 정의할 수 있다.
그러나 상기 제1연산함수에 대하여는 음의 입력에 대한 포화값 osl 및 좌측 포화가 시작되는 입력값 isl은 정의되지만, 양의 입력에 대한 포화값 osr 및 우측 포화가 시작되는 입력값 is은 정의되지 않는다.
도 8d에 제시한 예에서, 상기 제1연산함수 f1에 대한 상기 비포화 구간의 크기(Lns_f1)는 무한대이다. 따라서 도 8d에 제시한 예에서, 상기 제2연산함수 f2에 대한 상기 비포화 구간의 크기(Lns_f2)는 상기 제1연산함수 f1에 대한 상기 비포화 구간의 크기(Lns_f1)보다 작다.
본 발명의 일 실시예에서, 제1출력채널의 출력 액티베이션(751)의 각 요소는 제1스케일(S1)으로 표현되고, 제2출력채널의 출력 액티베이션(754)의 각 요소는 제2스케일(S2)로 표현될 수 있다. 이때, 상기 제1연산함수 f1에 대한 상기 비포화 구간의 크기(Lns_f1)가 상기 제2연산함수 f2에 대한 상기 비포화 구간의 크기(Lns_f2)보다 큰 경우, 상기 제1스케일은 상기 제2스케일보다 크게 결정되는 것이 유리하다는 점을 이해할 수 있다. 이는, 특히, 제1출력채널의 출력 액티베이션(751)의 각 요소 및 제2출력채널의 출력 액티베이션(754)의 각 요소를 표현하는 비트수가 서로 동일한 경우에 유용하다.
도 8e는 서로 다른 출력채널의 출력 액티베이션이 서로 다른 스케일로 표현되어야 하는 또 다른 이유를 설명하기 위한 것이다.
도 8e의 상측부(top)는 제1출력채널의 출력 액티베이션(751)이 제1연산부(210)가 제공하는 제1연산함수 f1(i)에 입력되는 상황을 나타낸 것이고, 도 8e의 하측부(bottom)는 제2출력채널의 출력 액티베이션(754)이 제2연산부(220)가 제공하는 제2연산함수 f2(i)에 입력되는 상황을 나타낸 것이다.
이때, 상기 제2연산함수는 음의 입력값에 대하여 포화(saturation)될 뿐만 아니라 양의 입력값에 대하여도 포화되는 함수이다. 즉, 상기 제2연산함수는 양쪽 방향으로 포화되는 함수일 수 있다. 도 8e에서는 그 예시로서 f2(i)=Sigmoid(i)를 예시하였다.
그러나 상기 제1연산함수는 음의 입력값에 대하도 포화되지 않고 양의 입력값에 대하여는 포화되지 않는 함수이다. 도 8e에서는 그 예시로서 f1(i)=i를 예시하였다.
이때, 상기 제2연산함수에 대하여, 도 8c에 설명한 것과 같이, 음의 입력에 대한 포화값 osl, 양의 입력에 대한 포화값 osr, 좌측 포화가 시작되는 입력값 isl, 그리고 우측 포화가 시작되는 입력값을 isr을 정의할 수 있다.
그러나 상기 제1연산함수에 대하여는 음의 입력에 대한 포화값 osl, 양의 입력에 대한 포화값 osr, 좌측 포화가 시작되는 입력값 isl, 그리고 우측 포화가 시작되는 입력값을 isr이 정의되지 않는다.
도 8e에 제시한 예에서, 상기 제1연산함수 f1에 대한 상기 비포화 구간의 크기(Lns_f1)는 무한대이다. 따라서 도 8e에 제시한 예에서, 상기 제2연산함수 f2에 대한 상기 비포화 구간의 크기(Lns_f2)는 상기 제1연산함수 f1에 대한 상기 비포화 구간의 크기(Lns_f1)보다 작다.
본 발명의 일 실시예에서, 제1출력채널의 출력 액티베이션(751)의 각 요소는 제1스케일(S1)으로 표현되고, 제2출력채널의 출력 액티베이션(754)의 각 요소는 제2스케일(S2)로 표현될 수 있다. 이때, 상기 제1연산함수 f1에 대한 상기 비포화 구간의 크기(Lns_f1)가 상기 제2연산함수 f2에 대한 상기 비포화 구간의 크기(Lns_f2)보다 큰 경우, 상기 제1스케일은 상기 제2스케일보다 크게 결정되는 것이 유리하다는 점을 이해할 수 있다. 이는, 특히, 제1출력채널의 출력 액티베이션(751)의 각 요소 및 제2출력채널의 출력 액티베이션(754)의 각 요소를 표현하는 비트수가 서로 동일한 경우에 유용하다.
도 9a는 본 발명의 일 실시예에 따라 입력 액티베이션을 연산하는 방법을 나타낸 순서도이다.
본 발명의 일 실시예에 따라 입력 액티베이션을 연산하는 방법은, 아래 단계들을 포함할 수 있다.
단계(S110)에서, 제1입력 데이터를 입력채널 별로 스플릿 하여 얻은 제1세트의 제1스플릿 데이터를 준비할 수 있다. 여기서 상기 제1입력 데이터는 신경망의 특정 레이어에 입력되는 입력 액티베이션을 의미할 수 있다.
단계(S121)에서, 복수 개의 출력채널들로 구성된 제2입력 데이터 중 제1출력채널을 상기 입력채널 별로 스플릿 하여 얻은 제1세트의 제2스플릿 데이터를 준비할 수 있다. 여기서 상기 제2입력 데이터는 상기 특정 레이어에서 사용되는 커널, 또는 가중치일 수 있다.
단계(S122)에서, 상기 제2입력 데이터(커널, 또는 가중치) 중 제2출력채널을 상기 입력채널 별로 스플릿 하여 얻은 제2세트의 제2스플릿 데이터를 준비할 수 있다.
단계(S131)에서, 상기 제1세트의 제1스플릿 데이터와 상기 제1세트의 제2스플릿 데이터를 입력채널 별로 콘볼루션 하여, 제1출력채널의 콘볼루션 데이터를 생성할 수 있다. 여기서 상기 제1출력채널의 콘볼루션 데이터는 상기 레이어가 출력하는 출력 액티베이션 중 제1출력채널의 출력 액티베이션을 의미할 수 있다.
단계(S132)에서, 상기 제1세트의 제1스플릿 데이터와 상기 제2세트의 제2스플릿 데이터를 입력채널 별로 콘볼루션 하여, 제2출력채널의 콘볼루션 데이터를 생성할 수 있다. 여기서 상기 제2출력채널의 콘볼루션 데이터는 상기 레이어가 출력하는 출력 액티베이션 중 제2출력채널의 출력 액티베이션을 의미할 수 있다.
단계(S141)에서, 상기 제1출력채널의 콘볼루션 데이터에 대하여 제1연산함수를 적용하여 제1연산데이터를 생성할 수 있다.
단계(S142)에서, 상기 제2출력채널의 콘볼루션 데이터에 대하여 제2연산함수를 적용하여 제2연산데이터를 생성할 수 있다.
이때, 상기 제1출력채널의 콘볼루션 데이터와 상기 제2출력채널의 콘볼루션 데이터는 상기 레이어가 출력하는 출력 액티베이션을 구성할 수 있다. 상기 출력 액티베이션은 상기 제1출력채널 및 상기 제2출력채널이 아닌 다른 출력채널의 콘볼루션 데이터를 포함할 수 있다.
상기 단계(S121)와 단계(S122)는 병렬로 처리될 수도 있다.
상기 단계(S131)와 단계(S132)는 병렬로 처리될 수도 있다.
상기 단계(S141)와 단계(S142)는 병렬로 처리될 수도 있다.
도 9b는 각 출력채널의 콘볼루션 데이터를 생성하는 방법을 나타낸 순서도이다.
상기 제1출력채널의 콘볼루션 데이터(=제1출력채널의 출력 액티베이션)를 생성하는 단계(S131)는, 상기 제1세트의 제2스플릿 데이터를 제1스케일로 표현한 값을 생성하는 단계(S1311); 및 상기 제1스케일로 표현된 상기 제1세트의 제2스플릿 데이터를 상기 제1세트의 제1스플릿 데이터와 입력채널 별로 콘볼루션 하여 상기 제1출력채널의 콘볼루션 데이터를 생성하는 단계(S1312)를 포함할 수 있다.
상기 제2출력채널의 콘볼루션 데이터(=제2출력채널의 출력 액티베이션)를 생성하는 단계(S132)는, 상기 제2세트의 제2스플릿 데이터를 제2스케일로 표현한 값을 생성하는 단계(S1321); 및 상기 제2스케일로 표현된 상기 제2세트의 제2스플릿 데이터를 상기 제1세트의 제1스플릿 데이터와 입력채널 별로 콘볼루션 하여 상기 제2출력채널의 콘볼루션 데이터를 생성하는 단계(S1322)를 포함할 수 있다.
이때, 상기 제1연산함수와 상기 제2연산함수는 서로 다른 연산함수이고, 상기 제1스케일과 상기 제2스케일은 서로 다른 값일 수 있다.
이때, 상기 제1연산함수에 입력되는 제1입력데이터(ex 751)에 대해 요구되는 스케일이, 상기 제2연산함수에 입력되는 제2입력데이터(ex 752)에 대해 요구되는 스케일보다 큰 경우, 상기 제1스케일은 상기 제2스케일보다 클 수 있다.
이와 달리, 상기 제1연산함수에 입력되는 제1입력데이터(ex 751)에 대해 요구되는 스케일이, 상기 제2연산함수에 입력되는 제2입력데이터(ex 752)에 대해 요구되는 스케일보다 작은 경우, 상기 제1스케일은 상기 제2스케일보다 작을 수 있다.
일 실시예에서, 상기 제1연산함수 또는 상기 제2연산함수와 같은 특정 연산함수에 입력되는 입력데이터에 대해 요구되는 스케일의 크기는 다음과 같은 특성을 가질 수 있다.
우선, 상기 제1입력데이터의 제1구간에 대하여 상기 제1연산함수의 도함수(derived function, derivatives)가 정의될 수 있다고 가정한다. 또한, 상기 제2입력데이터의 제2구간에 대하여 상기 제2연산함수의 도함수가 정의될 수 있다고 가정한다.
예컨대 도 7a에는 Sigmoid 함수와 이에 대한 도함수가 도시되어 있고, 도 7b에는 Exponent 함수와 이에 대한 도함수가 도시되어 있다. 도 10a도 상기 Sigmoid의 도함수가 도시되어 있고, 도 10b에도 상기 Exponent 함수의 도함수가 도시되어 있다.
일 실시예에서, 상기 제1구간은 상기 제1입력데이터의 대부분의 값이 몰려 있는 구간을 의미하고, 상기 제2구간은 상기 제2입력데이터의 대부분의 값이 몰려 있는 구간을 의미할 수 있다. 이에 대한 간단한 예를 도 10a 및 도 10b에 제시하였다.
도 10a는 상기 제1입력데이터의 분포를 예시한 것이다. 여기서 상기 제1입력데이터의 대부분이 값이 몰려 있는 구간은 [a1~a3]이다. 예컨대 상기 제1입력데이터가 총 1000개의 값들로 이루어져 있고, 이 중 x1%(ex: 90%)가 구간 [a1~a3]에 존재한다면, 상기 제1구간은 구간 [a1~a3]일 수 있다.
도 10b는 상기 제2입력데이터의 분포를 예시한 것이다. 여기서 상기 제2입력데이터의 대부분이 값이 몰려 있는 구간은 [-a1~a3]이다. 예컨대 상기 제2입력데이터가 총 1000개의 값들로 이루어져 있고, 이 중 x2%(ex: 90%)가 구간 [-a1~a3]에 존재한다면, 상기 제2구간은 구간 [-a1~a3]일 수 있다.
도 10a 및 도 10b와는 다른 실시예에서, 상기 제1구간 및 상기 제2구간은 상기 제1입력데이터 및 상기 제2입력데이터의 통계와 무관하게 미리 결정된 구간일 수도 있다.
이때, 상기 제1구간에서의 상기 제1도함수의 값의 절대 값의 적분 값을 제1적분 값이라고 정의할 수 있고(도 10a의 빗금부분 참고), 상기 제2구간에서의 상기 제2도함수의 값의 절대 값의 적분 값을 제2적분 값이라고 정의할 수 있다(도 10b의 빗금부분 참고).
이때, 도 10a 및 도 10b에 나타낸 예와 같이, 상기 제2적분 값이 상기 제1적분 값보다 크다면, 상기 제2구간에서의 상기 제2연산함수의 입력에 대한 출력의 변화율의 평균값(=평균 변화율, 평균 기울기)이 상기 제1구간에서의 제1연산함수의 입력에 대한 출력의 변화율의 평균값(=평균 변화율, 평균 기울기)보다 크다는 것을 의미할 수 있다. 즉, 상기 제1입력데이터 중 관심 있는 구간인 상기 제1구간에서의 상기 제1연산함수의 입출력 간 에러 증폭률보다, 상기 제2입력데이터 중 관심 있는 구간인 상기 제2구간에서의 상기 제2연산함수의 입출력 간 에러 증폭률이 더 크다는 것을 의미할 수 있다. 따라서 이러한 연산함수들의 출력값들이 갖는 양자화 에러의 수준을 평탄화하기 위하여, 상기 제2연산함수에 입력되는 입력데이터에 대해 요구되는 제2스케일의 크기를 상기 제1연산함수에 입력되는 입력데이터에 대해 요구되는 제1스케일의 크기보다 작은 값으로 결정할 수 있다.
도 10a 및 도 10b에 나타낸 예와는 달리, 상기 제1적분 값이 상기 제2적분 값보다 크다면, 상기 제1구간에서의 상기 제1연산함수의 입력에 대한 출력의 변화율의 평균값이 상기 제2구간에서의 제2연산함수의 입력에 대한 출력의 변화율의 평균값보다 크다는 것을 의미할 수 있다. 즉, 상기 제2입력데이터 중 관심 있는 구간인 상기 제2구간에서의 상기 제2연산함수의 입출력 간 에러 증폭률보다, 상기 제1입력데이터 중 관심 있는 구간인 상기 제1구간에서의 상기 제1연산함수의 입출력 간 에러 증폭률이 더 크다는 것을 의미할 수 있다. 따라서 이러한 연산함수들의 출력값들이 갖는 양자화 에러의 수준을 평탄화하기 위하여, 상기 제1연산함수에 입력되는 입력데이터에 대해 요구되는 제1스케일의 크기를 상기 제2연산함수에 입력되는 입력데이터에 대해 요구되는 제2스케일의 크기보다 작은 값으로 결정할 수 있다.
도 11은 본 발명의 다른 실시예에 따라 입력 액티베이션을 연산하는 방법을 나타낸 순서도이다.
단계(S200)에서, 제1연산함수가 요구하는 입력데이터의 스케일인 제1스케일 및 제2연산함수가 요구하는 입력데이터의 스케일인 제2스케일을 획득할 수 있다.
단계(210)에서, 제1입력 데이터를 입력채널 별로 스플릿 하여 얻은 제1세트의 제1스플릿 데이터를 준비할 수 있다. 여기서 상기 제1입력 데이터는 신경망의 특정 레이어에 입력되는 입력 액티베이션을 의미할 수 있다.
단계(S220)에서, 복수 개의 출력채널들로 구성된 제2입력 데이터 중 제1출력채널을 상기 입력채널 별로 스플릿 하여 얻은 제1세트의 제2스플릿 데이터를 준비하고, 상기 제2입력 데이터 중 제2출력채널을 상기 입력채널 별로 스플릿 하여 얻은 제2세트의 제2스플릿 데이터를 준비할 수 있다. 여기서 상기 제2입력 데이터는 상기 특정 레이어에서 사용되는 커널, 또는 가중치일 수 있다.
단계(S230)에서, 상기 제1세트의 제2스플릿 데이터를 제1스케일로 표현한 값을 생성하고, 상기 제2세트의 제2스플릿 데이터를 제2스케일로 표현한 값을 생성할 수 있다.
단계(240)에서, 상기 제1스케일로 표현된 상기 제1세트의 제2스플릿 데이터를 상기 제1세트의 제1스플릿 데이터와 입력채널 별로 콘볼루션 하여 상기 제1출력채널의 콘볼루션 데이터를 생성하고, 상기 제2스케일로 표현된 상기 제2세트의 제2스플릿 데이터를 상기 제1세트의 제1스플릿 데이터와 입력채널 별로 콘볼루션 하여 상기 제2출력채널의 콘볼루션 데이터를 생성할 수 있다.
단계(S250)에서, 상기 제1출력채널의 콘볼루션 데이터에 대하여 제1연산함수를 적용하여 제1연산데이터를 생성하고, 상기 제2출력채널의 콘볼루션 데이터에 대하여 제2연산함수를 적용하여 제2연산데이터를 생성할 수 있다.
이때, 상기 제1출력채널의 콘볼루션 데이터와 상기 제2출력채널의 콘볼루션 데이터는 상기 레이어가 출력하는 출력 액티베이션을 구성할 수 있다. 상기 출력 액티베이션은 상기 제1출력채널 및 상기 제2출력채널이 아닌 다른 출력채널의 콘볼루션 데이터를 포함할 수 있다.
이때, 일 실시예에서, 상기 제1연산함수, 상기 제2연산함수, 상기 제1스케일, 및 상기 제2스케일은 다음과 같은 특성을 가질 수 있다.
주어진 제1구간에서, 상기 제1연산함수의 도함수인 제1도함수의 값의 절대 값의 적분 값을 제1적분 값이라고 정의할 수 있다. 그리고 주어진 제2구간에서, 상기 제2연산함수의 도함수인 제2도함수의 값의 절대 값의 적분 값을 제2적분 값이라고 정의할 수 있다.
이때, 상기 제2적분 값이 상기 제1적분 값보다 크다면, 상기 제1연산함수와 상기 제2연산함수의 출력값들이 갖는 양자화 에러의 수준을 평탄화하기 위하여, 상기 제2연산함수에 입력되는 입력데이터에 대해 요구되는 제2스케일의 크기를 상기 제1연산함수에 입력되는 입력데이터에 대해 요구되는 제1스케일의 크기보다 작은 값으로 결정할 수 있다.
이와 달리, 상기 제1적분 값이 상기 제2적분 값보다 크다면, 상기 제2연산함수와 상기 제1연산함수의 출력값들이 갖는 양자화 에러의 수준을 평탄화하기 위하여, 상기 제1연산함수에 입력되는 입력데이터에 대해 요구되는 제1스케일의 크기를 상기 제2연산함수에 입력되는 입력데이터에 대해 요구되는 제2스케일의 크기보다 작은 값으로 결정할 수 있다.
도 12는 본 발명의 일 실시예에 따라 제공되는 데이터 연산방법을 나타낸 순서도이다.
본 발명의 일 실시예에 따라 제공되는 데이터 연산방법은 이미지 변환방법일 수 있다. 상기 이미지 변환방법은 다음 단계들을 포함할 수 있다.
단계(S310)에서, 컴퓨팅 장치가, 제1입력 데이터와 제2입력 데이터로부터 제1출력채널의 출력데이터 및 제2출력채널의 출력데이터를 포함하는 출력 데이터를 생성할 수 있다.
단계(S320)에서, 상기 컴퓨팅 장치가, 상기 제1출력채널의 출력데이터에 대하여 제1연산함수를 적용하여 제1연산데이터를 생성하고, 상기 제2출력채널의 출력데이터에 대하여 제2연산함수를 적용하여 제2연산데이터를 생성할 수 있다.
이때, 상기 제1출력채널의 출력데이터와 상기 제2출력채널의 출력데이터는 서로 다른 스케일로 표현된 것일 수 있다.
그리고 상기 제1입력 데이터는 신경망의 특정 레이어에 입력되는 입력 액티베이션이고, 상기 제2입력 데이터는 상기 신경망의 상기 특정 레이어에 입력되는 가중치 또는 커널일 수 있다.
단계(S330)에서, 상기 컴퓨팅 장치가, 상기 생성한 제1연산데이터 및 제2연산데이터를 휘발성 메모리 또는 비휘발성 메모리에 저장할 수 있다.
단계(S340)에서, 상기 컴퓨팅 장치가, 상기 저장된 상기 제1연산데이터 및 상기 제2연산데이터를 이용하여 상기 신경망의 출력값을 산출할 수 있다.
단계(S350)에서, 상기 컴퓨팅 장치가, 상기 산출된 상기 신경망의 출력값을 이용하여 상기 컴퓨팅 장치에 저장되어 있는 소정의 이미지를 변환할 수 있다.
상술한 본 발명의 실시예들을 이용하여, 본 발명의 기술분야에 속하는 자들은 본 발명의 본질적인 특성에서 벗어나지 않는 범위 내에 다양한 변경 및 수정을 용이하게 실시할 수 있을 것이다. 특허청구범위의 각 청구항의 내용은 본 명세서를 통해 이해할 수 있는 범위 내에서 인용관계가 없는 다른 청구항에 결합될 수 있다.

Claims (15)

  1. 컴퓨팅 장치가, 제1입력 데이터와 제2입력 데이터로부터 제1출력채널의 출력데이터 및 제2출력채널의 출력데이터를 포함하는 출력 데이터를 생성하는 단계; 및
    상기 컴퓨팅 장치가, 상기 제1출력채널의 출력데이터에 대하여 제1연산함수를 적용하여 제1연산데이터를 생성하고, 상기 제2출력채널의 출력데이터에 대하여 제2연산함수를 적용하여 제2연산데이터를 생성하는 단계;
    를 포함하며,
    상기 제1출력채널의 출력데이터와 상기 제2출력채널의 출력데이터는 서로 다른 스케일로 표현된 것을 특징으로 하는,
    데이터 연산방법.
  2. 제1항에 있어서, 상기 제1연산함수의 비포화 구간의 크기가 상기 제2연산함수의 비포화 구간의 크기보다 큰 경우, 상기 제1스케일은 상기 제2스케일보다 큰 것을 특징으로 하는, 데이터 연산방법.
  3. 제2항에 있어서, 상기 제1출력채널의 출력데이터를 표현하는 비트수와 상기 제2출력채널의 출력데이터를 표현하는 비트수와 동일한 것을 특징으로 하는, 데이터 연산방법.
  4. 제1항에 있어서,
    상기 제2입력 데이터는 상기 제1출력채널 및 상기 제2출력채널을 포함하는 복수 개의 출력채널들로 구성되어 있으며,
    상기 출력 데이터를 생성하는 단계는,
    상기 컴퓨팅 장치가, 상기 제1입력 데이터를 입력채널 별로 스플릿 하여 얻은 제1세트의 제1스플릿 데이터를 준비하는 제1단계;
    상기 컴퓨팅 장치가, 상기 제2입력 데이터 중 상기 제1출력채널을 상기 입력채널 별로 스플릿 하여 얻은 제1세트의 제2스플릿 데이터를 준비하고, 상기 제2입력 데이터 중 상기 제2출력채널을 상기 입력채널 별로 스플릿 하여 얻은 제2세트의 제2스플릿 데이터를 준비하는 제2단계; 및
    상기 컴퓨팅 장치가, 상기 제1세트의 제2스플릿 데이터를 상기 제1세트의 제1스플릿 데이터와 입력채널 별로 콘볼루션 하여 상기 제1출력채널의 출력데이터를 생성하고, 상기 제2세트의 제2스플릿 데이터를 상기 제1세트의 제1스플릿 데이터와 입력채널 별로 콘볼루션 하여 상기 제2출력채널의 출력데이터를 생성하는 제3단계;
    를 포함하는,
    데이터 연산방법.
  5. 제4항에 있어서,
    상기 제2단계는, 상기 컴퓨팅 장치가, 상기 제1세트의 제2스플릿 데이터를 제1스케일로 표현하여 준비하고, 상기 제2세트의 제2스플릿 데이터를 제2스케일로 표현하여 준비하는 단계를 포함하는,
    데이터 연산방법.
  6. 제5항에 있어서,
    상기 제2연산함수에 입력되는 입력데이터의 상기 제2연산함수의 입력에 대한 출력의 평균변화율이 상기 제1연산함수에 입력되는 입력데이터의 상기 제1연산함수의 입력에 대한 출력의 평균변화율보다 큰 경우, 상기 제2스케일은 상기 제1스케일보다 작은 값을 갖는 것을 특징으로 하는,
    데이터 연산방법.
  7. 제1항에 있어서,
    상기 제1입력 데이터는 신경망의 특정 레이어에 입력되는 입력 액티베이션이고,
    상기 제2입력 데이터는 상기 신경망의 상기 특정 레이어에 입력되는 가중치 또는 커널인 것을 특징으로 하는,
    데이터 연산방법.
  8. 제7항에 있어서,
    상기 컴퓨팅 장치가, 상기 생성한 제1연산데이터 및 제2연산데이터를 휘발성 메모리 또는 비휘발성 메모리에 저장하는 단계;
    상기 컴퓨팅 장치가, 상기 저장된 상기 제1연산데이터 및 상기 제2연산데이터를 이용하여 상기 신경망의 출력값을 산출하는 단계; 및
    상기 컴퓨팅 장치가, 상기 산출된 상기 신경망의 출력값을 이용하여 상기 컴퓨팅 장치에 저장되어 있는 소정의 이미지를 변환하는 단계;
    를 더 포함하는,
    데이터 연산방법.
  9. 제4항에 있어서,
    상기 출력 데이터를 생성하는 단계 이전에, 상기 컴퓨팅 장치가, 상기 제1연산함수가 요구하는 입력데이터의 제1스케일 및 상기 제2연산함수가 요구하는 입력데이터의 스케일을 메모리로부터 탐색하여 획득하는 단계;를 더 포함하고,
    상기 제1단계와 상기 제2단계 사이에, 상기 컴퓨팅 장치가, 상기 제1세트의 제2스플릿 데이터를 상기 제1스케일로 표현한 값을 생성하고, 상기 제2세트의 제2스플릿 데이터를 상기 제2스케일로 표현한 값을 생성하는 단계를 더 포함하는,
    데이터 연산방법.
  10. 휘발성 메모리를 포함하는 하드웨어 가속기 및 비휘발성 메모리를 포함하는 컴퓨팅 장치로서,
    상기 하드웨어 가속기가,
    상기 휘발성 메모리 및 상기 비휘발성 메모리 중 적어도 하나로부터 제1입력 데이터와 제2입력 데이터를 읽는 단계;
    상기 제1입력 데이터와 상기 제2입력 데이터로부터 제1출력채널의 출력데이터 및 제2출력채널의 출력데이터를 포함하는 출력 데이터를 생성하는 단계; 및
    상기 제1출력채널의 출력데이터에 대하여 제1연산함수를 적용하여 제1연산데이터를 생성하고, 상기 제2출력채널의 출력데이터에 대하여 제2연산함수를 적용하여 제2연산데이터를 생성하는 단계;
    를 실행하도록 되어 있고,
    상기 제1출력채널의 출력데이터와 상기 제2출력채널의 출력데이터는 서로 다른 스케일로 표현된 것을 특징으로 하는,
    컴퓨팅 장치.
  11. 제10항에 있어서, 상기 제1연산함수의 비포화 구간의 크기가 상기 제2연산함수의 비포화 구간의 크기보다 큰 경우, 상기 제1스케일은 상기 제2스케일보다 큰 것을 특징으로 하는, 컴퓨팅 장치.
  12. 제11항에 있어서, 상기 제1출력채널의 출력데이터를 표현하는 비트수와 상기 제2출력채널의 출력데이터를 표현하는 비트수와 동일한 것을 특징으로 하는, 컴퓨팅 장치.
  13. 제10항에 있어서,
    상기 제2입력 데이터는 상기 제1출력채널 및 상기 제2출력채널을 포함하는 복수 개의 출력채널들로 구성되어 있으며,
    상기 출력 데이터를 생성하는 단계는,
    상기 제1입력 데이터를 입력채널 별로 스플릿 하여 얻은 제1세트의 제1스플릿 데이터를 준비하는 제1단계;
    상기 제2입력 데이터 중 상기 제1출력채널을 상기 입력채널 별로 스플릿 하여 얻은 제1세트의 제2스플릿 데이터를 준비하고, 상기 제2입력 데이터 중 상기 제2출력채널을 상기 입력채널 별로 스플릿 하여 얻은 제2세트의 제2스플릿 데이터를 준비하는 제2단계; 및
    상기 제1세트의 제2스플릿 데이터를 상기 제1세트의 제1스플릿 데이터와 입력채널 별로 콘볼루션 하여 상기 제1출력채널의 출력데이터를 생성하고, 상기 제2세트의 제2스플릿 데이터를 상기 제1세트의 제1스플릿 데이터와 입력채널 별로 콘볼루션 하여 상기 제2출력채널의 출력데이터를 생성하는 제3단계;
    를 포함하는,
    컴퓨팅 장치.
  14. 제13항에 있어서,
    상기 제2단계는, 상기 제1세트의 제2스플릿 데이터를 제1스케일로 표현하여 준비하고, 상기 제2세트의 제2스플릿 데이터를 제2스케일로 표현하여 준비하는 단계를 포함하는,
    컴퓨팅 장치.
  15. 제10항에 있어서,
    상기 제1입력 데이터는 신경망의 특정 레이어에 입력되는 입력 액티베이션이고, 상기 제2입력 데이터는 상기 신경망의 상기 특정 레이어에 입력되는 가중치 또는 커널이며,
    상기 하드웨어 가속기가,
    상기 생성한 제1연산데이터 및 제2연산데이터를 상기 휘발성 메모리 및 상기 비휘발성 메모리 중 적어도 어느 하나에 저장하는 단계;
    상기 저장된 상기 제1연산데이터 및 상기 제2연산데이터를 이용하여 상기 신경망의 출력값을 산출하는 단계; 및
    상기 산출된 상기 신경망의 출력값을 이용하여 상기 컴퓨팅 장치에 저장되어 있는 소정의 이미지를 변환하는 단계;
    를 더 실행하도록 되어 있는,
    컴퓨팅 장치.
PCT/KR2022/021109 2022-07-12 2022-12-22 데이터 스케일을 고려한 콘볼루션 데이터의 양자화 방법, 이를 위한 하드웨어 가속기, 및 이를 이용한 컴퓨팅 장치 WO2024014631A1 (ko)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR10-2022-0085968 2022-07-12
KR1020220085968A KR20240008747A (ko) 2022-07-12 2022-07-12 데이터 스케일을 고려한 콘볼루션 데이터의 양자화 방법, 이를 위한 하드웨어 가속기, 및 이를 이용한 컴퓨팅 장치

Publications (1)

Publication Number Publication Date
WO2024014631A1 true WO2024014631A1 (ko) 2024-01-18

Family

ID=89536782

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2022/021109 WO2024014631A1 (ko) 2022-07-12 2022-12-22 데이터 스케일을 고려한 콘볼루션 데이터의 양자화 방법, 이를 위한 하드웨어 가속기, 및 이를 이용한 컴퓨팅 장치

Country Status (2)

Country Link
KR (1) KR20240008747A (ko)
WO (1) WO2024014631A1 (ko)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200097826A1 (en) * 2017-05-23 2020-03-26 Shanghai Cambricon Information Technology Co., Ltd. Processing method and accelerating device
KR20200079059A (ko) * 2018-12-24 2020-07-02 삼성전자주식회사 비트 연산 기반의 뉴럴 네트워크 처리 방법 및 장치
KR102152615B1 (ko) * 2019-12-26 2020-09-08 주식회사 마크애니 활성화 함수를 사용하는 딥러닝 모델의 안정적인 학습을 위한 가중치 초기화 방법 및 장치
KR102395744B1 (ko) * 2021-09-16 2022-05-09 오픈엣지테크놀로지 주식회사 데이터 스케일을 고려한 덧셈 연산 방법 및 이를 위한 하드웨어 가속기, 이를 이용한 컴퓨팅 장치

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200097826A1 (en) * 2017-05-23 2020-03-26 Shanghai Cambricon Information Technology Co., Ltd. Processing method and accelerating device
KR20200079059A (ko) * 2018-12-24 2020-07-02 삼성전자주식회사 비트 연산 기반의 뉴럴 네트워크 처리 방법 및 장치
KR102152615B1 (ko) * 2019-12-26 2020-09-08 주식회사 마크애니 활성화 함수를 사용하는 딥러닝 모델의 안정적인 학습을 위한 가중치 초기화 방법 및 장치
KR102395744B1 (ko) * 2021-09-16 2022-05-09 오픈엣지테크놀로지 주식회사 데이터 스케일을 고려한 덧셈 연산 방법 및 이를 위한 하드웨어 가속기, 이를 이용한 컴퓨팅 장치

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
QIANRU ZHANG; MENG ZHANG; TINGHUAN CHEN; ZHIFEI SUN; YUZHE MA; BEI YU: "Recent Advances in Convolutional Neural Network Acceleration", ARXIV.ORG, 23 July 2018 (2018-07-23), XP081117824 *

Also Published As

Publication number Publication date
KR20240008747A (ko) 2024-01-19

Similar Documents

Publication Publication Date Title
WO2020235797A1 (en) Apparatus for processing modular multiply operation and methods thereof
WO2021002719A1 (ko) 비디오 처리 방법 및 장치
WO2023153821A1 (en) Method of compressing neural network model and electronic apparatus for performing the same
EP3735662A1 (en) Method of performing learning of deep neural network and apparatus thereof
WO2023042989A1 (ko) 데이터 스케일을 고려한 덧셈 연산 방법 및 이를 위한 하드웨어 가속기, 이를 이용한 컴퓨팅 장치
WO2016159518A1 (ko) 비선형 데이터의 평균 계산 장치
EP3867824A1 (en) Electronic apparatus and control method thereof
WO2024014631A1 (ko) 데이터 스케일을 고려한 콘볼루션 데이터의 양자화 방법, 이를 위한 하드웨어 가속기, 및 이를 이용한 컴퓨팅 장치
WO2021125496A1 (ko) 전자 장치 및 그 제어 방법
WO2023229094A1 (ko) 행동 예측 방법 및 장치
WO2021246812A1 (ko) 딥러닝 nlp 모델을 활용한 뉴스 긍정도 분석 솔루션 및 장치
WO2011068315A2 (ko) 최대 개념강도 인지기법을 이용한 최적의 데이터베이스 선택장치 및 그 방법
WO2023003246A1 (ko) 멀티레벨 룩업테이블을 이용한 함수근사 장치 및 방법
WO2012169675A1 (ko) 누적 이동 평균에 기반하여 다원 탐색 트리의 노드를 분할하는 방법 및 장치
WO2024106556A1 (ko) 부동 소수점 데이터 압축을 위한 방법 및 장치
WO2021158040A1 (ko) 대화의 맥락에 대응하는 발화를 제공하는 전자 장치 및 이의 동작 방법
WO2021194105A1 (ko) 전문가 모사 모델 학습 방법 및 그 학습을 위한 장치
WO2022114451A1 (ko) 인공 신경망 학습 방법과 이를 이용한 발음 평가 방법
WO2024048868A1 (ko) 신경망에서의 연산방법 및 이를 위한 장치
WO2023043108A1 (ko) 아키텍처 확장을 통한 신경망의 유효 정밀도 향상 방법 및 장치
WO2022097954A1 (ko) 신경망 연산방법 및 신경망 가중치 생성방법
WO2024005590A1 (ko) 이미지 스케일링 장치 및 이미지 스케일링 방법
WO2022270815A1 (ko) 전자 장치 및 전자 장치의 제어 방법
WO2023146195A1 (ko) 이미지를 분류하는 서버 및 그 동작 방법
WO2024039047A1 (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: 22951286

Country of ref document: EP

Kind code of ref document: A1