KR102684061B1 - Quantizer And Quantization Method For Artificial Neural Networks - Google Patents

Quantizer And Quantization Method For Artificial Neural Networks

Info

Publication number
KR102684061B1
KR102684061B1 KR1020200135673A KR20200135673A KR102684061B1 KR 102684061 B1 KR102684061 B1 KR 102684061B1 KR 1020200135673 A KR1020200135673 A KR 1020200135673A KR 20200135673 A KR20200135673 A KR 20200135673A KR 102684061 B1 KR102684061 B1 KR 102684061B1
Authority
KR
South Korea
Prior art keywords
value
distance
quantization
quantum values
quantum
Prior art date
Application number
KR1020200135673A
Other languages
Korean (ko)
Other versions
KR20220051947A (en
Inventor
함범섭
김도형
이중협
Original Assignee
연세대학교 산학협력단
Filing date
Publication date
Application filed by 연세대학교 산학협력단 filed Critical 연세대학교 산학협력단
Priority to KR1020200135673A priority Critical patent/KR102684061B1/en
Publication of KR20220051947A publication Critical patent/KR20220051947A/en
Application granted granted Critical
Publication of KR102684061B1 publication Critical patent/KR102684061B1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N7/00Computing arrangements based on specific mathematical models
    • G06N7/01Probabilistic graphical models, e.g. probabilistic networks

Abstract

본 발명은 양자화 대상인 대상값을 인가받아 기지정된 범위로 정규화하여 정규화값을 출력하는 정규화부, 기지정된 다수의 양자값 중 정규화값에 가장 인접한 2개의 양자값을 선택하고, 선택된 2개의 양자값 각각과 정규화값 사이의 차에 따라 기지정된 방식으로 2개의 거리 기반 스코어를 계산하는 거리 스코어 계산부, 2개의 거리 기반 스코어에 2개의 양자값 각각을 커널 함수에 대입하여 획득되는 커널값을 가중한 가중 거리 기반 스코어를 소프트 아그맥스 함수에 대입하여 정규화값이 2개의 양자값 각각 분포할 확률을 나타내는 거리 기반 확률을 계산하고, 계산된 거리 기반 확률을 2개의 양자값에 가중합하여 양자화값을 획득하는 확률 분포 기반 양자화부를 포함하여, 미분 가능한 양자화를 수행할 수 있어 양자화에 따른 인공 신경망의 학습 오차를 최소화할 수 있고, 고속으로 학습을 수행할 수 있는 인공 신경망을 위한 양자화기 및 양자화 방법을 제공할 수 있다.The present invention includes a normalization unit that receives a target value subject to quantization, normalizes it to a predetermined range, and outputs a normalized value; selects the two quantum values closest to the normalized value among a plurality of predetermined quantum values; and each of the two selected quantum values. A distance score calculator that calculates two distance-based scores in a predetermined manner according to the difference between the and normalized values, and a weighted kernel value obtained by substituting each of the two quantum values into the kernel function for the two distance-based scores. Substituting the distance-based score into the soft agmax function calculates the distance-based probability, which represents the probability that the normalized value is distributed for each of the two quantum values, and calculates the probability of obtaining the quantized value by weighting the calculated distance-based probability to the two quantum values. Including a distribution-based quantization unit, differentiable quantization can be performed to minimize learning errors in artificial neural networks due to quantization, and a quantizer and quantization method for artificial neural networks that can perform learning at high speed can be provided. there is.

Description

인공 신경망을 위한 양자화기 및 양자화 방법{Quantizer And Quantization Method For Artificial Neural Networks}Quantizer And Quantization Method For Artificial Neural Networks}

본 발명은 양자화기 및 양자화 방법에 관한 것으로, 인공 신경망을 위한 양자화기 및 양자화 방법에 관한 것이다.The present invention relates to a quantizer and a quantization method, and to a quantizer and a quantization method for an artificial neural network.

최근 인간의 두뇌가 패턴을 인식하는 방법을 모사하여 두뇌와 비슷한 방식으로 여러 정보를 처리하도록 구성된 인공 신경망(artificial neural network)에 대한 연구가 활발하게 진행되고 있다. 현재 인공 신경망은 객체 분류, 객체 검출, 음성 인식, 자연어 처리와 같은 매우 다양한 분야에서 적용되고 있을 뿐만 아니라 그 적용 분야가 계속 확장되어 가고 있다.Recently, research on artificial neural networks, which are designed to imitate the way the human brain recognizes patterns and process various information in a similar way to the brain, is being actively conducted. Currently, artificial neural networks are not only applied in a wide variety of fields such as object classification, object detection, speech recognition, and natural language processing, but their fields of application continue to expand.

이러한 인공 신경망은 입력맵(또는 특징맵)과 미리 학습에 의해 획득된 가중치맵 사이에 기지정된 연산을 수행하여 요구되는 동작을 수행한다. 이때 입력맵(또는 특징맵)과 가중치맵은 대부분 행렬(또는 벡터) 형식을 가지므로, 인공 신경망은 대량의 행렬 연산(예를 들면 컨볼루션 연산)을 요구하게 된다. 그리고 인공 신경망은 실제로 이용되기 이전에 대량의 반복 학습이 수행되어 가중치맵의 가중치가 업데이트되어야만 요구되는 성능을 나타낼 수 있다. 즉 인공 신경망은 학습 및 실제 운용 과정에서 대량의 행렬 연산이 수행되어야 한다. 그러므로 연산 효율성이 인공 신경망의 성능을 크게 좌우하게 된다. 그러나 일반적으로 가중치맵과 입력맵(또는 특징맵)의 각 원소인 가중치와 입력값은 부동 소수점(floating point) 형식의 값을 가지므로 연산 효율성이 낮다.This artificial neural network performs the required operation by performing a predetermined operation between the input map (or feature map) and the weight map obtained through pre-learning. At this time, since the input map (or feature map) and weight map mostly have a matrix (or vector) format, the artificial neural network requires a large amount of matrix operations (for example, convolution operations). And before it is actually used, the artificial neural network can achieve the required performance only when a large amount of iterative learning is performed and the weights of the weight map are updated. In other words, artificial neural networks must perform large amounts of matrix operations during learning and actual operation. Therefore, computational efficiency largely determines the performance of artificial neural networks. However, in general, the weights and input values, which are each element of the weight map and input map (or feature map), have values in floating point format, so computational efficiency is low.

이에 최근에는 인공 신경망에서 연산되어야 하는 가중치 또는 가중치와 입력값을 양자화하여 연산을 수행하도록 함으로써 연산 효율성을 향상시키고자 하는 연구가 활발하게 수행되고 있다.Accordingly, research has recently been actively conducted to improve computational efficiency by quantizing the weights or weights and input values that must be calculated in an artificial neural network.

도 1은 기존의 인공 신경망을 위한 양자화기의 개략적 구조를 나타낸다.Figure 1 shows a schematic structure of a quantizer for an existing artificial neural network.

도 1을 참조하면, 양자화기(100)는 정규화부(110), 양자화부(120)를 포함할 수 있다.Referring to FIG. 1, the quantizer 100 may include a normalization unit 110 and a quantization unit 120.

정규화부(110)는 양자화되어야 하는 대상인 대상값(x)을 인가받아 기지정된 범위로 정규화하여 정규화값(xn)을 출력한다.The normalization unit 110 receives the target value (x), which is to be quantized, and normalizes it to a predetermined range to output a normalized value (x n ).

양자화부(120)는 정규화부(110)에서 인가되는 정규화값(xn)을 기지정된 간격 단위로 이산 분포되어 있는 양자값(q = [0, 1, … 2k-1])과 비교하여 가장 인접한 양자값으로 변환하여 대상값(x)에 대응하는 양자화값(Q(xn))을 획득하여 출력한다. 일반적으로 양자화부(120)는 인가된 정규화값(xn)에 대해 부호 함수(signum function)나 반올림 함수(round function) 등을 이용하여 양자화값(Q(xn))을 획득할 수 있다.The quantization unit 120 compares the normalization value (x n ) applied from the normalization unit 110 with the quantum value (q = [0, 1, … 2 k -1]) that is discretely distributed at predetermined intervals. It is converted to the nearest quantum value, and the quantized value (Q(x n )) corresponding to the target value (x) is obtained and output. In general, the quantization unit 120 may obtain a quantization value (Q(x n )) using a sign function or a round function for the applied normalization value (x n ).

이와 같이, 양자화기(100)는 부동 소수점 형식의 대상값(x)을 양자화하여 양자화값(Q(xn))을 출력하여, 인공 신경망이 부동 소수점 형식이 아니라 기지정된 양자값(q) 중 하나로 변환된 양자화값(Q(xn))으로 연산을 수행할 수 있도록 함으로써, 인공 신경망의 연산 효율성을 향상시킬 수 있다.In this way, the quantizer 100 quantizes the target value (x) in floating point format and outputs a quantized value (Q(x n )), so that the artificial neural network is not in floating point format but in a predetermined quantum value (q). By allowing calculations to be performed with a quantized value (Q(x n )) converted into one, the computational efficiency of the artificial neural network can be improved.

다만 인공 신경망의 경우, 학습 시에 기지정된 방식으로 계산되는 손실(L)을 역전파(Backward propagation)하여 가중치를 반복 업데이트하는 방식으로 수행되어야 한다. 이러한 역전파 방식의 학습 과정을 위해서는 양자화기가 손실 역전파(Loss Backpropagation)를 수행하여 가중치를 업데이트 수 있어야 하며, 손실 역전파를 위해서는 양자화기가 미분 가능한 함수의 형태로 양자화 연산을 수행해야 한다.However, in the case of artificial neural networks, the weights must be updated repeatedly by backpropagating the loss (L) calculated in a predetermined manner during learning. For this backpropagation learning process, the quantizer must be able to update the weights by performing loss backpropagation, and for loss backpropagation, the quantizer must perform a quantization operation in the form of a differentiable function.

