KR102494095B1 - Apparatus and method for learning artificial neural network - Google Patents

Apparatus and method for learning artificial neural network Download PDF

Info

Publication number
KR102494095B1
KR102494095B1 KR1020220083328A KR20220083328A KR102494095B1 KR 102494095 B1 KR102494095 B1 KR 102494095B1 KR 1020220083328 A KR1020220083328 A KR 1020220083328A KR 20220083328 A KR20220083328 A KR 20220083328A KR 102494095 B1 KR102494095 B1 KR 102494095B1
Authority
KR
South Korea
Prior art keywords
artificial neural
neural network
layer
learning
result data
Prior art date
Application number
KR1020220083328A
Other languages
Korean (ko)
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 주식회사 스퀴즈비츠
Priority to KR1020220083328A priority Critical patent/KR102494095B1/en
Application granted granted Critical
Publication of KR102494095B1 publication Critical patent/KR102494095B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • 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/045Combinations of networks
    • 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

Landscapes

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

Abstract

The present invention relates to an artificial neural network learning device and method for quantizing an artificial neural network model to be learned according to a difference between a final output value of a learned artificial neural network model and a final output value of the artificial neural network model to be learned. The artificial neural network learning device according to an embodiment of the present invention, which is an artificial neural network learning device for training a second artificial neural network that is a learning target according to a first artificial neural network that has completed learning, comprises: a learning unit that inputs data for artificial neural network training into an input layer of the second artificial neural network to train the second artificial neural network and stores second result data output from a final linear layer of the second artificial neural network; and a quantization unit that inputs a loss value according to a difference between first result data of the first artificial neural network and second result data of the second artificial neural network into a final linear layer of the second artificial neural network to quantize the second artificial neural network.

Description

인공 신경망 학습 장치 및 방법{APPARATUS AND METHOD FOR LEARNING ARTIFICIAL NEURAL NETWORK}Artificial neural network learning apparatus and method {APPARATUS AND METHOD FOR LEARNING ARTIFICIAL NEURAL NETWORK}

본 발명은 인공 신경망 학습 장치 및 방법에 관한 것이다.The present invention relates to an artificial neural network learning apparatus and method.

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

이러한 인공 신경망은 미리 학습에 의해 획득된 가중치와 입력 데이터에 대한 대량의 행렬(또는 벡터) 연산을 수행하여 요구되는 동작을 수행한다. 그리고 인공 신경망은 실제 이용되기 이전에 대량의 반복 학습이 수행되어야만 요구되는 성능을 나타낼 수 있다. 즉 인공 신경망은 학습 및 실제 운용 과정에서 대량의 덧셈 및 곱셈 연산이 수행되어야 한다.Such an artificial neural network performs a required operation by performing a large amount of matrix (or vector) calculations on input data and weights obtained through learning in advance. In addition, an artificial neural network can exhibit required performance only when a large amount of iterative learning is performed before actual use. That is, artificial neural networks must perform a large amount of addition and multiplication operations during learning and actual operation.

따라서 대량의 행렬 연산에 대한 연산 효율성이 인공 신경망의 성능을 크게 좌우하게 된다. 이에 최근에는 인공 신경망에서 연산되어야 하는 입력 데이터 또는 가중치 중 적어도 하나를 양자화하여 연산을 수행하도록 함으로써 연산 효율성을 향상시키고자 하는 연구가 활발하게 수행되고 있다.Therefore, the computational efficiency of large-scale matrix operations greatly influences the performance of artificial neural networks. In recent years, studies have been actively conducted to improve computational efficiency by quantizing at least one of input data or weights to be computed in an artificial neural network to perform computation.

대한민국 공개특허공보 제10-2022-0051943호Republic of Korea Patent Publication No. 10-2022-0051943

본 발명의 일 실시예에 따르면, 학습된 인공 신경망 모델의 최종 출력값과 학습 대상인 인공 신경망 모델의 최종 출력값 간의 차에 따라 학습 대상인 인공 신경망 모델을 양자화시키는 인공 신경망 학습 장치 및 방법을 제공된다.According to an embodiment of the present invention, an artificial neural network learning apparatus and method for quantizing an artificial neural network model to be learned according to a difference between a final output value of a learned artificial neural network model and a final output value of the artificial neural network model to be learned is provided.

상술한 본 발명의 과제를 해결하기 위해, 본 발명의 일 실시예에 따른 인공 신경망 학습 장치는 학습이 완료된 제1 인공 신경망에 따라 학습 대상인 제2 인공 신경망을 학습시키는 인공 신경망 학습 장치에 있어서, 인공 신경망 학습(training)을 위한 입력 데이터를 상기 제2 인공 신경망의 입력 레이어에 입력해서 상기 제2 인공 신경망을 학습시키고, 상기 제2 인공 신경망의 최종 선형 레이어로부터 출력되는 제2 결과 데이터를 저장시키는 학습부와, 상기 제1 인공 신경망의 제1 결과 데이터와 상기 제2 인공 신경망의 상기 제2 결과 데이터 간의 차에 따른 손실값을 상기 제2 인공 신경망의 최종 선형 레이어에 입력하여 상기 제2 인공 신경망을 양자화시키는 양자화부를 포함할 수 있다. In order to solve the above problems of the present invention, an artificial neural network learning apparatus according to an embodiment of the present invention is an artificial neural network learning apparatus for learning a second artificial neural network as a learning target according to a first artificial neural network that has been learned. Learning to input input data for neural network training to an input layer of the second artificial neural network to train the second artificial neural network and to store second result data output from a final linear layer of the second artificial neural network and a loss value according to the difference between the first result data of the first artificial neural network and the second result data of the second artificial neural network is input to the final linear layer of the second artificial neural network to form the second artificial neural network. A quantization unit for quantization may be included.