그러나 양자화부(120)가 정규화값(xn)을 양자화값(Q(xn))으로 변환하는 연산은 부호 함수나 반올림 함수와 같은 이산 함수(discrete function)에 의한 연산으로 미분이 불가능하므로, 인공 신경망을 학습시킬 수 없다는 문제가 있다.However, the operation by which the quantization unit 120 converts the normalized value (x n ) into the quantized value (Q(x n )) is an operation using a discrete function such as a sign function or a rounding function, and thus cannot be differentiated. There is a problem that artificial neural networks cannot be trained.

도 2는 기존의 이산화부의 연산 함수와 이의 미분 함수 그래프의 일 예를 나타낸다.Figure 2 shows an example of a graph of an existing discretization operation function and its derivative function.

도 2의 (a)는 부호 함수를 이용하여 정규화값(xn)을 양자화값(Q(xn))으로 변환하는 그래프를 나타내고, (b)는 (a)의 부호 함수에 대한 미분 함수의 그래프를 나타낸다.Figure 2 (a) shows a graph converting a normalized value (x n ) into a quantized value (Q(x n )) using a sign function, and (b) shows a graph of the differential function for the sign function in (a). Shows a graph.

도 2의 (a)와 (b)에 도시된 바와 같이, 양자화부(120)가 이산 함수에 기반하여 정규화값(xn)을 부호 함수와 같은 양자화값(Q(xn))으로 변환하는 경우, 그에 대한 미분 함수는 (b)에 도시된 바와 같이, 정규화값(xn)이 0인 경우(xn = 0)를 제외(xn ≠ 0)하면 모두 0으로 출력되므로, 그래디언트 소실(gradient vanishing) 문제가 발생한다. 이로 인해 손실 역전파가 이루어 지지 않아 학습이 불가능한 문제가 있다.As shown in (a) and (b) of Figure 2, the quantization unit 120 converts the normalization value (x n ) into a quantization value (Q(x n )) such as a sign function based on a discrete function. In this case, as shown in (b), the differential function for it is output as 0 in all cases (x n ≠ 0) except when the normalization value (x n ) is 0 (x n = 0), so gradient disappearance ( A gradient vanishing problem occurs. Due to this, there is a problem that learning is impossible because loss backpropagation is not performed.

이러한 문제를 해결하기 위해 기존에는 (d)에 도시된 바와 같이, 손실 역전파 시, (b)의 미분 함수를 STE(Straight through estimator)로 대체하여 손실 역전파가 가능하도록 함으로써 인공 신경망이 학습될 수 있도록 하는 기법이 제안된 바 있다.To solve this problem, as shown in (d), during loss backpropagation, the differential function in (b) is replaced with STE (Straight through estimator) to enable loss backpropagation, so that the artificial neural network can be learned. A technique has been proposed to enable this.

그러나 STE는 (c)에 도시된 바와 같이, 하드 하이퍼볼릭 탄젠트(hard hyperbolic tangent: htanth)에 대한 미분 함수로서, 그래디언트를 기지정된 상수(여기서는 일 예로 1)로 균일하게 설정하여 역전파 가능하도록 대체한다. 그러나 STE로 미분 함수를 대체하는 것은 양자화를 위한 순방향 전파 시와 역전파 시에 서로 다른 함수를 사용하는 것을 의미한다. 이로 인해 그래디언트 불일치 문제가 발생하며, 그래디언트 불일치 문제는 손실 역전파 시에 추가적인 오차를 유발하여 인공 신경망의 학습 시에 특정값으로 수렴되어야 하는 가중치 데이터가 수렴되기 어렵도록 하여 학습 불안정성을 초래하는 문제가 있다. 이러한 학습 불안정성은 인공 신경망의 학습 정확도뿐만 아니라, 학습 속도를 저해하는 요인이 된다.However, as shown in (c), STE is a differential function for hard hyperbolic tangent (htanth), and can be replaced to enable backpropagation by uniformly setting the gradient to a predetermined constant (here, 1 as an example). do. However, replacing the differential function with STE means using different functions for forward propagation and back propagation for quantization. This causes a gradient mismatch problem, which causes additional errors during loss backpropagation, making it difficult for weight data that should converge to a specific value when training an artificial neural network, resulting in learning instability. there is. This learning instability is a factor that hinders not only the learning accuracy of artificial neural networks, but also the learning speed.

양자화기를 이산 함수를 대체하여 유사한 특성을 갖는 시그모이드(sigmoid) 함수 또는 하이퍼볼릭 탄젠트(hyperbolic tangent: tanth) 함수 등을 이용하여 양자화기의 동작을 대체하는 방법도 제안된 바 있으나, 이산 함수를 이용하는 이상적인 양자화기의 동작과는 차이가 있어 여전히 오차가 발생한다는 한계가 있다.A method has also been proposed to replace the operation of the quantizer by using a sigmoid function or hyperbolic tangent (tanth) function, which has similar characteristics, by replacing the quantizer with a discrete function. There is a limitation that errors still occur due to differences from the operation of the ideal quantizer used.

한국 공개 특허 제10-2019-0134965호 (2019.12.05 공개)Korean Patent Publication No. 10-2019-0134965 (published on December 5, 2019)

본 발명의 목적은 이산 함수 기반의 양자화 기법과 동일한 수준으로 양자화를 수행하면서도 미분 가능하여 손실 역전파가 가능한 양자화기 및 양자화 방법을 제공하는데 있다.The purpose of the present invention is to provide a quantizer and quantization method that performs quantization at the same level as a discrete function-based quantization technique and is differentiable, allowing lossy backpropagation.

본 발명의 다른 목적은 동일한 함수를 기반으로 양자화에 대한 순방향 및 역방향 전파를 수행할 수 있어 양자화에 따른 인공 신경망의 학습 오차를 최소화할 수 있고, 고속으로 학습을 수행할 수 있도록 하는 인공 신경망을 위한 양자화기 및 양자화 방법을 제공하는데 있다.Another object of the present invention is to provide an artificial neural network that can perform forward and backward propagation of quantization based on the same function, thereby minimizing the learning error of the artificial neural network due to quantization and performing learning at high speed. The purpose is to provide a quantizer and quantization method.

상기 목적을 달성하기 위한 본 발명의 일 실시예에 따른 인공 신경망을 위한 양자화기는 양자화 대상인 대상값을 인가받아 기지정된 범위로 정규화하여 정규화값을 출력하는 정규화부; 기지정된 다수의 양자값 중 상기 정규화값에 가장 인접한 2개의 양자값을 선택하고, 선택된 2개의 양자값 각각과 상기 정규화값 사이의 차에 따라 기지정된 방식으로 2개의 거리 기반 스코어를 계산하는 거리 스코어 계산부; 상기 2개의 거리 기반 스코어에 상기 2개의 양자값 각각을 커널 함수(Kernel function)에 대입하여 획득되는 커널값을 가중한 가중 거리 기반 스코어를 소프트 아그맥스 함수(soft argmax function)에 대입하여 상기 정규화값이 상기 2개의 양자값 각각 분포할 확률을 나타내는 거리 기반 확률을 계산하고, 계산된 거리 기반 확률을 상기 2개의 양자값에 가중합하여 양자화값을 획득하는 확률 분포 기반 양자화부를 포함한다.In order to achieve the above object, a quantizer for an artificial neural network according to an embodiment of the present invention includes a normalization unit that receives a target value to be quantized, normalizes it to a predetermined range, and outputs a normalized value; A distance score that selects the two quantum values closest to the normalized value among a plurality of predetermined quantum values and calculates two distance-based scores in a predetermined manner according to the difference between each of the two selected quantum values and the normalized value. calculator; The normalized value is obtained by substituting each of the two quantum values into the two distance-based scores into a kernel function and substituting the weighted distance-based score obtained by weighting the kernel value into the soft argmax function. It includes a probability distribution-based quantization unit that calculates a distance-based probability representing the distribution probability of each of the two quantum values, and obtains a quantization value by weighting the calculated distance-based probability to the two quantum values.

상기 확률 분포 기반 양자화부는 거리 기반 스코어에 가중되는 커널값의 가중 비중을 조절하기 위한 온도 파라미터를 상기 2개의 양자값 각각에 대한 거리 기반 스코어에 대응하는 커널값이 가중된 가중 거리 기반 스코어 사이의 차에 따라 계산하는 온도 파라미터 계산부; 상기 온도 파라미터에 따른 비중으로 커널값이 가중된 가중 거리 기반 스코어를 소프트 아그맥스 함수에 대입하여 상기 2개의 양자값 각각에 대한 거리 기반 확률을 계산하는 확률 분포 계산부; 및 상기 온도 파라미터에 의해 발생되는 양자화 오차가 제거되도록 상기 2개의 양자값을 상기 온도 파라미터에 대응하여 변형하고, 변형된 2개의 양자값에 상기 거리 기반 확률을 가중합하여 상기 양자화값을 획득하는 양자화값 획득부를 포함할 수 있다.The probability distribution-based quantization unit sets a temperature parameter for controlling the weighted proportion of the kernel value weighted to the distance-based score, and sets the difference between the weighted distance-based score weighted by the kernel value corresponding to the distance-based score for each of the two quantum values. A temperature parameter calculation unit that calculates according to; a probability distribution calculation unit that calculates a distance-based probability for each of the two quantum values by substituting a weighted distance-based score in which a kernel value is weighted by a ratio according to the temperature parameter into a soft agmax function; and a quantization value that transforms the two quantum values in response to the temperature parameter so that the quantization error caused by the temperature parameter is removed, and obtains the quantization value by adding the distance-based probability to the two transformed quantum values. It may include an acquisition unit.

상기 거리 스코어 계산부는 상기 2개의 거리 기반 스코어(n(xn,q))를 수학식 The distance score calculator calculates the two distance-based scores (n(x n , q)) using the equation

(여기서 xn은 정규화값이고, q는 양자값을 나타낸다.)에 따라 계산할 수 있다.(where x n is a normalized value and q represents a quantum value).

상기 온도 파라미터 계산부는 상기 온도 파라미터를 수학식 The temperature parameter calculation unit calculates the temperature parameter using a mathematical formula

(여기서 γ는 기지정된 상수값이며, qf, qc는 2개의 양자값이며, 은 선택된 2개의 양자값(qf, qc)에 대한 거리 기반 스코어와 커널값을 가중한 가중 거리 기반 스코어를 나타낸다.)에 따라 계산할 수 있다.(Here, γ is a known constant value, q f and q c are two quantum values, can be calculated according to the distance-based score for the two selected quantum values (q f , q c ) and the weighted distance-based score weighted by the kernel value.

상기 확률 분포 계산부는 상기 2개의 양자값 각각에 대한 거리 기반 확률()을 수학식 The probability distribution calculator is a distance-based probability for each of the two quantum values ( ) in the equation

(여기서 qi 는 2개의 양자값(qi ∈ (qf, qc))을 나타낸다)에 따라 계산할 수 있다.(where q i represents two quantum values (q i ∈ (q f , q c ))).

상기 양자화값 획득부는 2개의 양자값(qf, qc)을 수학식 The quantization value acquisition unit calculates two quantum values (q f , q c ) using the equation

따라 변형된 양자값(qf *, qc *)으로 변형할 수 있다.It can be transformed into modified quantum values (q f * , q c * ).

상기 양자화값 획득부는 상기 양자화값을 수학식 The quantization value acquisition unit calculates the quantization value using the equation

에 따라 획득할 수 있다.It can be obtained according to .

상기 목적을 달성하기 위한 본 발명의 다른 실시예에 따른 인공 신경망을 위한 양자화 방법은 양자화 대상인 대상값을 인가받아 기지정된 범위로 정규화하여 정규화값을 출력하는 단계; 기지정된 다수의 양자값 중 상기 정규화값에 가장 인접한 2개의 양자값을 선택하고, 선택된 2개의 양자값 각각과 상기 정규화값 사이의 차에 따라 기지정된 방식으로 2개의 거리 기반 스코어를 계산하는 단계; 상기 2개의 거리 기반 스코어에 상기 2개의 양자값 각각을 커널 함수에 대입하여 획득되는 커널값을 가중한 가중 거리 기반 스코어를 소프트 아그맥스 함수에 대입하여 상기 정규화값이 상기 2개의 양자값 각각 분포할 확률을 나타내는 거리 기반 확률을 계산하고, 계산된 거리 기반 확률을 상기 2개의 양자값에 가중합하여 양자화값을 획득하는 단계를 포함한다.In order to achieve the above object, a quantization method for an artificial neural network according to another embodiment of the present invention includes the steps of receiving a target value that is a quantization target, normalizing it to a predetermined range, and outputting a normalized value; selecting two quantum values closest to the normalized value among a plurality of predetermined quantum values, and calculating two distance-based scores in a predetermined manner according to the difference between each of the two selected quantum values and the normalized value; The weighted distance-based score obtained by substituting each of the two quantum values to the two distance-based scores into a kernel function is substituted into the soft Agmax function to distribute the normalized values to each of the two quantum values. It includes calculating a distance-based probability representing a probability, and obtaining a quantized value by adding the calculated distance-based probability to the two quantum values.

따라서, 본 발명의 실시예에 따른 인공 신경망을 위한 양자화기 및 양자화 방법은 양자화 대상인 대상값과 기지정된 양자값 사이의 거리에 따라 거리 기반 스코어를 부여하고, 부여된 거리 기반 스코어의 확률 분포에 기반하는 커널 소프트 아그맥스 함수를 양자화 함수로 이용하여 양자화값을 획득함으로써, 이산 함수 기반의 양자화 기법과 동일한 수준으로 양자화를 수행하면서도 미분 가능한 양자화를 수행할 수 있다. 그러므로 동일한 함수를 기반으로 순방향 및 역방향 전파를 수행할 수 있어 양자화에 따른 인공 신경망의 학습 오차를 최소화할 수 있고, 고속으로 학습을 수행할 수 있다.Therefore, the quantizer and quantization method for an artificial neural network according to an embodiment of the present invention assign a distance-based score according to the distance between the target value that is the target of quantization and a predetermined quantum value, and based on the probability distribution of the assigned distance-based score. By obtaining a quantization value using the kernel soft Agmax function as a quantization function, differentiable quantization can be performed while performing quantization at the same level as the discrete function-based quantization technique. Therefore, forward and backward propagation can be performed based on the same function, minimizing the learning error of the artificial neural network due to quantization, and learning can be performed at high speed.

도 1은 기존의 인공 신경망을 위한 양자화기의 개략적 구조를 나타낸다.
도 2는 기존의 이산화부에서 이용하는 이산 함수와 이의 미분 함수 그래프의 일 예를 나타낸다.
도 3은 본 발명의 일 실시예에 따른 인공 신경망을 위한 양자화기의 개략적 구조를 나타낸다.
도 4는 양자값에 대한 대상값의 거리 기반 스코어의 일 예를 나타낸다.
도 5는 온도 파라미터의 변화에 따른 양자화값의 변화를 나타낸다.
도 6은 온도 파라미터의 변화에 따른 양자화값의 변화와 이의 미분 그래프의 변화를 나타낸다.
도 7은 정규화값에 따른 선택된 2개의 양자값에 대한 커널 함수로 가중된 거리 기반 스코어의 차이 변화를 나타낸다.
도 8은 본 발명의 일 실시예에 따른 인공 신경망을 위한 양자화 방법을 나타낸다.
Figure 1 shows a schematic structure of a quantizer for an existing artificial neural network.
Figure 2 shows an example of a graph of a discrete function and its derivative function used in an existing discretization unit.
Figure 3 shows a schematic structure of a quantizer for an artificial neural network according to an embodiment of the present invention.
Figure 4 shows an example of a distance-based score of an object value to a quantum value.
Figure 5 shows the change in quantization value according to the change in temperature parameter.
Figure 6 shows the change in quantization value and its derivative graph according to the change in temperature parameter.
Figure 7 shows the change in difference between distance-based scores weighted by a kernel function for two selected quantum values according to the normalization value.
Figure 8 shows a quantization method for an artificial neural network according to an embodiment of the present invention.

본 발명과 본 발명의 동작상의 이점 및 본 발명의 실시에 의하여 달성되는 목적을 충분히 이해하기 위해서는 본 발명의 바람직한 실시예를 예시하는 첨부 도면 및 첨부 도면에 기재된 내용을 참조하여야만 한다. In order to fully understand the present invention, its operational advantages, and the objectives achieved by practicing the present invention, reference should be made to the accompanying drawings illustrating preferred embodiments of the present invention and the contents described in the accompanying drawings.

이하, 첨부한 도면을 참조하여 본 발명의 바람직한 실시예를 설명함으로써, 본 발명을 상세히 설명한다. 그러나, 본 발명은 여러 가지 상이한 형태로 구현될 수 있으며, 설명하는 실시예에 한정되는 것이 아니다. 그리고, 본 발명을 명확하게 설명하기 위하여 설명과 관계없는 부분은 생략되며, 도면의 동일한 참조부호는 동일한 부재임을 나타낸다. Hereinafter, the present invention will be described in detail by explaining preferred embodiments of the present invention with reference to the accompanying drawings. However, the present invention may be implemented in many different forms and is not limited to the described embodiments. In order to clearly explain the present invention, parts not relevant to the description are omitted, and like reference numerals in the drawings indicate like members.

명세서 전체에서, 어떤 부분이 어떤 구성요소를 "포함"한다고 할 때, 이는 특별히 반대되는 기재가 없는 한 다른 구성요소를 제외하는 것이 아니라, 다른 구성요소를 더 포함할 수 있는 것을 의미한다. 또한, 명세서에 기재된 "...부", "...기", "모듈", "블록" 등의 용어는 적어도 하나의 기능이나 동작을 처리하는 단위를 의미하며, 이는 하드웨어나 소프트웨어 또는 하드웨어 및 소프트웨어의 결합으로 구현될 수 있다. Throughout the specification, when a part "includes" a certain element, this does not mean excluding other elements, unless specifically stated to the contrary, but rather means that it may further include other elements. In addition, terms such as "... unit", "... unit", "module", and "block" used in the specification refer to a unit that processes at least one function or operation, which is hardware, software, or hardware. and software.

도 3은 본 발명의 일 실시예에 따른 인공 신경망을 위한 양자화기의 개략적 구조를 나타낸다.Figure 3 shows a schematic structure of a quantizer for an artificial neural network according to an embodiment of the present invention.

도 3을 참조하면, 본 실시예에 따른 양자화기(200)는 정규화부(210)와 거리 스코어 계산부(220) 및 확률 분포 기반 양자화부(230)를 포함한다.Referring to FIG. 3, the quantizer 200 according to this embodiment includes a normalization unit 210, a distance score calculation unit 220, and a probability distribution-based quantization unit 230.

정규화부(210)는 도 1의 정규화부(110)와 마찬가지로 양자화되어야 하는 대상인 대상값(x)을 인가받아 기지정된 범위로 정규화하여 정규화값(xn)을 출력한다. 여기서 대상값(x)은 인공 신경망에 인가되는 입력맵(또는 특징맵)의 원소이거나 학습에 의해 업데이트되는 가중치맵의 원소일 수 있으며, 부동 소수점 형식의 데이터일 수 있다. 그리고 입력맵(또는 특징맵)과 가중치맵은 행렬 또는 벡터 형식의 데이터일 수 있다.The normalization unit 210, like the normalization unit 110 of FIG. 1, receives the target value (x), which is to be quantized, normalizes it to a predetermined range, and outputs the normalization value (x n ). Here, the target value (x) may be an element of an input map (or feature map) applied to the artificial neural network or an element of a weight map updated through learning, and may be data in floating point format. And the input map (or feature map) and weight map may be data in matrix or vector format.

정규화부(210)는 대상값(x)인 인가되면, 수학식 1과 같이, 클리핑 함수(clipping function)를 이용하여 인가된 대상값(x)이 기지정된 상한값(u)과 하한값(l)을 초과하지 않도록 클리핑하여 클리핑값(xc)을 획득한다.When the target value (x) is applied, the normalization unit 210 uses a clipping function, as shown in Equation 1, to set the applied target value (x) to a predetermined upper limit (u) and a lower limit (l). Obtain the clipping value (x c ) by clipping so as not to exceed it.

그리고 획득된 클립핑값(xc)을 양자화시키고자 하는 양자화 범위[0, 2k-1]에 따라 수학식 2와 같이 정규화하여 정규화값(xn)을 출력한다.Then, the obtained clipping value (x c ) is normalized according to Equation 2 according to the quantization range [0, 2 k -1] to be quantized, and the normalized value (x n ) is output.

여기서 k는 기지정된 양자화 비트수이다.Here, k is the predetermined number of quantization bits.

여기서 양자화기의 양자화 비트수가 k이므로, 양자화 범위는 [0, 2k-1]가 되고, 양자화 범위 내에서 기지정된 간격 단위로 이산 분포되는 양자값(q)은 [0, 1, … 2k-1])로 설정될 수 있다. 이는 양자화부(230)에서 정규화값(xn)을 양자화하여 획득되는 양자화값(Q(xn))이 양자값(q) 중 하나로 획득될 수 있음을 의미한다.Here, since the number of quantization bits of the quantizer is k, the quantization range is [0, 2 k -1], and the quantum value (q) distributed discretely at predetermined intervals within the quantization range is [0, 1,... 2 k -1]). This means that the quantization value (Q(x n )) obtained by quantizing the normalization value (x n ) in the quantization unit 230 can be obtained as one of the quantum values (q).

한편, 본 실시예에서 양자화기(200)는 기존의 양자화기(100)와 달리 이산 함수를 이용하여 양자화를 수행하지 않고, 기지정된 다수의 양자값(q)과 정규화값(xn) 사이의 차에 따른 거리 기반 스코어를 계산하고, 계산된 거리 기반 스코어를 바탕으로 정규화값(xn)의 확률 분포를 계산하여 정규화값(xn)을 양자화한다.Meanwhile, in this embodiment, the quantizer 200, unlike the existing quantizer 100, does not perform quantization using a discrete function, but uses a number of predetermined quantum values (q) and a normalization value (x n ). A distance-based score is calculated according to the difference, and the probability distribution of the normalization value (x n ) is calculated based on the calculated distance-based score to quantize the normalization value (x n ).

이에 거리 스코어 계산부(220)는 정규화부(210)로부터 정규화값(xn)을 인가받고, 다수의 양자값(qi = [0, 1, … 2k-1]) 중 인가된 정규화값(xn)에 가장 인접한 2개의 양자값(qf, qc)를 선택하고, 정규화값(xn)과 선택된 2개의 양자값(qf, qc) 사이의 거리 기반 스코어(n(xn,q))를 계산한다.Accordingly, the distance score calculation unit 220 receives the normalization value (x n ) from the normalization unit 210, and calculates the applied normalization value among a plurality of quantum values (q i = [0, 1, … 2 k -1]). Select the two quantum values (q f , q c ) closest to (x n ), and calculate the distance-based score (n(x) between the normalized value (x n ) and the two selected quantum values (q f , q c ). Calculate n ,q)).