본 발명의 일 실시예에 따르면, 인공 신경망 모델의 양자화로부터 유발되는 정확도 손실을 저감시키는 효과가 있다.According to an embodiment of the present invention, there is an effect of reducing accuracy loss caused by quantization of an artificial neural network model.

도 1은 본 발명의 일 실시예에 따른 인공 신경망 학습 장치의 개략적인 구성도이다.
도 2는 본 발명의 일 실시예에 따른 인공 신경망 학습 방법의 개략적인 플로우차트이다.
도 3a 내지 도 3d는 본 발명의 일 실시예에 따른 인공 신경망 학습 장치 및 방법에 따른 인공 신경망의 학습을 나타내는 도면이다.
1 is a schematic configuration diagram of an artificial neural network learning apparatus according to an embodiment of the present invention.
2 is a schematic flowchart of an artificial neural network training method according to an embodiment of the present invention.
3A to 3D are diagrams illustrating learning of an artificial neural network according to an apparatus and method for learning an artificial neural network according to an embodiment of the present invention.

이하, 첨부된 도면을 참조하여 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자가 본 발명을 용이하게 실시할 수 있도록 바람직한 실시예를 상세히 설명한다. Hereinafter, preferred embodiments will be described in detail so that those skilled in the art can easily practice the present invention with reference to the accompanying drawings.

도 1은 본 발명의 일 실시예에 따른 인공 신경망 학습 장치의 개략적인 구성도이다.1 is a schematic configuration diagram of an artificial neural network learning apparatus according to an embodiment of the present invention.

도 1을 참조하면, 본 발명의 일 실시예에 따른 인공 신경망 학습 장치(100)는 학습부(110), 메모리(120) 및 양자화부(130)를 포함할 수 있다.Referring to FIG. 1 , an artificial neural network learning apparatus 100 according to an embodiment of the present invention may include a learning unit 110, a memory 120, and a quantization unit 130.

학습부(110)는 이미 학습 완료된 제1 인공 신경망 모델에 따라 학습 대상인 제2 인공 신경망 모델을 학습시킬 수 있다. 상기 제1 인공 신경망 모델의 출력값과 상기 제2 인공 신경망 모델의 출력값은 메모리(120)에 저장될 수 있다. 상기 제1 인공 신경망 모델의 출력값과 상기 제2 인공 신경망 모델의 출력값은 상기 제1 및 제2 인공 신경망 모델의 최종 출력값과 중간 출력값을 포함할 수 있다.The learning unit 110 may train a second artificial neural network model, which is a learning target, according to the first artificial neural network model that has already been learned. An output value of the first artificial neural network model and an output value of the second artificial neural network model may be stored in the memory 120 . The output value of the first artificial neural network model and the output value of the second artificial neural network model may include final output values and intermediate output values of the first and second artificial neural network models.

양자화부(130)는 메모리(120)에 저장된 상기 제1 인공 신경망 모델의 출력값과 상기 제2 인공 신경망 모델의 출력값의 차에 따른 손실값을 상기 제2 인공 신경망 모델의 최종 선형 레이어에 입력하여 역전파 동작을 통해 상기 제2 인공 신경망 모델을 양자화시킬 수 있다. The quantization unit 130 inputs the loss value according to the difference between the output value of the first artificial neural network model and the output value of the second artificial neural network model stored in the memory 120 to the final linear layer of the second artificial neural network model, and converts the loss value. The second artificial neural network model may be quantized through a propagation operation.

도 2는 본 발명의 일 실시예에 따른 인공 신경망 학습 방법의 개략적인 플로우차트이다. 2 is a schematic flowchart of an artificial neural network training method according to an embodiment of the present invention.

도 1과 함께, 도 2를 참조하면, 먼저, 학습부(110)는 인공 신경망 학습(training)을 위한 입력 데이터(input)를 상기 제2 인공 신경망 모델인 부동소수점 인공신경망 모델의 입력 레이어에 입력해서 순전파(forward propagation) 및 역전파(backward propagation) 동작을 수행하여 상기 제2 인공 신경망 모델을 학습시켜 상기 제2 인공 신경망의 최종 선형 레이어(linear)로부터 출력되는 제2 결과 데이터를 메모리(120)에 저장시킬 수 있다(S1).Referring to FIG. 2 together with FIG. 1 , first, the learning unit 110 inputs input data for artificial neural network training to an input layer of a floating-point artificial neural network model, which is the second artificial neural network model. Thus, forward propagation and backward propagation are performed to learn the second artificial neural network model, and the second result data output from the final linear layer of the second artificial neural network is stored in the memory 120. ) can be stored (S1).

양자화부(130)는 메모리(120)에 저장된 상기 제1 인공 신경망 모델의 출력값과 상기 제2 인공 신경망 모델의 출력값 간의 차에 따른 손실값을 상기 제2 인공 신경망 모델의 최종 선형 레이어에 입력하여 역전파 동작을 통해 상기 제2 인공 신경망 모델을 양자화시키는데, 먼저, 상기 제2 인공 신경망 모델의 각 레이어의 웨이트 가중치를 양자화시키고(S2), 이후 상기 제2 인공 신경망 모델의 각 레이어의 중간 출력값을 양자화시켜(S3), 상기 제2 인공 신경망 모델을 정수형으로 양자화된 인공 신경망 모델로 생성할 수 있다(S4).The quantization unit 130 inputs the loss value according to the difference between the output value of the first artificial neural network model and the output value of the second artificial neural network model stored in the memory 120 to the final linear layer of the second artificial neural network model, and converts the loss value. The second artificial neural network model is quantized through a propagation operation. First, the weight weight of each layer of the second artificial neural network model is quantized (S2), and then the intermediate output value of each layer of the second artificial neural network model is quantized. (S3), the second artificial neural network model may be generated as an artificial neural network model quantized in integer form (S4).

양자화부(130)는 하기의 수식에 따라, 상기 제2 인공 신경망 모델을 양자화시킬 수 있다.The quantization unit 130 may quantize the second artificial neural network model according to the following formula.

수식) formula)

x_q = s*[clamp(round((x_fp- b)/s);0,2n-1)]+bx_q = s*[clamp(round((x_fp- b)/s);0,2 n-1 )]+b

여기서,here,

x_fp: 부동소수점으로 표현된 웨이트 가중치 또는 중간값 x_fp: weight weight or median value expressed as floating point

round: round function (반올림 함수)round: round function

s: quantization scale(양자화 스케일)s: quantization scale

b: quantization bias (양자화 바이어스)b: quantization bias

clamp(x;min,max): x값을 [min, max] 범위로 제한시키는 함수clamp(x;min,max): a function that clamps the value of x to the range [min, max]

n: 양자화 비트 수n: number of quantization bits

x_q: x_fp의 양자화 결과값을 의미하며, x_q: means the quantization result of x_fp,

인공신경망의 모델의 부동소수점으로 저장되어 있는 웨이트 가중치 또는 중간값들(x_fp로 통칭)을 양자화하여 x_q를 얻을 수 있다.x_q can be obtained by quantizing weight weights or intermediate values (commonly referred to as x_fp) stored as floating point values of the artificial neural network model.

즉, 양자화부(130)는 상기 제2 인공 신경망을 양자화시키는데 필요한 양자화 스케일 및 양자화 바이어스를 미세 조정하여 최적값을 구할 수 있다.That is, the quantization unit 130 may obtain an optimal value by finely adjusting the quantization scale and quantization bias required to quantize the second artificial neural network.

상술한 양자화부(130)의 양자화 동작을 보다 상세히 설명하도록 한다.The above-described quantization operation of the quantization unit 130 will be described in more detail.

도 3a 내지 도 3d는 본 발명의 일 실시예에 따른 인공 신경망 학습 장치 및 방법에 따른 인공 신경망의 학습을 나타내는 도면이다.3A to 3D are diagrams illustrating learning of an artificial neural network according to an apparatus and method for learning an artificial neural network according to an embodiment of the present invention.

도 1 및 도 2와 함께, 도 3a를 참조하면, 양자화부(130)는 상기 제1 인공 신경망 모델의 출력값(Output_fp)과 상기 제2 인공 신경망 모델의 출력값(Output_q) 간의 차에 따른 손실값(L=(output_fp-output_q)p)(여기서, P는 1 이상의 실수)를 상기 제2 인공 신경망 모델의 최종 선형 레이어에 역전파하여 상기 제2 인공 신경망 모델을 양자화할 수 있다.Referring to FIG. 3A together with FIGS. 1 and 2, the quantization unit 130 provides a loss value ( The second artificial neural network model may be quantized by back-propagating L=(output_fp-output_q) p ) (where P is a real number greater than or equal to 1) to a final linear layer of the second artificial neural network model.

도 1 및 도 2와 함께, 도 3b를 참조하면, 양자화부(130)는 상기 제2 인공 신경망 모델의 최종 선형 레이어의 양자화가 종료된 이후, 상기 제1 인공 신경망 모델의 출력값(Output_fp)과 상기 제2 인공 신경망 모델의 출력값(Output_q) 간의 차에 따른 태스크 로스(task loss)(softmax(output_q, output_fp))와 최종 선형 레이어(Linear) 전단의 레이어의 출력값 간의 차(Act3_fp-Act3_q)에 따른 손실값(L=(Act3_fp-Act3_q)p+softmax(output_q, output_fp))(여기서, p는 1 이상의 실수)을 최종 선형 레이어(Linear) 전단의 레이어(Act3)에 역전파하여 최종 선형 레이어(Linear) 전단의 레이어(Act3)를 양자화할 수 있다.Referring to FIG. 3B together with FIGS. 1 and 2 , the quantization unit 130 determines the output value (Output_fp) of the first artificial neural network model and the Loss according to task loss (softmax(output_q, output_fp)) according to the difference between the output values (Output_q) of the second artificial neural network model and the difference (Act3_fp-Act3_q) between the output values of the previous layer of the final linear layer (Linear) The value (L=(Act3_fp-Act3_q) p +softmax(output_q, output_fp)) (where p is a real number greater than or equal to 1) is back-propagated to the previous layer (Act3) of the final linear layer (Linear) to obtain the final linear layer (Linear). The previous layer (Act3) can be quantized.