거리 스코어 계산부(220)는 다수의 양자값(q = [0, 1, … 2k-1]) 중 인가된 정규화값(xn)에 가장 인접한 2개의 양자값(qf, qc)을 각각 내림 함수(floor function)과 올림 함수(ceil function)를 이용하여 획득할 수 있다. 여기서 내림 함수를 이용하여 선택되는 양자값을 제1 양자값(qf = floor(xn))이라 하고, 올림 함수를 이용하여 선택되는 양자값을 제2 양자값(qc = ceil(xn))이라 할 수 있다. 따라서 제1 양자값(qf)은 정규화값(xn) 이하의 값을 갖는 최대 양자값이며, 제2 양자값(qc)은 정규화값(xn) 이상의 값을 갖는 최소 양자값이다.The distance score calculator 220 calculates the two quantum values (q f , q c ) that are closest to the applied normalization value (x n ) among the plurality of quantum values (q = [0, 1, … 2 k -1]). can be obtained using a floor function and a ceiling function, respectively. Here, the quantum value selected using the rounding down function is called the first quantum value (q f = floor(x n )), and the quantum value selected using the rounding function is called the second quantum value (q c = ceil(x n) )). Therefore, the first quantum value (q f ) is the maximum quantum value having a value less than or equal to the normalized value (x n ), and the second quantum value (q c ) is the minimum quantum value having a value greater than or equal to the normalized value (x n ).

제1 및 제2 양자값(qf, qc)이 선택되면, 거리 스코어 계산부(220)는 선책된 2개의 양자값(qf, qc) 각각과 정규화값(xn) 사이의 차에 기반하여, 정규화값(xn)에 대응하는 거리 기반 스코어(n(xn,q))를 수학식 3에 따라 계산한다.When the first and second quantum values (q f , q c ) are selected, the distance score calculator 220 calculates the difference between each of the two selected quantum values (q f , q c ) and the normalized value (x n ). Based on , the distance-based score (n(x n ,q)) corresponding to the normalization value (x n ) is calculated according to Equation 3.

거리 기반 스코어(n(xn,q))는 수학식 3에 따라 다수의 양자값(q = [0, 1, … 2k-1]) 각에 대해 계산될 수 있으나, 여기서는 거리 스코어 계산부(220)가 선택된 제1 및 제2 양자값(qf, qc)에 대해서만 계산하여 불필요한 연산이 수행되는 것을 방지한다.The distance-based score (n(x n ,q)) can be calculated for each of a number of quantum values (q = [0, 1, … 2 k -1]) according to Equation 3, but here, the distance score calculation unit (220) prevents unnecessary calculations from being performed by calculating only the selected first and second quantum values (q f , q c ).

도 4는 양자값에 대한 대상값의 거리 기반 스코어의 일 예를 나타낸다.Figure 4 shows an example of a distance-based score of an object value to a quantum value.

도 4에서는 일 예로 선택된 양자값(qf, qc) 중 하나가 1인 경우(q = 1)를 가정하여, 정규화값(xn)에 따라 획득되는 거리 기반 스코어(n(xn,1))를 도시하였다. 수학식 3에 나타난 바와 같이, 거리 스코어 계산부(220)는 선택된 양자값(qf, qc) 각각을 중심으로, 선택된 양자값(qf, qc)과 정규화값(xn) 사이의 차의 절대값에 따른 지수 함수 그래프 형태로 거리 기반 스코어(n(xn,q))가 계산될 수 있다.In Figure 4, as an example, assuming that one of the selected quantum values (q f , q c ) is 1 (q = 1), the distance-based score (n(x n , 1) obtained according to the normalization value (x n ) )) is shown. As shown in Equation 3, the distance score calculation unit 220 centers on each of the selected quantum values (q f , q c ), and calculates the distance between the selected quantum values (q f , q c ) and the normalization value (x n ). A distance-based score (n(x n ,q)) can be calculated in the form of an exponential function graph according to the absolute value of the difference.

여기서 거리 기반 스코어(n(xn,q))는 선택된 2개의 양자값(qf, qc) 각각에 대해 획득되므로, 거리 스코어 계산부(220)는 정규화값(xn) 각각에 대해 2개의 거리 기반 스코어(n(xn,qf), n(xn,qc))를 획득할 수 있다.Here, the distance-based score (n(x n , q)) is obtained for each of the two selected quantum values (q f , q c ), so the distance score calculator 220 calculates 2 for each normalization value (x n ). Distance-based scores (n(x n ,q f ), n(x n ,q c )) can be obtained.

확률 분포 기반 양자화부(230)는 거리 스코어 계산부(220)에서 정규화값(xn) 각각에 대해 획득된 2개의 거리 기반 스코어(n(xn,qf), n(xn,qc))를 이용하여 정규화값(xn)의 거리 기반 확률 분포에 따라 계산하여 양자화를 수행한다.The probability distribution-based quantization unit 230 uses two distance-based scores (n(x n ,q f ), n(x n ,q c) obtained for each normalization value (x n ) in the distance score calculation unit 220. )) is used to perform quantization by calculating according to the distance-based probability distribution of the normalization value (x n ).

본 실시예에서 확률 분포 기반 양자화부(230)는 획득된 2개의 거리 기반 스코어(n(xn,qf), n(xn,qc)) 각각에 커널 함수(Kernel function)()가 가중된 가중 거리 기반 스코어()를 소프트 아그맥스 함수(soft argmax function)에 대입하여 수학식 4에 따라 정규화값(xn)의 거리 기반 확률()을 계산한다.In this embodiment, the probability distribution-based quantization unit 230 applies a kernel function (Kernel function) to each of the two obtained distance-based scores (n(x n ,q f ), n(x n ,q c )). ) is a weighted distance-based score ( ) is substituted into the soft argmax function to obtain the distance-based probability of the normalized value (x n ) according to Equation 4 ( ) is calculated.