도 1 및 도 2와 함께, 도 3c를 참조하면, 양자화부(130)는 상기 제2 인공 신경망 모델의 최종 선형 레이어의 양자화가 종료된 이후, 상기 제1 인공 신경망 모델의 출력값(Output_fp)과 상기 제2 인공 신경망 모델의 출력값(Output_q) 간의 차에 따른 태스크 로스(task loss)(softmax(output_q, output_fp))와 최종 선형 레이어(Linear) 전단의 레이어(Act3)의 출력값 간의 차(Act3_fp-Act3_q) 및 최종 선형 레이어(Linear) 전전단의 레이어(Act2)의 출력값 간의 차(Act2_fp-Act2_q)에 따른 손실값(L=(Act2_fp-Act2_q)p+a(Act3_fp-Act3_q)p+softmax(output_q, output_fp))(여기서, p는 1 이상의 실수이고, a는 실험에 의해 선정될 수 있는 상수)을 최종 선형 레이어(Linear) 전전단의 레이어(Act2)에 역전파하여 최종 선형 레이어(Linear) 전전단의 레이어(Act2)를 양자화할 수 있다.Referring to FIG. 3C together with FIGS. 1 and 2, the quantization unit 130 determines the output value (Output_fp) of the first artificial neural network model and the output value of the first artificial neural network model after quantization of the final linear layer of the second artificial neural network model is completed. The difference between the task loss (softmax(output_q, output_fp)) according to the difference between the output values (Output_q) of the second artificial neural network model and the output values of the previous layer (Act3) of the final linear layer (Linear) (Act3_fp-Act3_q) and the loss value (L=(Act2_fp-Act2_q) p +a(Act3_fp-Act3_q) p +softmax(output_q, output_fp) according to the difference (Act2_fp-Act2_q) between the output values of the previous layer (Act2) of the final linear layer )) (where p is a real number of 1 or more, and a is a constant that can be selected by experiment) is back-propagated to the layer (Act2) of the final linear layer (Linear) front-end The layer Act2 may be quantized.

도 1 및 도 2와 함께, 도 3d를 참조하면, 양자화부(130)는 상기 제2 인공 신경망 모델의 최종 선형 레이어의 양자화가 종료된 이후, 상기 제1 인공 신경망 모델의 출력값(Output_fp)과 상기 제2 인공 신경망 모델의 출력값(Output_q) 간의 차에 따른 태스크 로스(task loss)(softmax(output_q, output_fp))와 최종 선형 레이어(Linear) 전단의 레이어의 출력값 간의 차(Act3_fp-Act3_q), 최종 선형 레이어(Linear) 전전단의 레이어(Act2)의 출력값 간의 차(Act2_fp-Act2_q) 및 최전단 레이어(Act1)의 출력값 간의 차(Act1_fp-Act1_q)에 따른 손실값(L=(Act1_fp-Act1_q)p+a(Act2_fp-Act2_q)p+b(Act3_fp-Act3_q)p+softmax(output_q, output_fp))(여기서, p는 1 이상의 실수이고, a, b는 실험에 의해 선정될 수 있는 상수)을 최전단의 레이어(Act1)에 역전파하여 최전단의 레이어(Act1)를 양자화할 수 있다. Referring to FIG. 3D together with FIGS. 1 and 2, the quantization unit 130, after quantization of the final linear layer of the second artificial neural network model, output values (Output_fp) of the first artificial neural network model and the The task loss (softmax(output_q, output_fp)) according to the difference between the output values (Output_q) of the second artificial neural network model and the difference between the output values of the previous layer (Act3_fp-Act3_q) of the final linear layer (Linear), the final linear Layer (Linear) Loss value (L=(Act1_fp-Act1_q) according to the difference between the output values of the previous layer (Act2) (Act2_fp-Act2_q) and the difference between the output values of the previous layer (Act1) (Act1_fp-Act1_q) p + a(Act2_fp-Act2_q) p +b(Act3_fp-Act3_q) p +softmax(output_q, output_fp)) (where p is a real number of 1 or more, and a and b are constants that can be selected by experiment) at the foremost Backpropagation is performed on the layer Act1 to quantize the topmost layer Act1.

상술한 인공 신경망 모델에서는 하나의 최종 선형 레이어와 그 전단의 3개의 레이어를 예시하였으나, 최종 선형 레이어와 그 전단의 레이어의 수와 구성은 다양할 수 있다.In the artificial neural network model described above, one final linear layer and three previous layers are exemplified, but the number and composition of the final linear layer and the previous layer may vary.

양자화부(130)는 상술한 양자화 동작을 상기 제2 인공 신경망 모델의 각 레이어의 웨이트 가중치를 양자화시키는 단계(S2)에 수행할 수 있고, 이후 상기 제2 인공 신경망 모델의 각 레이어의 중간 출력값을 양자화시는 단계(S3)에 수행할 수 있다. The quantization unit 130 may perform the above-described quantization operation in step S2 of quantizing the weight weight of each layer of the second artificial neural network model, and then calculates the intermediate output value of each layer of the second artificial neural network model. Quantization may be performed in step S3.

상술한 본 발명의 일 실시예에 따른 인공 신경망 학습 장치는 컴퓨팅 디바이스로 구성될 수 있고, 상기 컴퓨팅 디바이스는 적어도 하나의 프로세싱 유닛를 포함할 수 있다. 여기서, 상기 적어도 하나의 프로세싱 유닛은 예를 들어 중앙처리장치(CPU), 그래픽처리장치(GPU), 마이크로프로세서, 주문형 반도체(Application Specific Integrated Circuit, ASIC), 필드 프로그래밍 가능 게이트 어레이(Field Programmable Gate Arrays; FPGA) 등을 포함할 수 있으며, 복수의 코어를 가질 수 있다. 메모리(1120)는 휘발성 메모리(예를 들어, RAM 등), 비휘발성 메모리(예를 들어, ROM, 플래시 메모리 등) 또는 이들의 조합일 수 있다.The above-described artificial neural network learning apparatus according to an embodiment of the present invention may include a computing device, and the computing device may include at least one processing unit. Here, the at least one processing unit is, for example, a central processing unit (CPU), a graphic processing unit (GPU), a microprocessor, an application specific integrated circuit (ASIC), a field programmable gate array (Field Programmable Gate Arrays) ; FPGA), etc., and may have a plurality of cores. The memory 1120 may be volatile memory (eg, RAM, etc.), non-volatile memory (eg, ROM, flash memory, etc.), or a combination thereof.

또한, 상기 컴퓨팅 디바이스는 추가적인 스토리지를 포함할 수도 있다. 상기 스토리지는 자기 스토리지, 광학 스토리지 등을 포함하지만 이것으로 한정되지 않는다. 상기 스토리지에는 본 명세서에 개진된 하나 이상의 실시예를 구현하기 위한 컴퓨터 판독 가능한 명령이 저장될 수 있고, 운영 시스템, 애플리케이션 프로그램 등을 구현하기 위한 다른 컴퓨터 판독 가능한 명령도 저장될 수 있다. 상기 스토리지에 저장된 컴퓨터 판독 가능한 명령은 상기 적어도 하나의 프로세싱 유닛에 의해 실행되기 위해 메모리(120)에 로딩될 수 있다.Additionally, the computing device may include additional storage. The storage includes, but is not limited to, magnetic storage, optical storage, and the like. The storage may store computer readable instructions for implementing one or more embodiments disclosed herein, and may also store other computer readable instructions for implementing an operating system, application programs, and the like. Computer readable instructions stored in the storage may be loaded into memory 120 for execution by the at least one processing unit.

또한, 상기 컴퓨팅 디바이스는 입력 디바이스(들) 및 출력 디바이스(들)을 포함할 수 있다. 여기서, 상기 입력 디바이스(들)은 예를 들어 키보드, 마우스, 펜, 음성 입력 디바이스, 터치 입력 디바이스, 적외선 카메라, 비디오 입력 디바이스 또는 임의의 다른 입력 디바이스 등을 포함할 수 있다. 또한, 상기 출력 디바이스(들)은 예를 들어 하나 이상의 디스플레이, 스피커, 프린터 또는 임의의 다른 출력 디바이스 등을 포함할 수 있다. 또한, 상기 컴퓨팅 디바이스는 다른 컴퓨팅 디바이스에 구비된 입력 디바이스 또는 출력 디바이스를 상기 입력 디바이스(들) 또는 상기 출력 디바이스(들)로서 사용할 수도 있다.Additionally, the computing device may include input device(s) and output device(s). Here, the input device(s) may include, for example, a keyboard, mouse, pen, voice input device, touch input device, infrared camera, video input device, or any other input device. Also, the output device(s) may include, for example, one or more displays, speakers, printers, or any other output device or the like. Also, the computing device may use an input device or an output device provided in another computing device as the input device(s) or the output device(s).

또한, 상기 컴퓨팅 디바이스는 네트워크를 통하여 다른 디바이스(예를 들어, 다른 컴퓨팅 디바이스)와 통신할 수 있게 하는 통신접속(들)을 포함할 수 있다. 여기서, 상기 통신 접속(들)은 모뎀, 네트워크 인터페이스 카드(NIC), 통합 네트워크 인터페이스, 무선 주파수 송신기/수신기, 적외선 포트, USB 접속 또는 상기 컴퓨팅 디바이스를 다른 컴퓨팅 디바이스에 접속시키기 위한 다른 인터페이스를 포함할 수 있다. 또한, 상기 통신 접속(들)은 유선 접속 또는 무선 접속을 포함할 수 있다.Additionally, the computing device may include communication connection(s) that allow it to communicate with other devices (eg, other computing devices) over a network. Here, the communication connection(s) may include a modem, network interface card (NIC), integrated network interface, radio frequency transmitter/receiver, infrared port, USB connection, or other interface for connecting the computing device to another computing device. can Additionally, the communication connection(s) may include a wired connection or a wireless connection.