여기서 qi (qi ∈ (qf, qc)는 양자값, β는 온도 파라미터(temperature)이고, 은 거리 기반 스코어( = n(xn,q))이다.Here, q i (q i ∈ (q f , q c ) is the quantum value, β is the temperature parameter, is a distance-based score ( = n(x n ,q)).

커널 함수와 소프트 아그맥스 함수가 결합된 수학식 4를 여기서는 커널 소프트 아그맥스 함수(Kernel soft argmax function)라 한다. 즉 수학식 4는 정규화값(xn)의 확률 분포가 선택된 2개의 양자값(qf, qc)에 밀집되도록, 양자값(qi)을 커널 함수()에 대입한 커널값()을 2개의 거리 기반 스코어(n(xn,qi))에 가중하여 정규화값(xn)의 거리 기반 확률()을 획득할 수 있도록 한다. 여기서 온도 파라미터(β)는 거리 기반 스코어에 가중되는 커널값()의 가중 비중을 조절하기 위한 조절 파라미터이다.Equation 4, which combines the kernel function and the soft argmax function, is referred to here as the kernel soft argmax function. That is , Equation 4 uses the kernel function ( ), the kernel value substituted into ( ) is weighted to the two distance-based scores (n(x n ,q i )) to obtain the distance-based probability of the normalized value (x n ) ( ) to obtain. Here, the temperature parameter (β) is the kernel value ( ) is an adjustment parameter to control the weighted proportion of.

선택된 2개의 양자값(qf, qc) 각각에 대한 거리 기반 확률()이 계산되면, 선택된 2개의 양자값(qf, qc)에 계산된 2개의 거리 기반 확률()을 가중 평균하여 수학식 5에 따라 정규화값(xn)에 대한 양자화값(ø(xn))을 획득할 수 있다.Distance - based probability ( ) is calculated, the two distance - based probabilities ( ) can be weighted to obtain the quantization value (ø(x n )) for the normalization value (x n ) according to Equation 5.

즉 선택된 2개의 양자값(qf, qc)에 대해 2개의 거리 기반 확률()를 가중 평균하여 양자화값(ø(xn))을 획득할 수 있다.That is, for the two selected quantum values (q f , q c ), two distance-based probabilities ( ) can be obtained by weighting the quantization value (ø(x n )).

도 5는 온도 파라미터의 변화에 따른 양자화값의 변화를 나타내고, 도 6은 온도 파라미터의 변화에 따른 양자화값의 변화와 이의 미분 그래프의 변화를 나타낸다.Figure 5 shows the change in the quantization value according to the change in the temperature parameter, and Figure 6 shows the change in the quantization value according to the change in the temperature parameter and the change in its derivative graph.

온도 파라미터(β)는 기지정된 상수값으로 설정될 수 있으며, 도 5에서는 온도 파라미터(β)가 각각 10, 20, 30 및 40인 경우에 정규화값(xn)에 따라 획득되는 양자화값(ø(xn))의 변화를 도시하였다.The temperature parameter (β) can be set to a predetermined constant value, and in FIG. 5, the quantization value (ø) obtained according to the normalization value (x n ) when the temperature parameter (β) is 10, 20, 30, and 40, respectively. The change in (x n )) is shown.

도 5에 도시된 바와 같이, 온도 파라미터(β)가 10인 경우, 정규화값(xn)에 따라 획득되는 양자화값(ø(xn))은 시그모이드 함수를 이용하여 양자화한 경우와 유사하게 나타난다. 즉 정규화값(xn)이 선택된 2개의 양자값(qf, qc)의 중앙((qf + qc)/2)에 가까울수록 양자화값(ø(xn))이 이산 함수를 이용하는 경우와 상이하게 나타나게 되어 양자화 오차가 증가하게 된다. 그러나 온도 파라미터(β)가 20, 30 및 40으로 증가될수록 점차적으로 이상적인 양자화기와 유사한 형태로 양자화값(ø(xn))의 분포가 변화됨을 알 수 있다.As shown in Figure 5, when the temperature parameter (β) is 10, the quantization value (ø(x n )) obtained according to the normalization value (x n ) is similar to the case of quantization using the sigmoid function. It appears clearly. In other words, the closer the normalization value (x n ) is to the center ((q f + q c )/2) of the two selected quantum values (q f , q c ), the closer the quantization value (ø(x n )) is to using a discrete function. It appears differently from the previous case, and the quantization error increases. However, it can be seen that as the temperature parameter (β) increases to 20, 30, and 40, the distribution of the quantization value (ø(x n )) gradually changes to a form similar to that of an ideal quantizer.

즉 온도 파라미터(β)의 값이 증가될수록 수학식 4 및 수학식 5에 따라 계산되는 양자화값(ø(xn))의 양자화 오차가 감소하게 된다.That is, as the value of the temperature parameter (β) increases, the quantization error of the quantization value (ø(x n )) calculated according to Equation 4 and Equation 5 decreases.

한편 도 6에서 상단의 그래프는 도 5에서와 마찬가지로 온도 파라미터(β)의 변화에 따른 양자화값(ø(xn))의 변화를 나타내고, 하단 그래프는 온도 파라미터(β)의 변화에 따른 양자화값(ø(xn))의 미분 그래프를 나타낸다.Meanwhile, in FIG. 6, the upper graph shows the change in the quantization value (ø(x n )) according to the change in the temperature parameter (β), as in FIG. 5, and the lower graph shows the quantization value according to the change in the temperature parameter (β). Shows the differential graph of (ø(x n )).

도 6에서는 온도 파라미터(β)가 각각 10, 20, 40 및 80으로 증가되는 경우를 도시하였다. 도 6의 상단에 도시된 바와 같이, 온도 파라미터(β)가 10, 20, 40 및 80으로 증가됨에 따라 양자화값(ø(xn))이 이산 함수를 이용하는 이상적인 양자화기와 유사한 그래프를 나타냄을 알 수 있다. 그러나 하단에 도시된 바와 같이, 온도 파라미터(β)가 증가함에 따라 양자화값(ø(xn))의 미분 그래프 또한 이산 함수를 이용하는 경우와 유사하게 점차로 0에 수렴하는 형태의 그래프로 나타나게 된다.Figure 6 shows a case where the temperature parameter (β) is increased to 10, 20, 40, and 80, respectively. As shown at the top of Figure 6, as the temperature parameter (β) increases to 10, 20, 40, and 80, the quantization value (ø(x n )) shows a graph similar to an ideal quantizer using a discrete function. You can. However, as shown at the bottom, as the temperature parameter (β) increases, the differential graph of the quantization value (ø(x n )) also appears as a graph that gradually converges to 0, similar to the case of using a discrete function.

이는 이산 함수를 이용하여 양자화기를 구성하는 경우와 마찬가지로 그래디언트 소실(gradient vanishing) 문제를 야기하게 된다.This causes a gradient vanishing problem, similar to when configuring a quantizer using a discrete function.

이에 본 실시예에서 확률 분포 기반 양자화부(230)는 온도 파라미터(β)를 상수로 설정하지 않고, 거리 기반 스코어()와 커널값()에 따라 가변되는 변수로 설정하여, 정규화값(xn)이 선택된 2개의 양자값(qf, qc)의 중앙((qf + qc)/2)에 가까울수록 큰 값을 갖고, 2개의 양자값(qf, qc)에 가까울수록 작은 값을 갖도록 함으로써, 이산 함수를 적용하는 이상적인 양자화기와 유사하게 양자화를 수행하면서도 미분 가능하여 역전파가 가능하도록 한다.Accordingly, in this embodiment, the probability distribution-based quantization unit 230 does not set the temperature parameter (β) to a constant, but the distance-based score ( ) and kernel value ( ), the normalized value (x n ) has a larger value as it approaches the center ((q f + q c )/2) of the two selected quantum values (q f , q c ). By having a smaller value the closer it is to two quantum values (q f , q c ), quantization is performed similarly to an ideal quantizer that applies a discrete function, while being differentiable to enable backpropagation.

다시 도 3을 참조하면, 확률 분포 기반 양자화부(230)는 온도 파라미터 계산부(231), 확률 분포 계산부(2232) 및 양자화값 획득부(233)를 포함할 수 있다.Referring again to FIG. 3, the probability distribution-based quantization unit 230 may include a temperature parameter calculation unit 231, a probability distribution calculation unit 2232, and a quantization value acquisition unit 233.

온도 파라미터 계산부(231)는 수학식 6에 따라 거리 기반 스코어()와 커널값()에 따라 가변되는 온도 파라미터(β)를 획득한다.The temperature parameter calculation unit 231 calculates a distance-based score according to Equation 6 ( ) and kernel value ( ) Obtain a temperature parameter (β) that varies according to.

여기서 γ는 기지정된 상수값이며, 은 선택된 2개의 양자값(qf, qc)에 대한 거리 기반 스코어()와 커널값()의 곱()으로 가중 거리 기반 스코어를 나타낸다.Here, γ is a known constant value, is a distance - based score ( ) and kernel value ( ) product of ( ) represents a weighted distance-based score.

수학식 6에서 분자항의 상수값(γ)은 기존의 상수 온도 파라미터에 대응하는 값으로 상수값(γ)이 증가됨에 따라(예를 들면 γ = 80) 양자화값(ø(xn))은 이상적인 양자화기의 양자화값(Q(xn))과 동일한 값으로 출력되게 된다.In Equation 6, the constant value (γ) of the molecular term is a value corresponding to the existing constant temperature parameter. As the constant value (γ) increases (for example, γ = 80), the quantization value (ø(x n )) becomes ideal. It is output as the same value as the quantization value (Q(x n )) of the quantizer.

그러나 수학식 6의 분모항()은 정규화값(xn)이 선택된 2개의 양자값(qf, qc)에 가까울수록 증가된다.However, the denominator of Equation 6 ( ) increases as the normalization value (x n ) approaches the two selected quantum values (q f , q c ).

도 7은 정규화값에 따른 선택된 2개의 양자값에 대한 커널 함수로 가중된 거리 기반 스코어의 차이 변화를 나타낸다.Figure 7 shows the change in difference between distance-based scores weighted by a kernel function for two selected quantum values according to the normalization value.

도 7에 나타난 바와 같이, 수학식 6에서 분모항()으로 나타나는 선택된 2개의 양자값에 대한 커널 함수로 가중된 거리 기반 스코어의 차는 정규화값(xn)이 선택된 2개의 양자값(qf, qc)의 중앙((qf + qc)/2)에 가까울수록 감소하게 되고, 2개의 양자값(qf, qc) 중 하나에 가까워질수록 점차로 증가하게 된다.As shown in Figure 7, in Equation 6, the denominator term ( ) , the difference between the distance-based scores weighted by the kernel function for the two selected quantum values , expressed as It decreases as it gets closer to 2), and gradually increases as it gets closer to one of the two quantum values (q f , q c ).

따라서 수학식 6에 따라 계산되는 온도 파라미터(β)는 정규화값(xn)이 2개의 양자값(qf, qc) 중 하나에 가까울수록 감소되는 반면, 2개의 양자값(qf, qc)의 중앙((qf + qc)/2)에 가까울수록 증가된다.Therefore, the temperature parameter (β) calculated according to Equation 6 decreases as the normalized value (x n ) approaches one of the two quantum values (q f , q c ), while the two quantum values (q f , q c ) increases as it approaches the center ((q f + q c )/2).