상술한 컴퓨팅 디바이스의 각 구성요소는 버스 등의 다양한 상호접속(예를 들어, 주변 구성요소 상호접속(PCI), USB, 펌웨어(IEEE 1394), 광학적 버스 구조 등)에 의해 접속될 수도 있고, 네트워크에 의해 상호접속될 수도 있다.Each component of the computing device described above may be connected by various interconnections such as a bus (eg, peripheral component interconnection (PCI), USB, firmware (IEEE 1394), optical bus structure, etc.), or may be connected to a network may be interconnected by

본 명세서에서 사용되는 "학습부", "양자화부", "인공신경망 모델" 등과 같은 용어들은 일반적으로 하드웨어, 하드웨어와 소프트웨어의 조합, 소프트웨어, 또는 실행중인 소프트웨어인 컴퓨터 관련 엔티티를 지칭하는 것이다. 예를 들어, 구성요소는 프로세서 상에서 실행중인 프로세스, 프로세서, 객체, 실행 가능물(executable), 실행 스레드, 프로그램 및/또는 컴퓨터일 수 있지만, 이것으로 한정되는 것은 아니다. 예를 들어, 컨트롤러 상에서 구동중인 애플리케이션 및 컨트롤러 모두가 구성요소일 수 있다. 하나 이상의 구성요소는 프로세스 및/또는 실행의 스레드 내에 존재할 수 있으며, 구성요소는 하나의 컴퓨터 상에서 로컬화될 수 있고, 둘 이상의 컴퓨터 사이에서 분산될 수도 있다.Terms such as “learning unit,” “quantization unit,” “artificial neural network model,” and the like used herein generally refer to computer-related entities that are hardware, a combination of hardware and software, software, or running software. For example, a component may be, but is not limited to, a process running on a processor, a processor, an object, an executable, a thread of execution, a program, and/or a computer. For example, both the application running on the controller and the controller may be components. One or more components can reside within a process and/or thread of execution and a component can be localized on one computer or distributed between two or more computers.

상술한 바와 같이, 본 발명에 따르면, 종래의 양자화에 대비하여 소요 시간이 크게 증가하지는 않으면서 인공 신경망 모델의 양자화로부터 유발되는 정확도 손실을 저감시킬 수 있다.As described above, according to the present invention, accuracy loss caused by quantization of an artificial neural network model can be reduced without significantly increasing the required time compared to conventional quantization.

이상에서 설명한 본 발명은 전술한 실시예 및 첨부된 도면에 의해 한정되는 것이 아니고 후술하는 특허청구범위에 의해 한정되며, 본 발명의 구성은 본 발명의 기술적 사상을 벗어나지 않는 범위 내에서 그 구성을 다양하게 변경 및 개조할 수 있다는 것을 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자는 쉽게 알 수 있다.The present invention described above is not limited by the above-described embodiments and the accompanying drawings, but is limited by the claims to be described later, and the configuration of the present invention can be varied within a range that does not deviate from the technical spirit of the present invention. Those skilled in the art can easily know that the present invention can be changed and modified accordingly.

100: 인공 신경망 학습 장치
110: 학습부
120: 메모리
130: 양자화부
100: artificial neural network learning device
110: learning unit
120: memory
130: quantization unit

Claims (9)

학습이 완료된 제1 인공 신경망에 따라 학습 대상인 제2 인공 신경망을 학습시키는 인공 신경망 학습 장치에 있어서,
인공 신경망 학습(training)을 위한 입력 데이터를 상기 제2 인공 신경망의 입력 레이어에 입력해서 상기 제2 인공 신경망을 학습시키고, 상기 제2 인공 신경망의 최종 선형 레이어로부터 출력되는 제2 결과 데이터를 저장시키는 학습부; 및
상기 제1 인공 신경망의 제1 결과 데이터와 상기 제2 인공 신경망의 상기 제2 결과 데이터 간의 차에 따른 손실값을 상기 제2 인공 신경망의 최종 선형 레이어에 입력하여 상기 제2 인공 신경망을 양자화시키는 양자화부를 포함하고,
상기 양자화부는 상기 제2 인공 신경망을 양자화시키는데 필요한 양자화 스케일 및 양자화 바이어스를 미세 조정하여 최적값을 구하며,
상기 양자화부는 상기 제2 인공 신경망의 각 레이어의 웨이트 가중치를 양자화시킨 후, 상기 제2 인공 신경망의 각 레이어의 중간 출력값을 양자화시키는
인공 신경망 학습 장치.
An artificial neural network learning apparatus for learning a second artificial neural network as a learning target according to a first artificial neural network for which learning has been completed,
Inputting input data for artificial neural network training to an input layer of the second artificial neural network to train the second artificial neural network, and storing second result data output from a final linear layer of the second artificial neural network learning department; and
Quantization in which the second artificial neural network is quantized by inputting a loss value according to a difference between the first result data of the first artificial neural network and the second result data of the second artificial neural network to a final linear layer of the second artificial neural network. including wealth,
The quantization unit obtains an optimal value by finely adjusting a quantization scale and a quantization bias required to quantize the second artificial neural network;
The quantization unit quantizes the weight of each layer of the second artificial neural network and then quantizes the intermediate output value of each layer of the second artificial neural network.
Artificial neural network learning device.
삭제delete 제1항에 있어서,
상기 양자화부는 상기 제1 결과 데이터와 제2 결과 데이터 간의 차에 따른 손실값과 상기 제1 및 제2 인공 신경망 각각의 최종 선형 레이어 전단의 각 레이어의 출력값 간의 차에 따른 손실값을 상기 제2 인공 신경망의 상기 전단 레이어에 입력하여 역전파 동작을 수행하고, 상기 역전파 동작에 기반하여 상기 제2 인공 신경망을 양자화시키는 인공 신경망 학습 장치.
According to claim 1,
The quantization unit converts a loss value according to a difference between the first result data and the second result data and a loss value according to a difference between an output value of each layer in front of the final linear layer of each of the first and second artificial neural networks to the second artificial neural network. An artificial neural network training apparatus for performing a backpropagation operation by inputting input to the previous layer of a neural network, and quantizing the second artificial neural network based on the backpropagation operation.
제3항에 있어서,
상기 양자화부는 상기 제1 결과 데이터와 제2 결과 데이터 간의 차에 따른 손실값과 상기 제1 및 제2 인공 신경망 각각의 최종 선형 레이어 전단의 각 레이어의 출력값 간의 차에 따른 손실값을 상기 제2 인공 신경망의 상기 전단 레이어에 입력하여 상기 제2 인공 신경망의 각 레이어의 웨이트 가중치를 양자화시키고, 상기 제2 인공 신경망의 각 레이어의 중간 출력값을 양자화시키는 인공 신경망 학습 장치.
According to claim 3,
The quantization unit converts a loss value according to a difference between the first result data and the second result data and a loss value according to a difference between an output value of each layer in front of the final linear layer of each of the first and second artificial neural networks to the second artificial neural network. Artificial neural network learning apparatus for quantizing weight weights of each layer of the second artificial neural network by inputting the input to the previous layer of the neural network, and quantizing an intermediate output value of each layer of the second artificial neural network.
삭제delete 삭제delete 학습이 완료된 제1 인공 신경망에 따라 학습 대상인 제2 인공 신경망을 양자화시키는 인공 신경망 학습 방법에 있어서,
학습부가 입력 데이터를 상기 제2 인공 신경망의 입력 레이어에 입력해서 제2 인공 신경망을 학습시키는 단계; 및
양자화부가 상기 제1 인공 신경망의 제1 결과 데이터와 상기 제2 인공 신경망의 제2 결과 데이터 간의 차에 따른 손실값을 상기 제2 인공 신경망의 최종 선형 레이어에 입력하여 상기 제2 인공 신경망을 양자화시키는 단계를 포함하고,
상기 양자화시키는 단계는 상기 양자화부가 상기 제2 인공 신경망을 양자화시키는데 필요한 양자화 스케일 및 양자화 바이어스를 미세조정하여 최적값을 구하며,
상기 양자화시키는 단계는
상기 양자화부가 상기 제2 인공 신경망의 각 레이어의 웨이트 가중치를 양자화시키는 단계; 및
상기 양자화부가 상기 제2 인공 신경망의 각 레이어의 중간 출력값을 양자화시키는 단계
를 포함하는 인공 신경망 학습 방법.
An artificial neural network learning method for quantizing a second artificial neural network to be learned according to a first artificial neural network for which learning has been completed,
learning the second artificial neural network by a learning unit inputting input data to an input layer of the second artificial neural network; and
The quantization unit quantizes the second artificial neural network by inputting a loss value according to a difference between the first result data of the first artificial neural network and the second result data of the second artificial neural network to the final linear layer of the second artificial neural network. contains steps,
In the quantization step, the quantizer obtains an optimal value by finely adjusting a quantization scale and a quantization bias required to quantize the second artificial neural network;
The quantization step is
quantizing, by the quantization unit, a weight weight of each layer of the second artificial neural network; and
Quantizing, by the quantization unit, an intermediate output value of each layer of the second artificial neural network.
Artificial neural network learning method comprising a.
제7항에 있어서,
상기 각 레이어의 웨이트 가중치를 양자화시키는 단계는 상기 양자화부가 상기 제1 결과 데이터와 제2 결과 데이터 간의 차에 따른 손실값과 상기 제1 및 제2 인공 신경망 각각의 최종 선형 레이어 전단의 각 레이어의 출력값 간의 차에 따른 손실값을 상기 제2 인공 신경망의 상기 전단 레이어에 입력하여 상기 제2 인공 신경망의 각 레이어의 웨이트 가중치를 양자화시키는 인공 신경망 학습 방법.
According to claim 7,
The step of quantizing the weight weight of each layer may include a loss value according to a difference between the first result data and the second result data by the quantizer and an output value of each layer prior to the final linear layer of each of the first and second artificial neural networks. Artificial neural network learning method of quantizing the weight weight of each layer of the second artificial neural network by inputting a loss value according to the difference between the artificial neural networks to the previous layer of the second artificial neural network.
제7항에 있어서,
상기 각 레이어의 중간 출력값을 양자화시키는 단계는 상기 양자화부가 상기 제1 결과 데이터와 제2 결과 데이터 간의 차에 따른 손실값과 상기 제1 및 제2 인공 신경망 각각의 최종 선형 레이어 전단의 각 레이어의 출력값 간의 차에 따른 손실값을 상기 제2 인공 신경망의 상기 전단 레이어에 입력하여 상기 제2 인공 신경망의 각 레이어의 중간 출력값을 양자화시키는 인공 신경망 학습 방법.
According to claim 7,
The step of quantizing the intermediate output value of each layer may include a loss value according to a difference between the first result data and the second result data by the quantizer and an output value of each layer prior to the final linear layer of each of the first and second artificial neural networks. Artificial neural network learning method of quantizing intermediate output values of each layer of the second artificial neural network by inputting a loss value according to the difference between the artificial neural networks to the previous layer of the second artificial neural network.
KR1020220083328A 2022-07-06 2022-07-06 Apparatus and method for learning artificial neural network KR102494095B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020220083328A KR102494095B1 (en) 2022-07-06 2022-07-06 Apparatus and method for learning artificial neural network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020220083328A KR102494095B1 (en) 2022-07-06 2022-07-06 Apparatus and method for learning artificial neural network