확률 분포 계산부(232)는 온도 파라미터 계산부(231)에서 획득된 온도 파라미터(β)와 거리 스코어 계산부(220)에서 계산된 거리 기반 스코어()를 수학식 4의 커널 소프트 아그맥스 함수에 대입하여 정규화값(xn)의 거리 기반 확률()을 획득한다.The probability distribution calculation unit 232 includes the temperature parameter (β) obtained from the temperature parameter calculation unit 231 and the distance-based score calculated from the distance score calculation unit 220 ( ) is substituted into the kernel soft agmax function in Equation 4 to obtain the distance-based probability of the normalized value (x n ) ( ) to obtain.

그리고 양자화값 획득부(233)는 획득된 거리 기반 확률()을 기반으로 양자화값(ø(xn))을 획득한다. 이때 양자화값 획득부(233)가 수학식 5에 따라 선택된 2개의 양자값(qf, qc)에 계산된 2개의 거리 기반 확률()을 가중 평균하여 양자화값(ø(xn))을 획득하는 경우, 가변되는 온도 파라미터(β)에 의해 여전히 양자화 오차가 발생될 수 있다.And the quantization value acquisition unit 233 is the obtained distance-based probability ( ) Obtain the quantization value (ø(x n )) based on . At this time, the quantization value acquisition unit 233 calculates two distance-based probabilities for the two quantum values (q f , q c ) selected according to Equation 5 ( ), when obtaining the quantization value (ø(x n )), a quantization error may still occur due to the variable temperature parameter (β).

수학식 6에 따른 온도 파라미터(β)가 반영하여 수학식 5에 따라 계산되는 양자화값(ø(xn))은 수학식 7과 같이 나타난다.The quantization value (ø(x n )) calculated according to Equation 5 by reflecting the temperature parameter (β) according to Equation 6 is shown in Equation 7.

즉 양자화값(ø(xn))이 선택된 2개의 양자값(qf, qc) 중 하나로 획득되지 않아 양자화 오차가 발생된다.That is, a quantization error occurs because the quantization value (ø(x n )) is not obtained as one of the two selected quantum values (q f , q c ).

이에 본 실시예의 양자화값 획득부(233)는 양자화 오차가 제거될 수 있도록 선택된 2개의 양자값(qf, qc)을 수학식 8과 같이 변형한다.Accordingly, the quantization value acquisition unit 233 of this embodiment transforms the two selected quantum values (q f , q c ) as shown in Equation 8 so that the quantization error can be removed.

그리고 양자화값 획득부(233)는 변형된 2개의 양자값(qf *, qc *)에 따라 수학식 5를 수정한 수학식 9에 따라 양자화값(ø(xn))을 획득한다.And the quantization value acquisition unit 233 acquires the quantization value (ø(x n )) according to Equation 9, which is a modified version of Equation 5 according to the two modified quantum values (q f * , q c * ).

도 8은 본 실시예에 따른 양자화기(200)의 정규화값에 따른 양자화값의 변화와 이의 미분 그래프의 변화를 나타낸다.Figure 8 shows the change in the quantization value and its derivative graph according to the normalization value of the quantizer 200 according to this embodiment.

도 8에 도시된 바와 같이, 본 실시예에 따른 양자화기(200)는 대상값(x)을 정규화한 정규화값(xn)에 대해 이산 함수를 이용하는 이상적인 이산화기와 동일하게 양자화값(ø(xn))을 획득할 수 있어 양자화 오차가 발생되지 않는다. 뿐만 아니라 정규화값(xn)과 양자값(qf, qc) 사이의 거리에 따라 가변되는 온도 파라미터(β)에 의해 미분값이 0으로 수렴되지 않으므로, 인공 신경망의 학습시에 손실 역전파가 가능하다. 특히 동일한 함수에 기반하여 순방향 전파와 역방향 전파가 수행될 수 있어, 그래디언트 불일치 문제를 야기하지 않는다.As shown in FIG. 8, the quantizer 200 according to this embodiment has the same quantization value (ø(x) as an ideal discretizer that uses a discrete function for the normalized value (x n ) obtained by normalizing the target value (x). n )) can be obtained, so quantization error does not occur. In addition, since the differential value does not converge to 0 due to the temperature parameter (β), which varies depending on the distance between the normalized value (x n ) and the quantum value (q f , q c ), lossy backpropagation occurs when training the artificial neural network. is possible. In particular, forward propagation and backward propagation can be performed based on the same function, so they do not cause gradient mismatch problems.

도 9는 본 발명의 일 실시예에 따른 인공 신경망을 위한 양자화 방법을 나타낸다.Figure 9 shows a quantization method for an artificial neural network according to an embodiment of the present invention.

도 3을 참조하여, 도 9의 인공 신경망을 위한 양자화 방법을 설명하면, 양자화 대상이 되는 대상값(x)이 입력된다(S10). 여기서 대상값(x)은 인공 신경망에 인가되는 입력맵(또는 특징맵)의 원소이거나 학습에 의해 업데이트되는 가중치맵의 원소일 수 있다. 대상값(x)이 입력되면, 입력된 대상값(x)을 클리핑하여 클리핑값(xc)을 획득하고, 클리핑값(xc)을 기지정된 양자화 범위에 대응하도록 정규화하여 정규화값(xn)을 획득한다(S20). 여기서 클리핑값(xc)은 일예로 수학식 1에 따라 획득될 수 있으며, 정규화값(xn)은 수학식 2에 따라 획득될 수 있다.Referring to FIG. 3, when explaining the quantization method for the artificial neural network of FIG. 9, a target value (x) to be quantized is input (S10). Here, the target value (x) may be an element of an input map (or feature map) applied to the artificial neural network or an element of a weight map updated through learning. When the target value (x) is input, the input target value (x) is clipped to obtain a clipping value (x c ), and the clipping value (x c ) is normalized to correspond to a predetermined quantization range to obtain a normalized value (x n ) obtain (S20). Here, the clipping value (x c ) can be obtained according to Equation 1, for example, and the normalization value (x n ) can be obtained according to Equation 2.

정규화값(xn)이 획득되면, 획득된 정규화값(xn)에 가장 인접한 2개의 양자값(qf, qc)을 선택한다(S30). 여기서 2개의 양자값(qf, qc)은 각각 내림 함수와 올림 함수에 정규화값(xn)을 대입하여 이용하여 획득할 수 있다.When the normalized value (x n ) is obtained, the two quantum values (q f , q c ) closest to the obtained normalized value (x n ) are selected (S30). Here, the two quantum values (q f , q c ) can be obtained by substituting the normalization value (x n ) into the down function and the up function, respectively.

2개의 양자값(qf, qc)이 선택되면, 선택된 2개의 양자값(qf, qc)과 정규화값(xn) 각각 사이의 차에 기반하여, 2개의 양자값(qf, qc) 각각과 정규화값(xn)의 거리를 나타내는 2개의 거리 기반 스코어(n(xn,qf), n(xn,qc))를 수학식 3에 따라 계산한다(S40).When two quantum values (q f , q c ) are selected, based on the difference between the two selected quantum values (q f , q c ) and the normalized value (x n ), respectively, the two quantum values (q f , Two distance-based scores (n(x n ,q f ), n(x n ,q c )), which represent the distance between each q c ) and the normalized value (x n ), are calculated according to Equation 3 (S40) .

그리고 선택된 2개의 양자값(qf, qc)과 정규화값(xn) 각각 사이의 거리에 따라 가변되는 온도 파라미터(β)를 수학식 6에 따라 계산한다(S50). 수학식 6에 따르면, 온도 파라미터(β)는 선택된 2개의 양자값(qf, qc)을 커널 함수()에 대입한 커널값()을 2개의 거리 기반 스코어(n(xn,qi)) 중 대응하는 거리 기반 스코어에 가중한 커널 가중 거리 기반 스코어 사이의 차에 따라 가변되는 파라미터로서, 정규화값(xn)이 2개의 양자값(qf, qc) 중 하나에 가까울수록 감소되는 반면, 2개의 양자값(qf, qc)의 중앙((qf + qc)/2)에 가까울수록 증가된다.And the temperature parameter (β), which varies depending on the distance between the two selected quantum values (q f , q c ) and the normalized value (x n ), is calculated according to Equation 6 (S50). According to Equation 6 , the temperature parameter (β) is a kernel function ( ), the kernel value substituted into ( ) is a parameter that varies depending on the difference between the kernel-weighted distance-based score weighted by the corresponding distance-based score among the two distance-based scores (n(x n ,q i )), and the normalization value (x n ) is the two It decreases as it gets closer to one of the quantum values (q f , q c ), while it increases as it gets closer to the center ((q f + q c )/2) of the two quantum values (q f , q c ).

온도 파라미터(β)가 계산되면, 계산된 온도 파라미터(β)와 커널 함수()로 가중된 거리 기반 스코어(n(xn,qf), n(xn,qc))를 이용하여 수학식 4에 따라 거리 기반 확률()을 계산한다(S70). 거리 기반 확률() 또한 2개의 양자값(qf, qc) 각각에 대응하여 개별적으로 계산될 수 있다.Once the temperature parameter (β) is calculated, the calculated temperature parameter (β) and the kernel function ( ), using the distance-based score (n(x n ,q f ), n(x n ,q c )) weighted by the distance-based probability ( ) is calculated (S70). Distance based probability ( ) can also be calculated individually corresponding to each of the two quantum values (q f , q c ).

한편 양자값(qf, qc)과 정규화값(xn) 각각 사이의 거리에 따라 가변되는 온도 파라미터(β)에 의해 발생하는 양자화 오차를 제거하기 위해, 선택된 2개의 양자값(qf, qc)을 온도 파라미터(β)에 대응하여 수학식 8과 같이 변형하여 변형된 양자값(qf *, qc *)을 획득한다(S70)Meanwhile, in order to eliminate the quantization error caused by the temperature parameter (β) that varies depending on the distance between the quantum values (q f , q c ) and the normalization value (x n ), two selected quantum values (q f , Transform q c ) according to Equation 8 in response to the temperature parameter (β) to obtain transformed quantum values (q f * , q c * ) (S70)

그리고 계산된 거리 기반 확률()과 변형된 양자값(qf *, qc *)이 획득되면, 수학식 9에 따라 계산된 거리 기반 확률()을 변형된 양자값(qf *, qc *)에 가중 합하여, 양자화값(ø(xn))을 획득하여 출력한다(S80).And the calculated distance-based probability ( ) and the transformed quantum values (q f * , q c * ) are obtained, the distance-based probability calculated according to Equation 9 ( ) is weighted and added to the transformed quantum values (q f * , q c * ) to obtain and output the quantized value (ø(x n )) (S80).

본 발명에 따른 방법은 컴퓨터에서 실행시키기 위한 매체에 저장된 컴퓨터 프로그램으로 구현될 수 있다. 여기서 컴퓨터 판독가능 매체는 컴퓨터에 의해 액세스 될 수 있는 임의의 가용 매체일 수 있고, 또한 컴퓨터 저장 매체를 모두 포함할 수 있다. 컴퓨터 저장 매체는 컴퓨터 판독가능 명령어, 데이터 구조, 프로그램 모듈 또는 기타 데이터와 같은 정보의 저장을 위한 임의의 방법 또는 기술로 구현된 휘발성 및 비휘발성, 분리형 및 비분리형 매체를 모두 포함하며, ROM(판독 전용 메모리), RAM(랜덤 액세스 메모리), CD(컴팩트 디스크)-ROM, DVD(디지털 비디오 디스크)-ROM, 자기 테이프, 플로피 디스크, 광데이터 저장장치 등을 포함할 수 있다.The method according to the present invention can be implemented as a computer program stored on a medium for execution on a computer. Here, computer-readable media may be any available media that can be accessed by a computer, and may also include all computer storage media. Computer storage media includes both volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer-readable instructions, data structures, program modules or other data, including read-only memory (ROM). It may include dedicated memory), RAM (random access memory), CD (compact disk)-ROM, DVD (digital video disk)-ROM, magnetic tape, floppy disk, optical data storage, etc.

본 발명은 도면에 도시된 실시예를 참고로 설명되었으나 이는 예시적인 것에 불과하며, 본 기술 분야의 통상의 지식을 가진 자라면 이로부터 다양한 변형 및 균등한 타 실시예가 가능하다는 점을 이해할 것이다.The present invention has been described with reference to the embodiments shown in the drawings, but these are merely exemplary, and those skilled in the art will understand that various modifications and other equivalent embodiments are possible therefrom.

따라서, 본 발명의 진정한 기술적 보호 범위는 첨부된 청구범위의 기술적 사상에 의해 정해져야 할 것이다.Therefore, the true technical protection scope of the present invention should be determined by the technical spirit of the attached claims.

200: 양자화기 210: 정규화부
220: 거리 스코어 계산부 230: 확률 분포 기반 양자화부
231: 온도 파라미터 계산부 232: 확률 분포 계산부
233: 양자화값 획득부
200: Quantizer 210: Normalization unit
220: Distance score calculation unit 230: Probability distribution-based quantization unit
231: Temperature parameter calculation unit 232: Probability distribution calculation unit
233: Quantization value acquisition unit

Claims (17)

인공 신경망에 구비되는 양자화기에 있어서,
양자화 대상인 대상값을 인가받아 기지정된 범위로 정규화하여 정규화값을 출력하는 정규화부;
기지정된 다수의 양자값 중 상기 정규화값에 가장 인접한 2개의 양자값을 선택하고, 선택된 2개의 양자값 각각과 상기 정규화값 사이의 차에 따라 기지정된 방식으로 2개의 거리 기반 스코어를 계산하는 거리 스코어 계산부;
상기 2개의 거리 기반 스코어에 상기 2개의 양자값 각각을 커널 함수(Kernel function)에 대입하여 획득되는 커널값을 가중한 가중 거리 기반 스코어를 소프트 아그맥스 함수(soft argmax function)에 대입하여 상기 정규화값이 상기 2개의 양자값 각각 분포할 확률을 나타내는 거리 기반 확률을 계산하고, 계산된 거리 기반 확률을 상기 2개의 양자값에 가중합하여 양자화값을 획득하는 확률 분포 기반 양자화부를 포함하는 인공 신경망을 위한 양자화기.
In the quantizer provided in an artificial neural network,
a normalization unit that receives a target value subject to quantization, normalizes it to a predetermined range, and outputs a normalized value;
A distance score that selects the two quantum values closest to the normalized value among a plurality of predetermined quantum values and calculates two distance-based scores in a predetermined manner according to the difference between each of the two selected quantum values and the normalized value. calculator;
The normalized value is obtained by substituting each of the two quantum values into the two distance-based scores into a kernel function and substituting the weighted distance-based score obtained by weighting the kernel value into the soft argmax function. Quantization for an artificial neural network including a probability distribution-based quantization unit that calculates a distance-based probability representing the probability of distribution of each of the two quantum values, and obtains a quantization value by weighting the calculated distance-based probability to the two quantum values. energy.
제1항에 있어서, 상기 확률 분포 기반 양자화부는
거리 기반 스코어에 가중되는 커널값의 가중 비중을 조절하기 위한 온도 파라미터를 상기 2개의 양자값 각각에 대한 거리 기반 스코어에 대응하는 커널값이 가중된 가중 거리 기반 스코어 사이의 차에 따라 계산하는 온도 파라미터 계산부;
상기 온도 파라미터에 따른 비중으로 커널값이 가중된 가중 거리 기반 스코어를 소프트 아그맥스 함수에 대입하여 상기 2개의 양자값 각각에 대한 거리 기반 확률을 계산하는 확률 분포 계산부; 및
상기 온도 파라미터에 의해 발생되는 양자화 오차가 제거되도록 상기 2개의 양자값을 상기 온도 파라미터에 대응하여 변형하고, 변형된 2개의 양자값에 상기 거리 기반 확률을 가중합하여 상기 양자화값을 획득하는 양자화값 획득부를 포함하는 인공 신경망을 위한 양자화기.
The method of claim 1, wherein the probability distribution-based quantization unit
A temperature parameter for adjusting the weighted proportion of the kernel value weighted to the distance-based score is calculated according to the difference between the weighted distance-based score weighted by the kernel value corresponding to the distance-based score for each of the two quantum values. calculator;
a probability distribution calculation unit that calculates a distance-based probability for each of the two quantum values by substituting a weighted distance-based score in which a kernel value is weighted by a ratio according to the temperature parameter into a soft agmax function; and
Obtaining a quantized value by transforming the two quantum values in response to the temperature parameter so that the quantization error caused by the temperature parameter is removed, and obtaining the quantization value by adding the distance-based probability to the two transformed quantum values. A quantizer for artificial neural networks with wealth.
제2항에 있어서, 상기 거리 스코어 계산부는
상기 2개의 거리 기반 스코어(n(xn,q))를 수학식

(여기서 xn은 정규화값이고, q는 양자값을 나타낸다.)
에 따라 계산하는 인공 신경망을 위한 양자화기.
The method of claim 2, wherein the distance score calculation unit
The two distance-based scores (n(x n ,q)) are expressed in the equation

(Here, x n is the normalized value, and q represents the quantum value.)
A quantizer for artificial neural networks that computes according to .
제3항에 있어서, 상기 온도 파라미터 계산부는
상기 온도 파라미터를 수학식

(여기서 γ는 기지정된 상수값이며, qf, qc는 2개의 양자값이며, 은 선택된 2개의 양자값(qf, qc)에 대한 거리 기반 스코어와 커널값을 가중한 가중 거리 기반 스코어를 나타낸다.)
에 따라 계산하는 인공 신경망을 위한 양자화기.
The method of claim 3, wherein the temperature parameter calculation unit
The temperature parameter is expressed in the equation

(Here, γ is a known constant value, q f and q c are two quantum values, represents the distance-based score for the two selected quantum values (q f , q c ) and the weighted distance-based score weighted by the kernel value.)
A quantizer for artificial neural networks that computes according to .
제4항에 있어서, 상기 확률 분포 계산부는
상기 2개의 양자값 각각에 대한 거리 기반 확률()을 수학식

(여기서 qi 는 2개의 양자값(qi ∈ (qf, qc))을 나타낸다)
에 따라 계산하는 인공 신경망을 위한 양자화기.
The method of claim 4, wherein the probability distribution calculator
Distance-based probability for each of the two quantum values ( ) in the equation

(where q i represents two quantum values (q i ∈ (q f , q c )))
A quantizer for artificial neural networks that computes according to .
제5항에 있어서, 상기 양자화값 획득부는
2개의 양자값(qf, qc)을 수학식

따라 변형된 양자값(qf *, qc *)으로 변형하는 인공 신경망을 위한 양자화기.
The method of claim 5, wherein the quantization value acquisition unit
Two quantum values (q f , q c ) are expressed in the equation

A quantizer for artificial neural networks that transforms into quantum values (q f * , q c * ) that are transformed accordingly.
제6항에 있어서, 상기 양자화값 획득부는
상기 양자화값을 수학식

에 따라 획득하는 인공 신경망을 위한 양자화기.
The method of claim 6, wherein the quantization value acquisition unit
The quantization value is expressed in the equation

A quantizer for artificial neural networks obtained according to .
제1항에 있어서, 상기 정규화부는
기지정된 상한값(u)과 하한값(l)에 따라 상기 대상값을 클리핑하여 클리핑값(xc)을 획득하고, 획득된 클리핑값(xc)을 수학식

에 따라 정규화하여 기지정된 양자화 비트수(k)에 대응하는 양자화 범위로 정규화하는 인공 신경망을 위한 양자화기.
The method of claim 1, wherein the normalization unit
Obtain a clipping value (x c ) by clipping the target value according to a predetermined upper limit (u) and lower limit value (l), and calculate the obtained clipping value (x c ) using Equation