Publications (1)

Publication Number Publication Date
KR102494095B1 true KR102494095B1 (en) 2023-02-06

Family

ID=85224478

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020220083328A KR102494095B1 (en) 2022-07-06 2022-07-06 Apparatus and method for learning artificial neural network

Country Status (1)

Country Link
KR (1) KR102494095B1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20210053160A (en) * 2019-11-01 2021-05-11 삼성전자주식회사 Piecewise quantization method for artificial neural networks
KR20220049759A (en) * 2020-10-15 2022-04-22 삼성전자주식회사 Method for training neural network and electronic device therefor
KR20220051943A (en) 2020-10-20 2022-04-27 연세대학교 산학협력단 Quantizer For Artificial Neural Networks And Loss Backpropagation Method Thereof
KR20220078950A (en) * 2020-12-04 2022-06-13 연세대학교 산학협력단 Apparatus And Method For Mathematically Light Weighting Artificial Neural Networks

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20210053160A (en) * 2019-11-01 2021-05-11 삼성전자주식회사 Piecewise quantization method for artificial neural networks
KR20220049759A (en) * 2020-10-15 2022-04-22 삼성전자주식회사 Method for training neural network and electronic device therefor
KR20220051943A (en) 2020-10-20 2022-04-27 연세대학교 산학협력단 Quantizer For Artificial Neural Networks And Loss Backpropagation Method Thereof
KR20220078950A (en) * 2020-12-04 2022-06-13 연세대학교 산학협력단 Apparatus And Method For Mathematically Light Weighting Artificial Neural Networks

Similar Documents

Publication Publication Date Title
US11475298B2 (en) Using quantization in training an artificial intelligence model in a semiconductor solution
US11645493B2 (en) Flow for quantized neural networks
US20230267319A1 (en) Training neural network accelerators using mixed precision data formats
CN109754066B (en) Method and apparatus for generating a fixed-point neural network
CN108510067B (en) Convolutional neural network quantification method based on engineering realization
US11568258B2 (en) Operation method
US11586883B2 (en) Residual quantization for neural networks
CN109785826B (en) System and method for trace norm regularization and faster reasoning for embedded models
WO2020019236A1 (en) Loss-error-aware quantization of a low-bit neural network
KR102602195B1 (en) Quantization of trained long-short-term memory neural networks
EP3788559A1 (en) Quantization for dnn accelerators
US20240152758A1 (en) Neural network activation compression with non-uniform mantissas
JP2020009444A (en) Method and apparatus of processing parameter in neural network
US20170061279A1 (en) Updating an artificial neural network using flexible fixed point representation
TW201915839A (en) Method and apparatus for quantizing artificial neural network and floating-point neural network
WO2020142192A1 (en) Neural network activation compression with narrow block floating-point
CN112329922A (en) Neural network model compression method and system based on mass spectrum data set
CN111105017A (en) Neural network quantization method and device and electronic equipment
US20240185086A1 (en) Model distillation method and related device
CN115860100A (en) Neural network model training method and device and computing equipment
CN114936646A (en) Quantized data processing method and device
KR102494095B1 (en) Apparatus and method for learning artificial neural network
KR20220030108A (en) Method and system for training artificial neural network models
CN112561050A (en) Neural network model training method and device
WO2020177863A1 (en) Training of algorithms

Legal Events

Date Code Title Description
E701 Decision to grant or registration of patent right
GRNT Written decision to grant