A quantizer for an artificial neural network that normalizes according to and normalizes to a quantization range corresponding to a predetermined number of quantization bits (k).
인공 신경망을 위한 양자화기에서 수행되는 양자화 방법으로서,
양자화 대상인 대상값을 인가받아 기지정된 범위로 정규화하여 정규화값을 출력하는 단계;
기지정된 다수의 양자값 중 상기 정규화값에 가장 인접한 2개의 양자값을 선택하고, 선택된 2개의 양자값 각각과 상기 정규화값 사이의 차에 따라 기지정된 방식으로 2개의 거리 기반 스코어를 계산하는 단계;
상기 2개의 거리 기반 스코어에 상기 2개의 양자값 각각을 커널 함수에 대입하여 획득되는 커널값을 가중한 가중 거리 기반 스코어를 소프트 아그맥스 함수에 대입하여 상기 정규화값이 상기 2개의 양자값 각각 분포할 확률을 나타내는 거리 기반 확률을 계산하고, 계산된 거리 기반 확률을 상기 2개의 양자값에 가중합하여 양자화값을 획득하는 단계를 포함하는 인공 신경망을 위한 양자화 방법.
A quantization method performed in a quantizer for an artificial neural network, comprising:
A step of receiving a target value subject to quantization, normalizing it to a predetermined range, and outputting a normalized value;
selecting two quantum values closest to the normalized value among a plurality of predetermined quantum values, and calculating two distance-based scores in a predetermined manner according to the difference between each of the two selected quantum values and the normalized value;
The weighted distance-based score obtained by substituting each of the two quantum values to the two distance-based scores into a kernel function is substituted into the soft Agmax function to distribute the normalized values to each of the two quantum values. A quantization method for an artificial neural network comprising calculating a distance-based probability representing a probability and obtaining a quantization value by weighting the calculated distance-based probability to the two quantum values.
제9항에 있어서, 상기 양자화값을 획득하는 단계는
상기 2개의 양자값 각각에 대한 거리 기반 스코어에 대응하는 커널값이 가중된 가중 거리 기반 스코어 사이의 차에 따라 거리 기반 스코어에 가중되는 커널값의 가중 비중을 조절하기 위한 온도 파라미터를 계산하는 단계;
상기 온도 파라미터에 따른 비중으로 커널값이 가중된 가중 거리 기반 스코어를 소프트 아그맥스 함수에 대입하여 상기 2개의 양자값 각각에 대한 거리 기반 확률을 계산하는 단계;
상기 온도 파라미터에 의해 발생되는 양자화 오차가 제거되도록 상기 온도 파라미터에 대응하여 상기 2개의 양자값을 변형하는 단계; 및
변형된 2개의 양자값에 상기 거리 기반 확률을 가중합하여 상기 양자화값을 계산하는 단계를 포함하는 인공 신경망을 위한 양자화 방법.
The method of claim 9, wherein the step of obtaining the quantization value is
calculating a temperature parameter for adjusting the weighting ratio of the kernel value weighted to the distance-based score according to the difference between the weighted distance-based score weighted by the kernel value corresponding to the distance-based score for each of the two quantum values;
Calculating a distance-based probability for each of the two quantum values by substituting a weighted distance-based score in which a kernel value is weighted by a ratio according to the temperature parameter into a soft agmax function;
modifying the two quantum values in response to the temperature parameter so that quantization error caused by the temperature parameter is removed; and
A quantization method for an artificial neural network comprising calculating the quantization value by adding the distance-based probability to two transformed quantum values.
제10항에 있어서, 상기 거리 기반 스코어를 계산하는 단계는
상기 2개의 거리 기반 스코어(n(xn,q))를 수학식

(여기서 xn은 정규화값이고, q는 양자값을 나타낸다.)
에 따라 계산하는 인공 신경망을 위한 양자화 방법.
The method of claim 10, wherein calculating the distance-based score
The two distance-based scores (n(x n ,q)) are expressed in the equation

(Here, x n is the normalized value, and q represents the quantum value.)
A quantization method for artificial neural networks that calculates according to .
제11항에 있어서, 상기 온도 파라미터를 계산하는 단계는
상기 온도 파라미터를 수학식

(여기서 γ는 기지정된 상수값이며, qf, qc는 2개의 양자값이며, 은 선택된 2개의 양자값(qf, qc)에 대한 거리 기반 스코어와 커널값을 가중한 가중 거리 기반 스코어를 나타낸다.)
에 따라 계산하는 인공 신경망을 위한 양자화 방법.
The method of claim 11, wherein calculating the temperature parameter
The temperature parameter is expressed in the equation

(Here, γ is a known constant value, q f and q c are two quantum values, represents the distance-based score for the two selected quantum values (q f , q c ) and the weighted distance-based score weighted by the kernel value.)
A quantization method for artificial neural networks that calculates according to .
제12항에 있어서, 상기 거리 기반 확률을 계산하는 단계는
상기 2개의 양자값 각각에 대한 거리 기반 확률()을 수학식

(여기서 qi 는 2개의 양자값(qi ∈ (qf, qc))을 나타낸다)
에 따라 계산하는 인공 신경망을 위한 양자화 방법.
The method of claim 12, wherein calculating the distance-based probability
Distance-based probability for each of the two quantum values ( ) in the equation

(where q i represents two quantum values (q i ∈ (q f , q c )))
A quantization method for artificial neural networks that computes according to .
제13항에 있어서, 상기 양자값을 변형하는 단계는
2개의 양자값(qf, qc)을 수학식

따라 변형된 양자값(qf *, qc *)으로 변형하는 인공 신경망을 위한 양자화 방법.
The method of claim 13, wherein the step of modifying the quantum value is
Two quantum values (q f , q c ) are expressed in the equation

A quantization method for an artificial neural network that transforms into quantum values (q f * , q c * ) transformed according to the following.
제14항에 있어서, 상기 양자화값을 계산하는 단계는
상기 양자화값을 수학식

에 따라 획득하는 인공 신경망을 위한 양자화 방법.
The method of claim 14, wherein the step of calculating the quantization value is
The quantization value is expressed in the equation

A quantization method for artificial neural networks obtained according to .
제9항에 있어서, 상기 정규화값을 출력하는 단계는
기지정된 상한값(u)과 하한값(l)에 따라 상기 대상값을 클리핑하여 클리핑값(xc)을 획득하는 단계; 및
획득된 클리핑값(xc)을 수학식

에 따라 정규화하여 기지정된 양자화 비트수(k)에 대응하는 양자화 범위로 정규화하는 단계를 포함하는 인공 신경망을 위한 양자화 방법.
The method of claim 9, wherein the step of outputting the normalized value is
Obtaining a clipping value (x c ) by clipping the target value according to a predetermined upper limit (u) and lower limit (l); and
The obtained clipping value (x c ) is calculated using the equation

A quantization method for an artificial neural network comprising normalizing according to and normalizing to a quantization range corresponding to a predetermined number of quantization bits (k).
제9항 내지 제16항 중 어느 한 항에 따른 양자화 방법을 실행하기 위한 프로그램 명령어가 기록된, 컴퓨터가 판독 가능한 기록매체.A computer-readable recording medium on which program instructions for executing the quantization method according to any one of claims 9 to 16 are recorded.
KR1020200135673A 2020-10-20 Quantizer And Quantization Method For Artificial Neural Networks KR102684061B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020200135673A KR102684061B1 (en) 2020-10-20 Quantizer And Quantization Method For Artificial Neural Networks

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020200135673A KR102684061B1 (en) 2020-10-20 Quantizer And Quantization Method For Artificial Neural Networks

Publications (2)

Publication Number Publication Date
KR20220051947A KR20220051947A (en) 2022-04-27
KR102684061B1 true KR102684061B1 (en) 2024-07-10

Family

ID=

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200302224A1 (en) 2019-03-21 2020-09-24 Illumina, Inc. Artificial Intelligence-Based Sequencing

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200302224A1 (en) 2019-03-21 2020-09-24 Illumina, Inc. Artificial Intelligence-Based Sequencing

Similar Documents

Publication Publication Date Title
US11593663B2 (en) Data discriminator training method, data discriminator training apparatus, non-transitory computer readable medium, and training method
WO2020019236A1 (en) Loss-error-aware quantization of a low-bit neural network
CN110969251B (en) Neural network model quantification method and device based on label-free data
CN111612134B (en) Neural network structure searching method and device, electronic equipment and storage medium
JP7376731B2 (en) Image recognition model generation method, device, computer equipment and storage medium
JP2011034177A (en) Information processor, information processing method, and program
JPH06348292A (en) Voice recognition system
CN111667016B (en) Incremental information classification method based on prototype
WO2020195940A1 (en) Model reduction device of neural network
CN113222103A (en) Neural network updating method, neural network classifying method and electronic device
KR102684061B1 (en) Quantizer And Quantization Method For Artificial Neural Networks
US5555439A (en) Learning system and a learning pattern showing method for a neural network
JP2008009548A (en) Model preparation device and discrimination device
KR20220051947A (en) Quantizer And Quantization Method For Artificial Neural Networks
KR102409476B1 (en) Quantizer For Artificial Neural Networks And Loss Backpropagation Method Thereof
CN113177627B (en) Optimization system, retraining system, method thereof, processor and readable medium
KR102657904B1 (en) Method and apparatus for multi-level stepwise quantization for neural network
CN111967499B (en) Data dimension reduction method based on self-learning
JP7184801B2 (en) LEARNING APPARATUS, LEARNING METHOD, AND LEARNING PROGRAM
Nejadgholi et al. Nonlinear normalization of input patterns to speaker variability in speech recognition neural networks
CN111913685A (en) Arithmetic processing device, arithmetic processing method, and non-transitory computer-readable medium
KR100921892B1 (en) Method and system for generating rank learning model using weight regularization
US20240028901A1 (en) Learning apparatus and method
US20190251203A1 (en) Data processing device, data processing method, and computer program product
US20240086408A1 (en) Data query apparatus, method, and storage medium