WO2020045794A1 - 전자 장치 및 그 제어 방법 - Google Patents

전자 장치 및 그 제어 방법 Download PDF

Info

Publication number
WO2020045794A1
WO2020045794A1 PCT/KR2019/005603 KR2019005603W WO2020045794A1 WO 2020045794 A1 WO2020045794 A1 WO 2020045794A1 KR 2019005603 W KR2019005603 W KR 2019005603W WO 2020045794 A1 WO2020045794 A1 WO 2020045794A1
Authority
WO
WIPO (PCT)
Prior art keywords
matrix
accuracy
artificial intelligence
value
intelligence model
Prior art date
Application number
PCT/KR2019/005603
Other languages
English (en)
French (fr)
Inventor
이동수
카푸르파리차이
김병욱
Original Assignee
삼성전자주식회사
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 삼성전자주식회사 filed Critical 삼성전자주식회사
Priority to US17/258,617 priority Critical patent/US20210279589A1/en
Publication of WO2020045794A1 publication Critical patent/WO2020045794A1/ko

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/16Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/2163Partitioning the feature space
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/25Fusion techniques
    • 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/082Learning methods modifying the architecture, e.g. adding, deleting or silencing nodes or connections
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/776Validation; Performance evaluation

Definitions

  • the present disclosure utilizes a machine learning algorithm such as deep learning, an artificial intelligence (AI) system that simulates the functions of the human brain, such as recognition and judgment, and an electronic device for compressing an artificial intelligence model among the applications and control thereof.
  • a machine learning algorithm such as deep learning
  • an artificial intelligence (AI) system that simulates the functions of the human brain, such as recognition and judgment
  • an electronic device for compressing an artificial intelligence model among the applications and control thereof.
  • the present invention relates to an electronic device and a control method thereof for compressing an artificial intelligence model while maintaining accuracy.
  • Artificial intelligence systems that implement human-level intelligence have been used in various fields.
  • Artificial intelligence systems unlike conventional rule-based smart systems, are machines that learn and judge themselves and become smart. As the artificial intelligence system is used, the recognition rate is improved and the user's taste can be understood more accurately.
  • the existing rule-based smart system is gradually replaced by the deep learning-based artificial intelligence system.
  • Machine learning e.g. deep learning
  • machine learning e.g., deep learning
  • Machine learning is an algorithm technology that classifies / learns characteristics of input data by itself
  • element technology is a technology that simulates the functions of human brain cognition and judgment by using machine learning algorithms such as deep learning. It consists of technical fields such as understanding, reasoning / prediction, knowledge representation and motion control.
  • Linguistic understanding is a technology for recognizing and applying / processing human language / characters and includes natural language processing, machine translation, dialogue system, question and answer, speech recognition / synthesis, and the like.
  • Visual understanding is a technology that recognizes and processes objects as human vision, and includes object recognition, object tracking, image retrieval, human recognition, scene understanding, spatial understanding, and image enhancement.
  • Inference prediction is a technique of judging information, logically inferring, and predicting information, and includes knowledge / probability based inference, optimization prediction, preference based planning, and recommendation.
  • Knowledge expression is a technology that automatically processes human experience information into knowledge data, and includes knowledge construction (data generation / classification) and knowledge management (data utilization).
  • Motion control is a technique for controlling autonomous driving of a vehicle and movement of a robot, and includes motion control (navigation, collision, driving), operation control (action control), and the like.
  • Pruning is a method of removing redundant weights, but conventionally, the pruning rate is very low to maintain accuracy, or a large amount of computation is required to produce a higher pruning rate, making it difficult to commercialize. there was.
  • Model compression based on low-rank factorization is a method of dividing a matrix of m ⁇ n into two matrices of rank r.
  • a matrix of m ⁇ n is (m ⁇ r) ⁇ ( r ⁇ n).
  • the overall matrix size may be reduced, but there is a problem that the accuracy decreases.
  • the compressibility is substantially insignificant.
  • the present disclosure is in accordance with the above-described needs, and an object of the present disclosure is to provide an electronic device and a control method thereof capable of reducing data capacity of an artificial intelligence model while maintaining accuracy.
  • an electronic device includes storage of a matrix included in an artificial intelligence model trained based on sample data and the sample data, and a plurality of storage units included in the matrix. Converting the value of the number of elements corresponding to the first ratio to a zero value based on the size of the element of to obtain a pruned first matrix, and including the first matrix based on test data.
  • the processor identifies the number of elements corresponding to the first ratio in descending order of absolute values of the plurality of elements included in the matrix, and determines the number of elements included in the retrained first matrix.
  • the number of elements corresponding to the second ratio may be identified in the order of the smallest absolute value.
  • the processor acquires a second accuracy of the artificial intelligence model including the second matrix based on the test data, and the sample data when the second accuracy is within the preset range based on the preset value. Retraining the artificial intelligence model including the second matrix based on the number of the third ratio greater than the second ratio based on the sizes of the plurality of elements included in the retrained second matrix.
  • the pruned third matrix may be obtained by converting the value of the element to a zero value.
  • the processor acquires a third accuracy of the artificial intelligence model including the third matrix based on the test data, and when the third accuracy is out of the predetermined range based on the predetermined value, 2 matrix may be determined as the final matrix of the matrix included in the artificial intelligence model.
  • the processor may determine the third matrix as the final matrix of the matrix included in the artificial intelligence model.
  • the processor has a number of elements corresponding to a ratio smaller than the first ratio based on the sizes of the plurality of elements included in the matrix.
  • the value of may be converted to a zero value to obtain a re-pruned first matrix.
  • the predetermined value may be obtained based on the accuracy of the artificial intelligence model including the matrix based on the test data.
  • the processor divides the matrix into a first sub-matrix and a second sub-matrix through single value decomposition (SVD) based on a first rank value, instead of the pruning operation based on the first ratio.
  • SVD single value decomposition
  • the trained first matrix may be divided into a third submatrix and a fourth submatrix, and the third matrix and the fourth submatrix may be combined to obtain the second matrix.
  • the processor acquires a second accuracy of the artificial intelligence model including the second matrix based on the test data, and if the second accuracy is out of the predetermined range based on the predetermined value,
  • the first sub-matrix and the second sub-matrix may be determined as the final matrix of the matrix included in the artificial intelligence model.
  • the processor may determine the first sub-matrix and the matrix through the SVD based on a second rank value that is greater than the first rank value when the first accuracy is out of the preset range based on the preset value.
  • the first matrix may be re-divided into a second submatrix, and the first matrix and the second submatrix may be combined to reacquire the first matrix.
  • a method of controlling an electronic device in which a matrix included in sample data and an artificial intelligence model trained based on the sample data may be applied to sizes of a plurality of elements included in the matrix.
  • the acquiring of the first matrix may include identifying the number of elements corresponding to the first ratio in order of decreasing magnitude of the plurality of elements included in the matrix, and obtaining the second matrix. May identify the number of elements corresponding to the second ratio in order of decreasing magnitude of the absolute value of the plurality of elements included in the retrained first matrix.
  • the method may further include converting the value of to a zero value to obtain a pruned third matrix.
  • the method may further include determining a as the final matrix of the matrix included in the artificial intelligence model.
  • the method may further include determining the third matrix as the final matrix of the matrix included in the artificial intelligence model.
  • the method may further include converting to a zero value to obtain a re-pruned first matrix.
  • the predetermined value may be obtained based on the accuracy of the artificial intelligence model including the matrix based on the test data.
  • the acquiring of the first matrix may include converting the matrix into a first sub-matrix and a second sub through a single value decomposition (SVD) based on a first rank value, instead of a pruning operation based on the first ratio.
  • SVD single value decomposition
  • the retrained first matrix is divided into a third submatrix and a fourth submatrix through an SVD based on a second rank value smaller than a rank value, and the third submatrix and the fourth submatrix are combined to form the first submatrix. 2 matrices can be obtained.
  • the method may further include obtaining a second accuracy of the artificial intelligence model including the second matrix based on the test data, and when the second accuracy is out of the predetermined range based on the predetermined value, the first sub.
  • the method may further include determining a matrix and the second sub-matrix as the final matrix of the matrix included in the artificial intelligence model.
  • the matrix is converted into the first sub-matrix and the second sub through SVD based on a second rank value that is greater than the first rank value.
  • the method may further include re-dividing into a matrix and re-acquiring the first matrix by combining the first sub matrix and the second sub matrix.
  • the electronic device repeatedly applies a method of reducing the data capacity of an artificial intelligence model while maintaining accuracy, thereby maintaining the performance of the artificial intelligence model while maintaining the performance of the artificial intelligence model. Data capacity can be minimized.
  • 1A is a block diagram illustrating a configuration of an electronic device according to an embodiment of the present disclosure.
  • 1B is a block diagram illustrating a detailed configuration of an electronic device according to an embodiment of the present disclosure.
  • FIGS. 2A and 2B are diagrams for describing an artificial intelligence model according to an exemplary embodiment.
  • 3A to 3C are diagrams for describing a pruning operation according to an embodiment of the present disclosure.
  • FIG. 4 illustrates a retrained first matrix according to an embodiment of the present disclosure.
  • 5A and 5B are diagrams for describing an effect of additional pruning according to various embodiments of the present disclosure.
  • 6A and 6B are diagrams for describing a method of dividing a matrix through SVD according to an embodiment of the present disclosure.
  • 7A and 7B are histograms for describing an effect according to an exemplary embodiment of the present disclosure.
  • FIG. 8 is a flowchart illustrating a control method of an electronic device according to an embodiment of the present disclosure.
  • FIG. 1A is a block diagram illustrating a configuration of an electronic device 100 according to an embodiment of the present disclosure. As shown in FIG. 1A, the electronic device 100 includes a storage 110 and a processor 120.
  • the electronic device 100 may be a device that reduces the data capacity of the artificial intelligence model.
  • the electronic device 100 is a device for pruning a matrix included in an artificial intelligence model, and may be a server, a desktop PC, a notebook, a smartphone, a tablet PC, or the like.
  • the electronic device 100 may be a device for dividing the matrix included in the artificial intelligence model into a first sub-matrix and a second sub-matrix through singular value decomposition (SVD).
  • the artificial intelligence model may include a plurality of matrices, and the electronic device 100 may prun the entire plurality of matrices or may divide the plurality of matrices into a plurality of sub-matrices through SVD. That is, the electronic device 100 may be any device as long as it can reduce the data capacity of the artificial intelligence model.
  • the matrix may be a weight matrix.
  • each weight included in the matrix will be described as an element.
  • the storage 110 is provided separately from the processor 120 and may be implemented as a hard disk, a nonvolatile memory, a volatile memory, or the like.
  • the storage 110 may store a matrix included in the artificial intelligence model trained based on the sample data and the sample data.
  • the matrix may be filter data, kernel data, etc. constituting the AI model.
  • the storage 110 may store a plurality of matrices included in the artificial intelligence model.
  • the storage 110 may store data that may be used in the AI model, and the processor 120 may identify the data stored in the storage 110 as a matrix.
  • the storage 110 may further store test data.
  • the test data may be data for calculating the accuracy of the AI model.
  • the processor 120 controls the overall operation of the electronic device 100.
  • the processor 120 may be implemented as a digital signal processor (DSP), a microprocessor, or a time controller (TCON), but is not limited thereto.
  • DSP digital signal processor
  • CPU central processing unit
  • MCU microcontroller unit
  • MPU micro processing unit
  • AP application processor
  • CP communication processor
  • ARM processor ARM processor
  • SoC System on Chip
  • LSI large scale integration
  • FPGA Field Programmable Gate Array
  • the processor 120 may obtain the pruned first matrix by converting values of the number of elements corresponding to the first ratio to zero values based on the sizes of the plurality of elements included in the matrix. For example, the processor 120 converts the values of two elements corresponding to 8% to zero values based on the sizes of 25 elements included in the matrix of 5 ⁇ 5 to obtain a pruned first matrix. Can be.
  • pruning refers to an operation of converting an element that is expected to have a low contribution to accuracy in the matrix to 0. This operation reduces data capacity, but may also reduce accuracy.
  • the processor 120 may identify the number of elements corresponding to the first ratio in order of decreasing magnitude of the absolute value of the plurality of elements included in the matrix. For example, the processor 120 may identify two elements corresponding to 8% in order of decreasing magnitude of the 25 elements included in the 5 ⁇ 5 matrix. For example, if a row and column in the matrix of 5 ⁇ 5 are the smallest in magnitude of the absolute value of the element at the position of (1, 2) and the position of (3, 3), respectively, then the processor 120 is (1, 2). The element at position) and the position at position (3, 3) may be converted to 0, and the remaining value may be kept as it is to obtain a pruned first matrix.
  • the ratio of converting from the total number of elements to a zero value is described as 8%, but this ratio may be increased to any extent. Also, as this ratio increases, the matrix can be represented with fewer bits. The above ratio is also called a pruning rate.
  • the processor 120 may obtain a first accuracy of the artificial intelligence model including the first matrix based on the test data. For example, the processor 120 inputs a plurality of numerical images to an artificial intelligence model including a first matrix, and determines whether the output data matches the numerical image, and thus, the artificial intelligence model including the first matrix. A first accuracy of can be obtained.
  • the processor 120 may obtain the accuracy of the artificial intelligence model in any other way.
  • the processor 120 may retrain the AI model including the first matrix based on the sample data when the first accuracy is within a preset range based on the preset value. In this case, the processor 120 may retrain the AI model including the first matrix by including an element having a zero value by the pruning operation in the first matrix.
  • the retraining method is the same as the training method, and the sample data used at this time may also be the same.
  • the predetermined value may be obtained based on the accuracy of the artificial intelligence model including the matrix based on the test data.
  • the processor 120 may acquire the accuracy of the artificial intelligence model before pruning, and use the obtained accuracy as a preset value. For example, if the accuracy of the AI model before pruning is 80%, the processor 120 may determine whether the first accuracy is within a preset range based on 80%.
  • the present invention is not limited thereto, and the processor 120 may use a predetermined value irrelevant to the accuracy of the AI model before pruning.
  • the processor 120 may determine whether the first accuracy is within a preset range based on 70% even if the accuracy of the AI model before pruning is 80%.
  • the preset value may be a value input by the user.
  • the preset range may be a value input by the user.
  • the processor 120 may determine whether the first accuracy is within 78% to 82% based on 80%.
  • the processor 120 retrains the artificial intelligence model including the first matrix, and an element which becomes 0 according to the retraining may be a non-zero value again, and a specific element among the elements not converted to 0 Can be close to zero. Therefore, an element converted to 0 may change according to an additional pruning operation to be described later.
  • the processor 120 converts the value of the number of elements corresponding to the second ratio greater than the first ratio to a zero value based on the sizes of the plurality of elements included in the retrained first matrix, and then pruned the second matrix. Can be obtained.
  • the processor 120 converts a value of four elements corresponding to 16% greater than 8% to a zero value based on the size of 25 elements included in a matrix of 5 ⁇ 5 to be pruned first.
  • the matrix can be obtained.
  • the processor 120 may identify the number of elements corresponding to the second ratio in order of decreasing magnitude of the plurality of elements included in the retrained first matrix.
  • an element that is converted to zero may increase, thereby reducing the data capacity of the AI model.
  • the processor 120 may repeat the pruning operation and the retraining operation through the above method.
  • the processor 120 obtains a second accuracy of the artificial intelligence model including the second matrix based on the test data, and if the second accuracy is within a preset range based on the preset value, based on the sample data Retraining the artificial intelligence model including the second matrix, and based on the size of the plurality of elements included in the retrained second matrix, the value of the number of elements corresponding to the third ratio greater than the second ratio is zero. Can be converted to obtain a pruned third matrix.
  • the processor 120 obtains a third accuracy of the artificial intelligence model including the third matrix based on the test data, and if the third accuracy is out of a predetermined range based on a predetermined value, artificially extracts the second matrix.
  • the final matrix of the matrix included in the intelligence model can be determined. That is, when the accuracy is outside the allowable range, the processor 120 may determine that the matrix whose pruning is performed last among the matrices satisfying the allowable range is the final matrix of the matrix included in the artificial intelligence model.
  • the processor 120 may determine the third matrix as the final matrix of the matrix included in the artificial intelligence model.
  • the processor 120 selects the value of the number of elements corresponding to the ratio smaller than the first ratio based on the sizes of the plurality of elements included in the matrix. By converting to a zero value, a re-pruned first matrix may be obtained, and the pruning operation and the retraining operation described above may be repeated.
  • the processor 120 converts the values of two elements corresponding to 8% to zero values based on the sizes of 25 elements included in the matrix of 5 ⁇ 5 to obtain a pruned first matrix.
  • the first accuracy of the artificial intelligence model including the first matrix may be obtained based on the test data. If the first accuracy is outside of the allowable range and no additional pruning is performed, the processor 120 may store the original trained artificial intelligence model as it is, so as not to reduce the data capacity. Therefore, if the first accuracy is outside the allowable range, the processor 120 converts the value of one element corresponding to 4% to zero based on the size of 25 elements included in the matrix of 5 ⁇ 5, and leaves the leaf. It is possible to obtain a rounded first matrix.
  • test data used in each of the above steps may be the same. Accordingly, the processor 120 may objectively compare the accuracy and the predetermined value of each step.
  • the matrix of 5 ⁇ 5 is taken as an example, but the actual matrix may be very large, such as 10000 ⁇ 8000.
  • the processor 120 divides the matrix into a first sub-matrix and a second sub-matrix through singular value decomposition (SVD) based on a first rank value. Combine the first sub-matrix and the second sub-matrix to obtain a first matrix, and replace the first matrix retrained with the SVD based on the second rank value less than the first rank value, instead of the pruning operation based on the second ratio.
  • the second matrix may be obtained by dividing into a third submatrix and a fourth submatrix, and combining the third submatrix and the fourth submatrix.
  • the processor 120 replaces a matrix of 10000 ⁇ 8000 with an SVD based on a first rank value of 50, instead of a pruning operation based on the first ratio, with a first sub-matrix of 10000 ⁇ 50 and a 50 ⁇ 8000.
  • the first matrix retrained through SVD based on the second rank value 45 is divided into a third submatrix of 10000 ⁇ 45 and a fourth submatrix of 45 ⁇ 8000, and the third submatrix and the fourth submatrix are combined to 10000 A second matrix of 8000 may be obtained.
  • the acquiring operation of the second matrix may be an operation when the first accuracy is within an allowable range.
  • the data capacity can be reduced.
  • SVD means the singular value decomposition of the matrix, and due to the characteristics of the SVD, even before combining two sub-matrix, the matrix before partitioning may not be restored. That is, in the above example, the first matrix obtained by combining the first sub-matrix and the second sub-matrix may have the same shape as the matrix before being divided into the first sub-matrix and the second sub-matrix. There may be changes.
  • the AI model including the first sub-matrix and the second sub-matrix generated according to the SVD may have a lower accuracy than the artificial intelligence model including the matrix before the SVD. Accordingly, it may be determined whether retraining and further application of SVD are to be performed according to the accuracy of the AI model including the first sub-matrix and the second sub-matrix after SVD, similarly to pruning.
  • the processor 120 repeats the retraining and SVD similarly to the pruning operation and may stop the repetitive operation based on the accuracy.
  • the processor 120 obtains a second accuracy of the artificial intelligence model including the second matrix based on the test data, and if the second accuracy is out of a predetermined range based on a predetermined value, the first sub-matrix. And the second sub-matrix as the final matrix of the matrix included in the artificial intelligence model.
  • the processor 120 may determine the third submatrix and the fourth submatrix as the final matrix of the matrix included in the artificial intelligence model.
  • the processor 120 converts the matrix into the first sub-matrix and the second sub-matrix through the SVD based on the second rank value greater than the first rank value when the first accuracy is out of the preset range based on the preset value.
  • the subdivision may be performed and the first matrix and the second submatrix may be combined to reacquire the first matrix.
  • the pruning operation and the operation according to the SVD has been described as separate, but is not limited thereto.
  • the processor 120 may repeat the pruning operation to obtain a final pruned matrix, and repeat the operation according to the SVD with respect to the final pruned matrix to obtain a plurality of final sub-matrixes.
  • the processor 120 may alternately perform a pruning operation and an operation according to the SVD. For example, the processor 120 performs the pruning operation once, performs the operation according to the SVD once, and may repeat the operation.
  • FIG. 1B is a block diagram illustrating a detailed configuration of an electronic device 100 according to an embodiment of the present disclosure.
  • the electronic device 100 may include the storage 110, the processor 120, the communicator 130, the user interface 140, the display 150, the audio processor 160, and the video processor 170. Include. A detailed description of parts overlapping with those shown in FIG. 1A among the elements shown in FIG. 1B will be omitted.
  • the processor 120 controls overall operations of the electronic device 100 using various programs stored in the storage 110.
  • the processor 120 may access the RAM 121, the ROM 122, the main CPU 123, the graphics processor 124, the first to n interfaces 125-1 to 125-n, and the bus 126. Include.
  • the RAM 121, the ROM 122, the main CPU 123, the graphics processor 124, the first through n interfaces 125-1 through 125-n, and the like may be connected to each other through the bus 126.
  • the first to n interfaces 125-1 to 125-n are connected to the aforementioned various components.
  • One of the interfaces may be a network interface connected to an external device through a network.
  • the main CPU 123 accesses the storage 110 and performs booting using an operating system stored in the storage 110. In addition, various operations are performed using various programs stored in the storage 110.
  • the ROM 122 stores a command set for system booting.
  • the main CPU 123 copies the O / S stored in the storage 110 to the RAM 121 according to the command stored in the ROM 122, and executes the O / S.
  • Boot up When booting is completed, the main CPU 123 copies various application programs stored in the storage 110 to the RAM 121, and executes the application programs copied to the RAM 121 to perform various operations.
  • the graphic processor 124 generates a screen including various objects such as an icon, an image, and a text by using a calculator (not shown) and a renderer (not shown).
  • An operation unit (not shown) calculates attribute values such as coordinates, shapes, sizes, colors, and the like in which objects are displayed based on the layout of the screen.
  • the renderer generates a screen having various layouts including objects based on the attribute values calculated by the calculator.
  • the screen generated by the renderer (not shown) is displayed in the display area of the display 150.
  • the above-described operation of the processor 120 may be performed by a program stored in the storage 110.
  • the storage 110 reduces data capacity of an artificial intelligence module and an artificial intelligence model including an operating system (O / S) software module for driving the electronic device 100, an artificial intelligence model and an artificial intelligence model with reduced data capacity. It stores various data such as modules.
  • O / S operating system
  • the communication unit 130 is a component that performs communication with various types of external devices according to various types of communication methods.
  • the communication unit 130 includes a Wi-Fi chip 131, a Bluetooth chip 132, a wireless communication chip 133, an NFC chip 134, and the like.
  • the processor 120 communicates with various external devices using the communication unit 130.
  • the Wi-Fi chip 131 and the Bluetooth chip 132 communicate with each other by WiFi and Bluetooth.
  • various connection information such as SSID and session key may be transmitted and received first, and then various communication information may be transmitted and received by using the same.
  • the wireless communication chip 133 refers to a chip that performs communication according to various communication standards such as IEEE, Zigbee, 3rd Generation (3G), 3rd Generation Partnership Project (3GPP), Long Term Evoloution (LTE), and the like.
  • the NFC chip 134 refers to a chip that operates in a near field communication (NFC) method using a 13.56 MHz band among various RF-ID frequency bands such as 135 kHz, 13.56 MHz, 433 MHz, 860-960 MHz, 2.45 GHz, and the like.
  • NFC near field communication
  • the processor 130 may receive the artificial intelligence model or the matrix included in the artificial intelligence model from the external device through the communication unit 130 and store the received data in the storage 110. Alternatively, the processor 130 may directly learn the artificial intelligence model through an artificial intelligence algorithm and store the learned artificial intelligence model in the storage 110.
  • the artificial intelligence model may include at least one matrix.
  • the user interface unit 140 receives various user interactions.
  • the user interface 140 may be implemented in various forms according to the implementation example of the electronic device 100.
  • the user interface 140 may be a button provided in the electronic device 100, a microphone for receiving a user voice, a camera for detecting a user motion, or the like.
  • the electronic device 100 is implemented as a touch-based electronic device
  • the user interface 140 may be implemented in the form of a touch screen that forms a mutual layer structure with the touch pad. In this case, the user interface 140 may be used as the display 150 described above.
  • the audio processor 160 is a component that processes audio data.
  • the audio processor 160 may perform various processing such as decoding, amplification, noise filtering, or the like on the audio data.
  • the video processor 170 is a component that performs processing on video data.
  • the video processor 170 may perform various image processing such as decoding, scaling, noise filtering, frame rate conversion, resolution conversion, and the like on the video data.
  • the processor 120 may reduce the data capacity of the matrix included in the artificial intelligence model.
  • FIGS. 2A and 2B are diagrams for describing an artificial intelligence model according to an exemplary embodiment.
  • FIG. 2A is a diagram illustrating an example of an artificial intelligence model including three layers and two matrices.
  • the processor 120 inputs input values of Li-1 to W12 to obtain an intermediate value of Li.
  • the intermediate values can be entered into W23 to obtain the final value of Li + 1.
  • FIG. 2A illustrates the AI model very simply, and may actually include more layers than FIG. 2A.
  • 2B is a diagram illustrating an example of a matrix, and the matrix may be in the form of m ⁇ n.
  • the matrix may be in the form of 10000 ⁇ 8000.
  • the data in the matrix may each be 32 bits. That is, the matrix may include 10000 ⁇ 8000 data having 32 bits.
  • the present invention is not limited thereto, and the size of the matrix and the number of bits of each data may vary.
  • the processor 120 may reduce the data capacity of the matrix to secure the storage space and reduce the amount of computation.
  • 3A to 3C are diagrams for describing a pruning operation according to an embodiment of the present disclosure.
  • the matrix is described as having a 4 ⁇ 4 shape in FIG. 3A.
  • the processor 120 may arrange the absolute values of the plurality of elements included in the 4 ⁇ 4 matrix of FIG. 3A in size order as shown in FIG. 3B.
  • the processor 120 may convert the values of the number of elements corresponding to the pruning rate to zero values. For example, the processor 120 may obtain a pruned first matrix by converting values of four elements corresponding to a pruning rate of 25% to zero values, as shown in FIG. 3C.
  • the pruning rate may be input by the user.
  • the pruning rate may be a preset value greater than zero.
  • the processor 120 may obtain a first accuracy of the artificial intelligence model including the first matrix based on the test data. In addition, the processor 120 may identify whether the first accuracy is within a preset range based on the preset value.
  • the predetermined value may be the accuracy of the artificial intelligence model including the matrix of FIG. 3A based on the test data. That is, the processor 120 may acquire the accuracy of the artificial intelligence model including the matrix of FIG. 3A based on the test data before performing the pruning operation.
  • the test data for calculating the accuracy and the first accuracy may be the same.
  • the preset range may be input by the user.
  • the processor 120 may retrain the AI model including the first matrix based on the sample data when the first accuracy is within a preset range based on the preset value. That is, when the first accuracy is maintained even after the first pruning, the processor 120 performs retraining of the artificial intelligence model including the first matrix and additional pruning on the retrained first matrix. .
  • the processor 120 may correspond to a pruning rate smaller than the pruning rate based on the sizes of the plurality of elements included in the matrix of FIG. 3A.
  • the value of the element of may be converted to a zero value to obtain a re-running first matrix. That is, when the first accuracy is significantly lowered according to the first pruning, the processor 120 lowers the pruning rate and performs leaf pruning to secure the accuracy. For example, the processor 120 may lower the pruning rate to 12.5% and convert the values of the two elements to zero values to obtain a leafed first matrix.
  • the processor 120 may acquire the first accuracy again and identify whether the first accuracy is within a preset range based on the preset value.
  • the subsequent operation is the same as described above.
  • FIG. 4 illustrates a retrained first matrix according to an embodiment of the present disclosure.
  • the processor 120 may retrain the AI model including the first matrix of FIG. 3C based on the sample data.
  • the sample data may be the same as the sample data used when training the artificial intelligence model including the matrix of FIG. 3A.
  • the processor 120 may use a small number of mini-batches to improve processing speed during the retraining process.
  • the mini-batch may be within 10% of one epoch.
  • the zero values may be changed back to a specific value, and the remaining values other than the zero values may also be changed.
  • 5A and 5B are diagrams for describing an effect of additional pruning according to various embodiments of the present disclosure.
  • the processor 120 may obtain a pruned second matrix by converting a value of eight elements corresponding to 50% higher than 25% to a zero value as shown in FIG. 5A. . In this case, even elements that are not converted to zero values in FIG. 3C may be further converted to zero values.
  • the pruning rate is suddenly increased for convenience of description, but in practice, the pruning rate may be increased more slowly.
  • the processor 120 may increase the pruning rate from 25% to 26%. Since 26% of the plurality of elements included in the matrix is 4.16, the processor 120 may convert four elements to zero values by rounding off 4.16. For example, the processor 120 may obtain a second pruned second matrix, as shown in FIG. 5B. However, the present invention is not limited thereto, and the processor 120 may determine the number of elements to be converted to zero values by raising or lowering.
  • the same number of elements are converted to zero values as compared to the first matrix of FIG. 3C, but the positions of the converted elements may be changed. That is, as pruning is additionally performed by including an element converted to a zero value, a probability that an element having less influence on accuracy may change to a zero value may increase. In other words, by changing the zero value of a relatively unnecessary element, it is possible to reduce the data capacity of the AI model without significantly changing the accuracy.
  • the processor 120 may acquire a second accuracy of the second matrix and identify whether the second accuracy is within a preset range based on a preset value.
  • the predetermined range based on the method of obtaining the second accuracy and the predetermined value may be the same as that of FIG. 3C.
  • the processor 120 may perform retraining of the artificial intelligence model including the second matrix and further pruning on the retrained second matrix. The operation may be the same as described with reference to FIGS. 4 to 5B.
  • the processor 120 may determine the first matrix as the final matrix of the matrix included in the artificial intelligence model. That is, since the accuracy of the second matrix is less than the criterion, the processor 120 may determine the first matrix that meets the criterion for accuracy as the final matrix. In addition, since the first matrix is before retraining, some elements may be changed to zero values, and the data capacity may be reduced.
  • the present invention is not limited thereto, and the processor 120 may reprun the retrained first matrix.
  • the pruning rate used for repruning may be a value between the pruning rate used for pruning the matrix and the pruning rate used for the first matrix immediately retrained. For example, if the pruning rate used for pruning the matrix is 30% and the pruning rate used for the immediately preceding retrained first matrix is 40%, then it is used for repruning the retrained first matrix.
  • the pruning rate to be may be 35%. If the second accuracy of the artificial intelligence model including the second matrix obtained by repruning the retrained first matrix meets the criteria, the accuracy may be maintained while lowering the data capacity than the first matrix.
  • the pruning operation is stopped when the accuracy deviates from the reference, but the present invention is not limited thereto.
  • the processor 120 may end the repeated pruning operation based on the number of pruning cycles.
  • the processor 120 may end the pruning operation when the data capacity of the matrix is smaller than the target data capacity.
  • the data capacity of the AI model can be reduced while maintaining the accuracy of the AI model.
  • 6A and 6B are diagrams for describing a method of dividing a matrix through SVD according to an embodiment of the present disclosure.
  • the top of FIG. 6A represents a matrix of m ⁇ n included in the artificial intelligence model, and the processor 120 displays the matrix of m ⁇ n through SVD based on the first rank value, as shown at the bottom of FIG. 6A. It can divide into the 1st sub-matrix of xr and the 2nd sub-matrix of rxn. That is, the processor 120 may reduce the data capacity by dividing a matrix of m ⁇ n into a first matrix of m ⁇ r and a second submatrix of r ⁇ n, and may perform compression based on low-rank factorization. Can be done.
  • the first rank value may be input by the user, and the smaller the first rank value, the smaller the data capacity.
  • the accuracy may also decrease. Therefore, it is necessary to set an appropriate rank value in order to reduce the data capacity while maintaining accuracy.
  • the processor 120 may multiply the first sub-matrix of m ⁇ r and the second sub-matrix of r ⁇ n at the bottom of FIG. 6A to obtain a matrix of m ⁇ n as shown in FIG. 6B.
  • the matrix of m ⁇ n obtained at this time may be different from the matrix of m ⁇ n before dividing into a plurality of sub-matrices.
  • an apparatus having a shortage of storage space stores a first submatrix of m ⁇ r and a second submatrix of r ⁇ n at the bottom of FIG. 6A, and multiplies the first submatrix and the second submatrix as needed. Perform the required operation.
  • the first sub-matrix and the second sub-matrix are multiplied, there may be a loss of accuracy since the matrix of m ⁇ n before dividing into a plurality of sub-matrices is not restored.
  • the processor 120 may perform the operation of FIG. 6A instead of the pruning operation among the operations described with reference to FIGS. 3A through 5B.
  • the processor 120 may multiply the plurality of sub-matrixes as shown in FIG. 6B to obtain the accuracy of the plurality of sub-matrixes divided as shown in FIG. 6A.
  • the processor 120 may replace the operation of FIG. 6A with the pruning operation described with reference to FIGS. 3A through 5B, and may add an operation as illustrated in FIG. 6B before calculating the accuracy.
  • the processor 120 may further divide the matrix of FIG. 6B through SVD. In this case, the rank value may be changed instead of the pruning rate of FIGS. 3A to 5B.
  • the processor 120 lowers the rank value to convert the matrix of FIG. 6B into the third sub-matrix. And a fourth submatrix.
  • the processor 120 may obtain a second accuracy by multiplying the third sub-matrix and the fourth sub-matrix, and if the second accuracy is within a preset range based on a preset value, the processor 120 may repeat matrix division through the SVD. have.
  • the processor 120 deletes the third submatrix and the fourth submatrix that fall short of the criterion, and the first submatrix and the second submatrix. Can be determined as the final matrix of the matrix included in the AI model.
  • the processor 120 may repartition the first matrix by increasing the rank value.
  • 7A and 7B are histograms for describing an effect according to an exemplary embodiment of the present disclosure.
  • FIG. 7A and 7B show results of using LeNet-5 (caffe model) in a dataset of MNIST
  • FIG. 7A shows a histogram according to a conventional pruning method
  • FIG. 7B shows a histogram according to a pruning method of the present application. Only values are shown.
  • the maximum pruning rate that can be achieved while maintaining the accuracy is 91%, but according to the pruning method of the present application, the maximum pruning rate that can be achieved while maintaining the accuracy is increased to 99.5%.
  • FIG. 7A nearly 400 values close to zero exist, while in FIG. 7B, nearly 100 values are close to zero. That is, using the pruning method of the present application increases the probability that an element that has less influence on accuracy is changed to a zero value, thereby reducing the data capacity. This means using surviving elements more efficiently.
  • the SVD is conventionally performed only once after training and an artificial intelligence model is created.
  • accuracy may be improved by repeatedly performing the SVD. For example, when various rank values (Rank) are attempted for the LSTM model (medium size) of the PTB dataset provided by Tensorflow, the following accuracy can be obtained.
  • test perplexity of the conventional SVD 87.398
  • test perplexity of the present SVD 84.304
  • test perplexity of the conventional SVD 107.454
  • test perplexity of the present SVD 88.291
  • FIG. 8 is a flowchart illustrating a control method of an electronic device according to an embodiment of the present disclosure.
  • the control method of the electronic device storing the matrix included in the artificial intelligence model trained based on the sample data and the sample data, first, based on the size of the plurality of elements included in the matrix,
  • the pruned first matrix is obtained by converting the value of the element to a zero value (S810).
  • the first accuracy of the artificial intelligence model including the first matrix is obtained based on the test data (S820). If the first accuracy is within a preset range based on the preset value, the artificial intelligence model including the first matrix is retrained based on the sample data (S830). And, based on the sizes of the plurality of elements included in the retrained first matrix, the value of the number of elements corresponding to the second ratio greater than the first ratio is converted into a zero value to obtain a pruned second matrix. (S840).
  • the first matrix may include identifying the number of elements corresponding to the first ratio in order of decreasing magnitude of the absolute values of the plurality of elements included in the matrix, and obtaining the second matrix ( S840 may identify the number of elements corresponding to the second ratio in descending order of the absolute values of the plurality of elements included in the retrained first matrix.
  • the method may further include obtaining a rounded third matrix.
  • obtaining the third accuracy of the artificial intelligence model including the third matrix based on the test data, and if the third accuracy is out of the predetermined range based on the predetermined value, include the second matrix in the artificial intelligence model.
  • the method may further include determining a final matrix of the matrix.
  • the method may further include determining the third matrix as the final matrix of the matrix included in the artificial intelligence model.
  • the method may further include obtaining a re-pruned first matrix.
  • the predetermined value may be obtained based on the accuracy of the artificial intelligence model including the matrix based on the test data.
  • the first sub-matrix and the second sub-matrix may be obtained through a single value matrix (SVD) based on a first rank value instead of a pruning operation based on a first ratio.
  • SVD single value matrix
  • Segmenting into a matrix, combining the first sub-matrix and the second sub-matrix to obtain a first matrix, and obtaining the second matrix (S840) may be performed using a first rank value rather than a pruning operation based on the second ratio.
  • the first matrix retrained through the SVD based on the small second rank value may be divided into a third submatrix and a fourth submatrix, and the third submatrix and the fourth submatrix may be combined to obtain a second matrix. .
  • the first sub-matrix and the second sub-matrix can be determined as the final matrix of the matrix included in the AI model.
  • the method may further include re-acquiring the first matrix by combining the first sub-matrix and the second sub-matrix.
  • the electronic device repeatedly applies a method of reducing the data capacity of an artificial intelligence model while maintaining accuracy, thereby maintaining the performance of the artificial intelligence model while maintaining the performance of the artificial intelligence model. Data capacity can be minimized.
  • the method described above may be applied to a plurality of matrices included in the artificial intelligence model, respectively.
  • the various embodiments described above may be implemented by software including instructions stored in a machine-readable storage media.
  • the device may be a device capable of calling a stored command from a storage medium and operating in accordance with the called command, and may include an electronic device (for example, the electronic device A) according to the disclosed embodiments.
  • the processor may perform a function corresponding to the instruction by using other components directly or under the control of the processor.
  • the instructions can include code generated or executed by a compiler or interpreter.
  • the device-readable storage medium may be provided in the form of a non-transitory storage medium.
  • 'non-temporary' means that the storage medium does not include a signal and is tangible, but does not distinguish that data is stored semi-permanently or temporarily on the storage medium.
  • the method according to various embodiments described above may be provided included in a computer program product.
  • the computer program product may be traded between the seller and the buyer as a product.
  • the computer program product may be distributed online in the form of a device-readable storage medium (eg compact disc read only memory (CD-ROM)) or through an application store (eg Play StoreTM).
  • CD-ROM compact disc read only memory
  • application store eg Play StoreTM
  • at least a portion of the computer program product may be stored at least temporarily on a storage medium such as a server of a manufacturer, a server of an application store, or a relay server, or may be temporarily created.
  • the various embodiments described above may be stored in a recording medium readable by a computer or a similar device using software, hardware, or a combination thereof. It can be implemented in In some cases, the embodiments described herein may be implemented by the processor itself. According to the software implementation, embodiments such as the procedures and functions described herein may be implemented as separate software modules. Each of the software modules may perform one or more functions and operations described herein.
  • non-transitory computer-readable medium may be stored in a non-transitory computer-readable medium.
  • the computer instructions stored in the non-transitory computer readable medium allow the specific device to perform processing operations in the device according to the above-described various embodiments when executed by the processor of the specific device.
  • a non-transitory computer readable medium refers to a medium that stores data semi-permanently and is read by a device, not a medium storing data for a short time such as a register, a cache, a memory, and the like.
  • Specific examples of non-transitory computer readable media may be CD, DVD, hard disk, Blu-ray disk, USB, memory card, ROM, and the like.
  • each of the components may be composed of a singular or plural number of objects, and some of the above-described subcomponents may be omitted or other subcomponents may be omitted. Components may be further included in various embodiments. Alternatively or additionally, some components (eg, modules or programs) may be integrated into one entity to perform the same or similar functions performed by each corresponding component prior to integration. In accordance with various embodiments, the operations performed by a module, program, or other component may be executed sequentially, in parallel, repeatedly, or heuristically, or at least some of the operations may be executed in a different order, may be omitted, or other operations may be added. Can be.

Landscapes

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

Abstract

전자 장치가 개시된다. 본 전자 장치는 샘플 데이터 및 샘플 데이터에 기초하여 트레이닝(training)된 인공지능 모델에 포함된 매트릭스가 저장된 스토리지 및 매트릭스에 포함된 복수의 엘리먼트의 크기에 기초하여 제1 비율에 해당하는 개수의 엘리먼트의 값을 제로 값으로 변환하여 프루닝(pruning)된 제1 매트릭스를 획득하고, 테스트 데이터에 기초하여 제1 매트릭스를 포함하는 인공지능 모델의 제1 정확도를 획득하며, 제1 정확도가 기설정된 값을 기준으로 기설정된 범위 이내이면 샘플 데이터에 기초하여 제1 매트릭스를 포함하는 인공지능 모델을 리트레이닝(retraining)하고, 리트레이닝된 제1 매트릭스에 포함된 복수의 엘리먼트의 크기에 기초하여 제1 비율보다 큰 제2 비율에 해당하는 개수의 엘리먼트의 값을 제로 값으로 변환하여 프루닝된 제2 매트릭스를 획득하는 프로세서를 포함한다.

Description

전자 장치 및 그 제어 방법
본 개시는 딥러닝 등의 기계 학습 알고리즘을 활용하여 인간 두뇌의 인지, 판단 등의 기능을 모사하는 인공지능(Artificial Intelligence, AI) 시스템 및 그 응용 중 인공지능 모델을 압축하기 위한 전자 장치 및 그 제어 방법에 대한 것으로, 더욱 상세하게는 정확도(accuracy)를 유지하며 인공지능 모델을 압축하기 위한 전자 장치 및 그 제어 방법에 대한 것이다.
근래에는 인간 수준의 지능을 구현하는 인공 지능 시스템이 다양한 분야에서 이용되고 있다. 인공 지능 시스템은 기존의 룰(rule) 기반 스마트 시스템과 달리 기계가 스스로 학습하고 판단하며 똑똑해지는 시스템이다. 인공 지능 시스템은 사용할수록 인식률이 향상되고 사용자 취향을 보다 정확하게 이해할 수 있게 되어, 기존 룰 기반 스마트 시스템은 점차 딥러닝 기반 인공 지능 시스템으로 대체되고 있다.
인공 지능 기술은 기계학습(예로, 딥러닝) 및 기계학습을 활용한 요소 기술들로 구성된다.
기계학습은 입력 데이터들의 특징을 스스로 분류/학습하는 알고리즘 기술이며, 요소기술은 딥러닝 등의 기계학습 알고리즘을 활용하여 인간 두뇌의 인지, 판단 등의 기능을 모사하는 기술로서, 언어적 이해, 시각적 이해, 추론/예측, 지식 표현, 동작 제어 등의 기술 분야로 구성된다.
인공 지능 기술이 응용되는 다양한 분야는 다음과 같다. 언어적 이해는 인간의 언어/문자를 인식하고 응용/처리하는 기술로서, 자연어 처리, 기계 번역, 대화시스템, 질의 응답, 음성 인식/합성 등을 포함한다. 시각적 이해는 사물을 인간의 시각처럼 인식하여 처리하는 기술로서, 객체 인식, 객체 추적, 영상 검색, 사람 인식, 장면 이해, 공간 이해, 영상 개선 등을 포함한다. 추론 예측은 정보를 판단하여 논리적으로 추론하고 예측하는 기술로서, 지식/확률 기반 추론, 최적화 예측, 선호 기반 계획, 추천 등을 포함한다. 지식 표현은 인간의 경험정보를 지식데이터로 자동화 처리하는 기술로서, 지식 구축(데이터 생성/분류), 지식 관리(데이터 활용) 등을 포함한다. 동작 제어는 차량의 자율 주행, 로봇의 움직임을 제어하는 기술로서, 움직임 제어(항법, 충돌, 주행), 조작 제어(행동 제어) 등을 포함한다.
다만, 인공지능 모델에서 정확도가 선형적으로 증가할 때, 데이터 용량은 지수적으로 증가하는 문제가 있다. 이러한 문제를 해결하는 방법으로, 프루닝(pruning), low-rank factorization을 기반으로 한 모델 압축 등이 제시되고 있다.
프루닝은 redundant한 weight를 제거하는 방법이나, 종래까지는 정확도를 유지하기 위한 프루닝 레이트(pruning rate)가 매우 낮거나, 더 높은 프루닝 레이트를 산출하기 위해 상당한 연산량이 요구되어 제품화가 어려운 문제가 있었다.
Low-rank factorization을 기반으로 한 모델 압축은 m × n의 매트릭스를 랭크(rank) r을 가지는 두 개의 매트릭스들로 분할하는 방법으로, 예를 들면 m × n의 매트릭스는 (m × r) × (r × n) 형태로 분할될 수 있다. 이러한 경우 r이 m이나 n보다 작다면 전체 매트릭스 사이즈가 축소될 수 있으나, 정확도가 감소하는 문제가 있다. 또한, 실질적으로 압축률이 유의미하지 않다는 문제가 있어왔다.
따라서, 좀더 단순한 방법으로 정확도를 일정 수준으로 유지하면서도 데이터 용량을 유의미하게 축소시킬 수 있는 방법이 필요하게 되었다.
본 개시는 상술한 필요성에 따른 것으로, 본 개시의 목적은 정확도(accuracy)를 유지하면서도 인공지능 모델의 데이터 용량을 줄일 수 있는 전자 장치 및 그 제어 방법을 제공함에 있다.
이상과 같은 목적을 달성하기 위한 본 개시의 일 실시 예에 따른 전자 장치는 샘플 데이터 및 상기 샘플 데이터에 기초하여 트레이닝(training)된 인공지능 모델에 포함된 매트릭스가 저장된 스토리지 및 상기 매트릭스에 포함된 복수의 엘리먼트의 크기에 기초하여 제1 비율에 해당하는 개수의 엘리먼트의 값을 제로 값으로 변환하여 프루닝(pruning)된 제1 매트릭스를 획득하고, 테스트 데이터에 기초하여 상기 제1 매트릭스를 포함하는 인공지능 모델의 제1 정확도를 획득하며, 상기 제1 정확도가 기설정된 값을 기준으로 기설정된 범위 이내이면 상기 샘플 데이터에 기초하여 상기 제1 매트릭스를 포함하는 인공지능 모델을 리트레이닝(retraining)하고, 상기 리트레이닝된 제1 매트릭스에 포함된 복수의 엘리먼트의 크기에 기초하여 상기 제1 비율보다 큰 제2 비율에 해당하는 개수의 엘리먼트의 값을 제로 값으로 변환하여 프루닝된 제2 매트릭스를 획득하는 프로세서를 포함한다.
여기서, 상기 프로세서는 상기 매트릭스에 포함된 복수의 엘리먼트의 절대값의 크기가 작은 순으로 상기 제1 비율에 해당하는 개수의 엘리먼트를 식별하고, 상기 리트레이닝된 제1 매트릭스에 포함된 복수의 엘리먼트의 절대값의 크기가 작은 순으로 상기 제2 비율에 해당하는 개수의 엘리먼트를 식별할 수 있다.
한편, 상기 프로세서는 상기 테스트 데이터에 기초하여 상기 제2 매트릭스를 포함하는 인공지능 모델의 제2 정확도를 획득하며, 상기 제2 정확도가 상기 기설정된 값을 기준으로 상기 기설정된 범위 이내이면 상기 샘플 데이터에 기초하여 상기 제2 매트릭스를 포함하는 인공지능 모델을 리트레이닝하고, 상기 리트레이닝된 제2 매트릭스에 포함된 복수의 엘리먼트의 크기에 기초하여 상기 제2 비율보다 큰 제3 비율에 해당하는 개수의 엘리먼트의 값을 제로 값으로 변환하여 프루닝된 제3 매트릭스를 획득할 수 있다.
여기서, 상기 프로세서는 상기 테스트 데이터에 기초하여 상기 제3 매트릭스를 포함하는 인공지능 모델의 제3 정확도를 획득하고, 상기 제3 정확도가 상기 기설정된 값을 기준으로 상기 기설정된 범위를 벗어나면 상기 제2 매트릭스를 상기 인공지능 모델에 포함된 상기 매트릭스의 최종 매트릭스로 결정할 수 있다.
또는, 상기 프로세서는 상기 제3 매트릭스에 적용된 프루닝 횟수가 기설정된 횟수이면, 상기 제3 매트릭스를 상기 인공지능 모델에 포함된 상기 매트릭스의 최종 매트릭스로 결정할 수 있다.
한편, 상기 프로세서는 상기 제1 정확도가 상기 기설정된 값을 기준으로 상기 기설정된 범위를 벗어나면 상기 매트릭스에 포함된 복수의 엘리먼트의 크기에 기초하여 상기 제1 비율보다 작은 비율에 해당하는 개수의 엘리먼트의 값을 제로 값으로 변환하여 리프루닝(re-pruning)된 제1 매트릭스를 획득할 수 있다.
그리고, 상기 기설정된 값은 상기 테스트 데이터에 기초하여 상기 매트릭스를 포함하는 인공지능 모델의 정확도에 기초하여 획득될 수 있다.
한편, 상기 프로세서는 상기 제1 비율에 기초한 프루닝 동작 대신, 제1 랭크(rank) 값에 기초한 SVD(singular value decomposition)를 통해 상기 매트릭스를 제1 서브 매트릭스 및 제2 서브 매트릭스로 분할하고, 상기 제1 서브 매트릭스 및 상기 제2 서브 매트릭스를 결합하여 상기 제1 매트릭스를 획득하며, 상기 제2 비율에 기초한 프루닝 동작 대신, 상기 제1 랭크 값보다 작은 제2 랭크 값에 기초한 SVD를 통해 상기 리트레이닝된 제1 매트릭스를 제3 서브 매트릭스 및 제4 서브 매트릭스로 분할하고, 상기 제3 서브 매트릭스 및 상기 제4 서브 매트릭스를 결합하여 상기 제2 매트릭스를 획득할 수 있다.
여기서, 상기 프로세서는 상기 테스트 데이터에 기초하여 상기 제2 매트릭스를 포함하는 인공지능 모델의 제2 정확도를 획득하고, 상기 제2 정확도가 상기 기설정된 값을 기준으로 상기 기설정된 범위를 벗어나면 상기 제1 서브 매트릭스 및 상기 제2 서브 매트릭스를 상기 인공지능 모델에 포함된 상기 매트릭스의 최종 매트릭스로 결정할 수 있다.
그리고, 상기 프로세서는 상기 제1 정확도가 상기 기설정된 값을 기준으로 상기 기설정된 범위를 벗어나면 상기 제1 랭크 값보다 큰 제2 랭크 값에 기초한 SVD를 통해 상기 매트릭스를 상기 제1 서브 매트릭스 및 상기 제2 서브 매트릭스로 재분할하고, 상기 제1 서브 매트릭스 및 상기 제2 서브 매트릭스를 결합하여 상기 제1 매트릭스를 재획득할 수 있다.
한편, 본 개시의 일 실시 예에 따른 샘플 데이터 및 상기 샘플 데이터에 기초하여 트레이닝(training)된 인공지능 모델에 포함된 매트릭스가 저장된 전자 장치의 제어 방법은 상기 매트릭스에 포함된 복수의 엘리먼트의 크기에 기초하여 제1 비율에 해당하는 개수의 엘리먼트의 값을 제로 값으로 변환하여 프루닝(pruning)된 제1 매트릭스를 획득하는 단계, 테스트 데이터에 기초하여 상기 제1 매트릭스를 포함하는 인공지능 모델의 제1 정확도를 획득하는 단계, 상기 제1 정확도가 기설정된 값을 기준으로 기설정된 범위 이내이면 상기 샘플 데이터에 기초하여 상기 제1 매트릭스를 포함하는 인공지능 모델을 리트레이닝(retraining)하는 단계 및 상기 리트레이닝된 제1 매트릭스에 포함된 복수의 엘리먼트의 크기에 기초하여 상기 제1 비율보다 큰 제2 비율에 해당하는 개수의 엘리먼트의 값을 제로 값으로 변환하여 프루닝된 제2 매트릭스를 획득하는 단계를 포함한다.
여기서, 상기 제1 매트릭스를 획득하는 단계는 상기 매트릭스에 포함된 복수의 엘리먼트의 절대값의 크기가 작은 순으로 상기 제1 비율에 해당하는 개수의 엘리먼트를 식별하고, 상기 제2 매트릭스를 획득하는 단계는 상기 리트레이닝된 제1 매트릭스에 포함된 복수의 엘리먼트의 절대값의 크기가 작은 순으로 상기 제2 비율에 해당하는 개수의 엘리먼트를 식별할 수 있다.
한편, 상기 테스트 데이터에 기초하여 상기 제2 매트릭스를 포함하는 인공지능 모델의 제2 정확도를 획득하는 단계, 상기 제2 정확도가 상기 기설정된 값을 기준으로 상기 기설정된 범위 이내이면 상기 샘플 데이터에 기초하여 상기 제2 매트릭스를 포함하는 인공지능 모델을 리트레이닝하는 단계 및 상기 리트레이닝된 제2 매트릭스에 포함된 복수의 엘리먼트의 크기에 기초하여 상기 제2 비율보다 큰 제3 비율에 해당하는 개수의 엘리먼트의 값을 제로 값으로 변환하여 프루닝된 제3 매트릭스를 획득하는 단계를 더 포함할 수 있다.
여기서, 상기 테스트 데이터에 기초하여 상기 제3 매트릭스를 포함하는 인공지능 모델의 제3 정확도를 획득하는 단계 및 상기 제3 정확도가 상기 기설정된 값을 기준으로 상기 기설정된 범위를 벗어나면 상기 제2 매트릭스를 상기 인공지능 모델에 포함된 상기 매트릭스의 최종 매트릭스로 결정하는 단계를 더 포함할 수 있다.
또는, 상기 제3 매트릭스에 적용된 프루닝 횟수가 기설정된 횟수이면, 상기 제3 매트릭스를 상기 인공지능 모델에 포함된 상기 매트릭스의 최종 매트릭스로 결정하는 단계를 더 포함할 수 있다.
한편, 상기 제1 정확도가 상기 기설정된 값을 기준으로 상기 기설정된 범위를 벗어나면 상기 매트릭스에 포함된 복수의 엘리먼트의 크기에 기초하여 상기 제1 비율보다 작은 비율에 해당하는 개수의 엘리먼트의 값을 제로 값으로 변환하여 리프루닝(re-pruning)된 제1 매트릭스를 획득하는 단계를 더 포함할 수 있다.
그리고, 상기 기설정된 값은 상기 테스트 데이터에 기초하여 상기 매트릭스를 포함하는 인공지능 모델의 정확도에 기초하여 획득될 수 있다.
한편, 상기 제1 매트릭스를 획득하는 단계는 상기 제1 비율에 기초한 프루닝 동작 대신, 제1 랭크(rank) 값에 기초한 SVD(singular value decomposition)를 통해 상기 매트릭스를 제1 서브 매트릭스 및 제2 서브 매트릭스로 분할하고, 상기 제1 서브 매트릭스 및 상기 제2 서브 매트릭스를 결합하여 상기 제1 매트릭스를 획득하며, 상기 제2 매트릭스를 획득하는 단계는 상기 제2 비율에 기초한 프루닝 동작 대신, 상기 제1 랭크 값보다 작은 제2 랭크 값에 기초한 SVD를 통해 상기 리트레이닝된 제1 매트릭스를 제3 서브 매트릭스 및 제4 서브 매트릭스로 분할하고, 상기 제3 서브 매트릭스 및 상기 제4 서브 매트릭스를 결합하여 상기 제2 매트릭스를 획득할 수 있다.
여기서, 상기 테스트 데이터에 기초하여 상기 제2 매트릭스를 포함하는 인공지능 모델의 제2 정확도를 획득하는 단계 및 상기 제2 정확도가 상기 기설정된 값을 기준으로 상기 기설정된 범위를 벗어나면 상기 제1 서브 매트릭스 및 상기 제2 서브 매트릭스를 상기 인공지능 모델에 포함된 상기 매트릭스의 최종 매트릭스로 결정하는 단계를 더 포함할 수 있다.
그리고, 상기 제1 정확도가 상기 기설정된 값을 기준으로 상기 기설정된 범위를 벗어나면 상기 제1 랭크 값보다 큰 제2 랭크 값에 기초한 SVD를 통해 상기 매트릭스를 상기 제1 서브 매트릭스 및 상기 제2 서브 매트릭스로 재분할하는 단계 및 상기 제1 서브 매트릭스 및 상기 제2 서브 매트릭스를 결합하여 상기 제1 매트릭스를 재획득하는 단계를 더 포함할 수 있다.
이상과 같은 본 개시의 다양한 실시 예에 따르면, 전자 장치는 정확도(accuracy)가 유지되는 동안 인공지능 모델의 데이터 용량을 축소하는 방법을 반복 적용하여, 인공지능 모델의 성능을 유지하면서도 인공지능 모델의 데이터 용량을 최소화할 수 있다.
도 1a는 본 개시의 일 실시 예에 따른 전자 장치의 구성을 나타내는 블럭도이다.
도 1b는 본 개시의 일 실시 예에 따른 전자 장치의 세부 구성을 나타내는 블럭도이다.
도 2a 및 도 2b 본 개시의 일 실시 예에 따른 인공지능 모델을 설명하기 위한 도면들이다.
도 3a 내지 도 3c는 본 개시의 일 실시 예에 따른 프루닝 동작을 설명하기 위한 도면들이다.
도 4는 본 개시의 일 실시 예에 따른 리트레이닝된 제1 매트릭스를 나타낸다.
도 5a 및 도 5b는 본 개시의 다양한 실시 예에 따른 추가 프루닝에 따른 효과를 설명하기 위한 도면들이다.
도 6a 및 도 6b는 본 개시의 일 실시 예에 따른 SVD를 통해 매트릭스를 분할하는 방법을 설명하기 위한 도면들이다.
도 7a 및 도 7b는 본 개시의 일 실시 예에 따른 효과를 설명하기 위한 히스토그램들이다.
도 8은 본 개시의 일 실시 예에 따른 전자 장치의 제어 방법을 설명하기 위한 흐름도이다.
-
이하에서, 첨부된 도면을 이용하여 본 개시의 다양한 실시 예들에 대하여 구체적으로 설명한다.
도 1a는 본 개시의 일 실시 예에 따른 전자 장치(100)의 구성을 나타내는 블럭도이다. 도 1a에 도시된 바와 같이, 전자 장치(100)는 스토리지(110) 및 프로세서(120)를 포함한다.
전자 장치(100)는 인공지능 모델의 데이터 용량을 축소하는 장치일 수 있다. 예를 들어, 전자 장치(100)는 인공지능 모델에 포함된 매트릭스(matrix)를 프루닝(pruning)하는 장치로서, 서버, 데스크탑 PC, 노트북, 스마트폰, 태블릿 PC 등일 수 있다. 또는, 전자 장치(100)는 인공지능 모델에 포함된 매트릭스를 SVD(singular value decomposition)를 통해 제1 서브 매트릭스 및 제2 서브 매트릭스로 분할하는 장치일 수도 있다. 그리고, 인공지능 모델에는 복수의 매트릭스가 포함될 수 있으며, 전자 장치(100)는 복수의 매트릭스 전체를 프루닝하거나 SVD를 통해 복수의 서브 매트릭스로 분할할 수도 있다. 즉, 전자 장치(100)는 인공지능 모델의 데이터 용량을 축소할 수 있는 장치라면 어떠한 장치라도 무방하다. 여기서, 매트릭스는 웨이트(weight) 매트릭스일 수 있다. 이하에서는 설명의 편의를 위해 매트릭스에 포함된 각 웨이트를 엘리먼트로서 설명한다.
스토리지(110)는 프로세서(120)와는 별도로 구비되며, 하드디스크, 비휘발성 메모리 및 휘발성 메모리 등으로 구현될 수 있다.
스토리지(110)는 샘플 데이터 및 샘플 데이터에 기초하여 트레이닝(training)된 인공지능 모델에 포함된 매트릭스를 저장할 수 있다. 여기서, 매트릭스는 인공지능 모델을 구성하는 필터 데이터, 커널(kernel) 데이터 등일 수 있다. 또한, 스토리지(110)는 인공지능 모델에 포함된 복수의 매트릭스를 저장할 수도 있다.
또는, 스토리지(110)는 인공지능 모델에 이용될 수 있는 데이터를 저장하고, 프로세서(120)는 스토리지(110)에 저장된 데이터를 매트릭스로서 식별할 수도 있다.
스토리지(110)는 테스트 데이터를 더 저장할 수 있다. 테스트 데이터는 인공지능 모델의 정확도를 산출하기 위한 데이터일 수 있다.
프로세서(120)는 전자 장치(100)의 동작을 전반적으로 제어한다.
일 실시 예에 따라 프로세서(120)는 디지털 시그널 프로세서(digital signal processor(DSP), 마이크로 프로세서(microprocessor), TCON(Time controller)으로 구현될 수 있다. 다만, 이에 한정되는 것은 아니며, 중앙처리장치(central processing unit(CPU)), MCU(Micro Controller Unit), MPU(micro processing unit), 컨트롤러(controller), 어플리케이션 프로세서(application processor(AP)), 또는 커뮤니케이션 프로세서(communication processor(CP)), ARM 프로세서 중 하나 또는 그 이상을 포함하거나, 해당 용어로 정의될 수 있다. 또한, 프로세서(140)는 프로세싱 알고리즘이 내장된 SoC(System on Chip), LSI(large scale integration)로 구현될 수도 있고, FPGA(Field Programmable gate array) 형태로 구현될 수도 있다.
프로세서(120)는 매트릭스에 포함된 복수의 엘리먼트의 크기에 기초하여 제1 비율에 해당하는 개수의 엘리먼트의 값을 제로 값으로 변환하여 프루닝된 제1 매트릭스를 획득할 수 있다. 예를 들어, 프로세서(120)는 5 × 5의 매트릭스에 포함된 25개의 엘리먼트의 크기에 기초하여 8%에 해당하는 2개의 엘리먼트의 값을 제로 값으로 변환하여 프루닝된 제1 매트릭스를 획득할 수 있다. 여기서, 프루닝은 매트릭스에서 정확도(accuracy)에 대한 기여도가 낮을 것으로 예상되는 엘리먼트를 0으로 변환하는 동작을 의미한다. 이러한 동작을 통해 데이터 용량의 축소가 가능하나, 정확도가 감소될 수도 있다.
프로세서(120)는 매트릭스에 포함된 복수의 엘리먼트의 절대값의 크기가 작은 순으로 제1 비율에 해당하는 개수의 엘리먼트를 식별할 수 있다. 예를 들어, 프로세서(120)는 5 × 5의 매트릭스에 포함된 25개의 엘리먼트의 절대값의 크기가 작은 순으로 8%에 해당하는 2개의 엘리먼트를 식별할 수 있다. 가령, 5 × 5의 매트릭스에서 행 및 열이 각각 (1, 2)의 위치 및 (3, 3)의 위치에 있는 엘리먼트의 절대값의 크기가 가장 작은 경우, 프로세서(120)는 (1, 2)의 위치 및 (3, 3)의 위치에 있는 엘리먼트를 0으로 변환하고, 나머지 값은 그대로 유지하여 프루닝된 제1 매트릭스를 획득할 수 있다.
프로세서(120)는 이러한 동작을 통해 매트릭스의 데이터 용량을 축소할 수 있다. 예를 들어, 5 × 5의 매트릭스에 포함된 25개의 엘리먼트가 각각 32 비트라고 하면, 프루닝 전에는 매트릭스를 저장하기 위해 총 32 × 25 = 800 비트가 필요하였으나, 프루닝 후에는 총 64 비트의 2개의 엘리먼트가 0이 됨에 따라 64 비트 보다 적은 비트수로서 매트릭스를 표현할 수 있다. 이상에서는 설명의 편의를 위해 전체 엘리먼트의 개수에서 제로 값으로 변환되는 비율을 8%로 설명하였으나, 이 비율은 얼마든지 높아질 수 있다. 또한, 이 비율이 높아질수록 더 적은 비트수로서 매트릭스를 표현할 수 있다. 이상의 비율은 프루닝 레이트(pruning rate)라고도 한다.
이후, 프로세서(120)는 테스트 데이터에 기초하여 제1 매트릭스를 포함하는 인공지능 모델의 제1 정확도를 획득할 수 있다. 예를 들어, 프로세서(120)는 복수의 숫자 이미지를 제1 매트릭스를 포함하는 인공지능 모델에 입력하고, 출력되는 데이터가 숫자 이미지와 매칭되는지 여부를 판단하여, 제1 매트릭스를 포함하는 인공지능 모델의 제1 정확도를 획득할 수 있다.
다만, 이는 정확도를 획득하기 위한 일 실시 예에 불과하며, 프로세서(120)는 얼마든지 다른 방법으로 인공지능 모델의 정확도를 획득할 수도 있다.
프로세서(120)는 제1 정확도가 기설정된 값을 기준으로 기설정된 범위 이내이면 샘플 데이터에 기초하여 제1 매트릭스를 포함하는 인공지능 모델을 리트레이닝(retraining)할 수 있다. 이때, 프로세서(120)는 제1 매트릭스에서 프루닝 동작에 의해 제로 값이 된 엘리먼트를 포함시켜 제1 매트릭스를 포함하는 인공지능 모델을 리트레이닝할 수 있다. 또한, 리트레이닝 방법은 트레이닝 방법과 동일하며, 이때 이용되는 샘플 데이터 역시 동일할 수 있다.
그리고, 기설정된 값은 테스트 데이터에 기초하여 매트릭스를 포함하는 인공지능 모델의 정확도에 기초하여 획득될 수 있다. 예를 들어, 프로세서(120)는 프루닝 전의 인공지능 모델의 정확도를 획득하고, 획득된 정확도를 기설정된 값으로 이용할 수 있다. 가령, 프로세서(120)는 프루닝 전의 인공지능 모델의 정확도가 80%이면, 제1 정확도가 80%를 기준으로 기설정된 범위 이내인지 판단할 수 있다.
다만, 이에 한정되는 것은 아니며, 프로세서(120)는 프루닝 전의 인공지능 모델의 정확도와 무관한 기설정된 값을 이용할 수도 있다. 예를 들어, 프로세서(120)는 프루닝 전의 인공지능 모델의 정확도가 80% 이더라도, 제1 정확도가 70%를 기준으로 기설정된 범위 이내인지 판단할 수도 있다. 이 경우, 기설정된 값은 사용자에 의해 입력된 값일 수 있다.
기설정된 범위는 사용자에 의해 입력된 값일 수 있다. 상술한 예에서, 사용자가 기설정된 범위를 2%로 입력하는 경우, 프로세서(120)는 제1 정확도가 80%를 기준으로 78% ~ 82% 이내인지 판단할 수 있다.
제1 정확도가 기설정된 값을 기준으로 기설정된 범위 이내라면, 정확도를 유지하면서 추가 프루닝 동작을 통해 인공지능 모델의 데이터 용량을 축소시킬 여지가 있다. 그에 따라, 프로세서(120)는 제1 매트릭스를 포함하는 인공지능 모델을 리트레이닝하며, 리트레이닝에 따라 0이 된 엘리먼트는 다시 0이 아닌 값이 될 수 있고, 0으로 변환되지 않은 엘리먼트 중 특정 엘리먼트는 0에 가까워질 수 있다. 따라서, 후술할 추가 프루닝 동작에 따라 0으로 변환되는 엘리먼트가 바뀔 수 있다.
프로세서(120)는 리트레이닝된 제1 매트릭스에 포함된 복수의 엘리먼트의 크기에 기초하여 제1 비율보다 큰 제2 비율에 해당하는 개수의 엘리먼트의 값을 제로 값으로 변환하여 프루닝된 제2 매트릭스를 획득할 수 있다.
예를 들어, 프로세서(120)는 5 × 5의 매트릭스에 포함된 25개의 엘리먼트의 크기에 기초하여 8%보다 큰 16%에 해당하는 4개의 엘리먼트의 값을 제로 값으로 변환하여 프루닝된 제1 매트릭스를 획득할 수 있다.
또한, 프로세서(120)는 리트레이닝된 제1 매트릭스에 포함된 복수의 엘리먼트의 절대값의 크기가 작은 순으로 제2 비율에 해당하는 개수의 엘리먼트를 식별할 수 있다. 여기서, 프루닝 레이트가 제1 비율에서 제2 비율로 증가됨에 따라 0으로 변환되는 엘리먼트가 증가될 수 있고, 그에 따라 인공지능 모델의 데이터 용량이 더 축소될 수 있다.
프로세서(120)는 이상과 같은 방법을 통해 프루닝 동작 및 리트레이닝 동작을 반복할 수 있다.
구체적으로, 프로세서(120)는 테스트 데이터에 기초하여 제2 매트릭스를 포함하는 인공지능 모델의 제2 정확도를 획득하며, 제2 정확도가 기설정된 값을 기준으로 기설정된 범위 이내이면 샘플 데이터에 기초하여 제2 매트릭스를 포함하는 인공지능 모델을 리트레이닝하고, 리트레이닝된 제2 매트릭스에 포함된 복수의 엘리먼트의 크기에 기초하여 제2 비율보다 큰 제3 비율에 해당하는 개수의 엘리먼트의 값을 제로 값으로 변환하여 프루닝된 제3 매트릭스를 획득할 수 있다.
다만, 프로세서(120)는 테스트 데이터에 기초하여 제3 매트릭스를 포함하는 인공지능 모델의 제3 정확도를 획득하고, 제3 정확도가 기설정된 값을 기준으로 기설정된 범위를 벗어나면 제2 매트릭스를 인공지능 모델에 포함된 매트릭스의 최종 매트릭스로 결정할 수 있다. 즉, 프로세서(120)는 정확도가 허용 범위를 벗어나는 경우, 허용 범위를 만족시키는 매트릭스 중 프루닝이 가장 나중에 수행된 매트릭스를 인공지능 모델에 포함된 매트릭스의 최종 매트릭스로 결정할 수 있다.
또는, 프로세서(120)는 제3 매트릭스에 적용된 프루닝 횟수가 기설정된 횟수이면, 제3 매트릭스를 인공지능 모델에 포함된 매트릭스의 최종 매트릭스로 결정할 수도 있다.
한편, 프로세서(120)는 제1 정확도가 기설정된 값을 기준으로 기설정된 범위를 벗어나면 매트릭스에 포함된 복수의 엘리먼트의 크기에 기초하여 제1 비율보다 작은 비율에 해당하는 개수의 엘리먼트의 값을 제로 값으로 변환하여 리프루닝(re-pruning)된 제1 매트릭스를 획득하고, 이상에서 설명한 프루닝 동작 및 리트레이닝 동작을 반복할 수도 있다.
예를 들어, 프로세서(120)는 5 × 5의 매트릭스에 포함된 25개의 엘리먼트의 크기에 기초하여 8%에 해당하는 2개의 엘리먼트의 값을 제로 값으로 변환하여 프루닝된 제1 매트릭스를 획득하고, 테스트 데이터에 기초하여 제1 매트릭스를 포함하는 인공지능 모델의 제1 정확도를 획득할 수 있다. 만약, 제1 정확도가 허용 범위를 벗어나고, 추가 프루닝을 수행하지 않는다면, 프로세서(120)는 최초 트레이닝된 인공지능 모델을 그대로 저장하게 되어 데이터 용량을 축소하지 못하게 된다. 따라서, 프로세서(120)는 제1 정확도가 허용 범위를 벗어나면, 5 × 5의 매트릭스에 포함된 25개의 엘리먼트의 크기에 기초하여 4%에 해당하는 1개의 엘리먼트의 값을 제로 값으로 변환하여 리프루닝된 제1 매트릭스를 획득할 수 있다.
한편, 이상의 각 단계에서 이용되는 테스트 데이터는 모두 동일할 수 있다. 그에 따라, 프로세서(120)는 각 단계의 정확도 및 기설정된 값을 객관적으로 비교할 수 있다.
한편, 이상에서는 설명의 편의를 위하여 5 × 5의 매트릭스를 예로 들었으 나, 실제 매트릭스는 10000 × 8000의 형태와 같이 매우 클 수 있다.
한편, 프로세서(120)는 제1 비율에 기초한 프루닝 동작 대신, 제1 랭크(rank) 값에 기초한 SVD(singular value decomposition)를 통해 매트릭스를 제1 서브 매트릭스 및 제2 서브 매트릭스로 분할하고, 제1 서브 매트릭스 및 제2 서브 매트릭스를 결합하여 제1 매트릭스를 획득하고, 제2 비율에 기초한 프루닝 동작 대신, 제1 랭크 값보다 작은 제2 랭크 값에 기초한 SVD를 통해 리트레이닝된 제1 매트릭스를 제3 서브 매트릭스 및 제4 서브 매트릭스로 분할하고, 제3 서브 매트릭스 및 제4 서브 매트릭스를 결합하여 제2 매트릭스를 획득할 수도 있다.
예를 들어, 프로세서(120)는 제1 비율에 기초한 프루닝 동작 대신, 제1 랭크(rank) 값 50에 기초한 SVD를 통해 10000 × 8000의 매트릭스를 10000 × 50의 제1 서브 매트릭스 및 50 × 8000의 제2 서브 매트릭스로 분할하고, 제1 서브 매트릭스 및 제2 서브 매트릭스를 결합하여 10000 × 8000의 제1 매트릭스를 획득하고, 제2 비율에 기초한 프루닝 동작 대신, 제1 랭크 값 50보다 작은 제2 랭크 값 45에 기초한 SVD를 통해 리트레이닝된 제1 매트릭스를 10000 × 45의 제3 서브 매트릭스 및 45 × 8000의 제4 서브 매트릭스로 분할하고, 제3 서브 매트릭스 및 제4 서브 매트릭스를 결합하여 10000 × 8000의 제2 매트릭스를 획득할 수도 있다.
여기서, 제2 매트릭스의 획득 동작은 제1 정확도가 허용 범위 내일 때의 동작일 수 있다.
그리고, 매트릭스를 두 개의 서브 매트릭스로 분할하는 경우, 데이터 용량이 축소될 수 있다. 이상의 예에서 10000 × 8000의 매트릭스를 10000 × 50의 제1 서브 매트릭스 및 50 × 8000의 제2 서브 매트릭스로 분할하는 경우, 총 데이터는 10000 × 8000 = 80000000 에서 10000 × 50 + 50 × 8000 = 900000 으로 축소될 수 있다. 즉, 랭크 값이 작을수록 데이터 용량이 감소할 수 있다.
한편, SVD는 매트릭스의 특이값 분해를 의미하며, SVD의 특성 상 두 개의 서브 매트릭스를 결합하더라도 분할 전의 매트릭스가 복원되지 않을 수 있다. 즉, 상술한 예에서 제1 서브 매트릭스 및 제2 서브 매트릭스를 결합하여 획득된 제1 매트릭스는 제1 서브 매트릭스 및 제2 서브 매트릭스로 분할되기 전의 매트릭스와 형태는 동일할 수 있으나, 세부적인 값에는 변화가 있을 수 있다.
따라서, SVD에 따라 생성된 제1 서브 매트릭스 및 제2 서브 매트릭스를 포함하는 인공지능 모델의 경우, SVD 전의 매트릭스를 포함하는 인공지능 모델보다 정확도가 낮아질 수 있다. 그에 따라, 프루닝과 동일하게 SVD 이후의 제1 서브 매트릭스 및 제2 서브 매트릭스를 포함하는 인공지능 모델의 정확도에 따라 리트레이닝 및 SVD의 추가 적용이 수행될지가 결정될 수 있다.
프로세서(120)는 프루닝 동작과 유사하게 리트레이닝 및 SVD를 반복하며, 정확도에 기초하여 반복 동작을 정지할 수 있다.
구체적으로, 프로세서(120)는 테스트 데이터에 기초하여 제2 매트릭스를 포함하는 인공지능 모델의 제2 정확도를 획득하고, 제2 정확도가 기설정된 값을 기준으로 기설정된 범위를 벗어나면 제1 서브 매트릭스 및 제2 서브 매트릭스를 인공지능 모델에 포함된 매트릭스의 최종 매트릭스로 결정할 수 있다.
또는, 프로세서(120)는 제2 매트릭스에 적용된 SVD 횟수가 기설정된 횟수이면, 제3 서브 매트릭스 및 제4 서브 매트릭스를 인공지능 모델에 포함된 매트릭스의 최종 매트릭스로 결정할 수도 있다.
그리고, 프로세서(120)는 제1 정확도가 기설정된 값을 기준으로 기설정된 범위를 벗어나면 제1 랭크 값보다 큰 제2 랭크 값에 기초한 SVD를 통해 매트릭스를 제1 서브 매트릭스 및 제2 서브 매트릭스로 재분할하고, 제1 서브 매트릭스 및 제2 서브 매트릭스를 결합하여 제1 매트릭스를 재획득할 수 있다.
한편, 이상에서는 프루닝 동작 및 SVD에 따른 동작이 별개인 것으로 설명하였으나, 이에 한정되는 것은 아니다. 예를 들어, 프로세서(120)는 프루닝 동작을 반복하여 최종 프루닝된 매트릭스를 획득하고, 최종 프루닝된 매트릭스에 대하여 SVD에 따른 동작을 반복하여 복수의 최종 서브 매트릭스를 획득할 수도 있다.
또는, 프로세서(120)는 프루닝 동작 및 SVD에 따른 동작을 교번적으로 수행할 수도 있다. 예를 들어, 프로세서(120)는 프루닝 동작을 1회 수행하고, SVD에 따른 동작을 1회 수행하며, 이러한 동작을 반복할 수도 있다.
도 1b는 본 개시의 일 실시 예에 따른 전자 장치(100)의 세부 구성을 나타내는 블럭도이다. 도 1b에 따르면, 전자 장치(100)는 스토리지(110), 프로세서(120), 통신부(130), 사용자 인터페이스부(140), 디스플레이(150), 오디오 처리부(160), 비디오 처리부(170)를 포함한다. 도 1b에 도시된 구성요소들 중 도 1a에 도시된 구성요소와 중복되는 부분에 대해서는 자세한 설명을 생략하도록 한다.
프로세서(120)는 스토리지(110)에 저장된 각종 프로그램을 이용하여 전자 장치(100)의 동작을 전반적으로 제어한다.
구체적으로, 프로세서(120)는 RAM(121), ROM(122), 메인 CPU(123), 그래픽 처리부(124), 제1 내지 n 인터페이스(125-1 ~ 125-n), 버스(126)를 포함한다.
RAM(121), ROM(122), 메인 CPU(123), 그래픽 처리부(124), 제1 내지 n 인터페이스(125-1 ~ 125-n) 등은 버스(126)를 통해 서로 연결될 수 있다.
제1 내지 n 인터페이스(125-1 내지 125-n)는 상술한 각종 구성요소들과 연결된다. 인터페이스들 중 하나는 네트워크를 통해 외부 장치와 연결되는 네트워크 인터페이스가 될 수도 있다.
메인 CPU(123)는 스토리지(110)에 액세스하여, 스토리지(110)에 저장된 O/S를 이용하여 부팅을 수행한다. 그리고, 스토리지(110)에 저장된 각종 프로그램 등을 이용하여 다양한 동작을 수행한다.
ROM(122)에는 시스템 부팅을 위한 명령어 세트 등이 저장된다. 턴온 명령이 입력되어 전원이 공급되면, 메인 CPU(123)는 ROM(122)에 저장된 명령어에 따라 스토리지(110)에 저장된 O/S를 RAM(121)에 복사하고, O/S를 실행시켜 시스템을 부팅시킨다. 부팅이 완료되면, 메인 CPU(123)는 스토리지(110)에 저장된 각종 어플리케이션 프로그램을 RAM(121)에 복사하고, RAM(121)에 복사된 어플리케이션 프로그램을 실행시켜 각종 동작을 수행한다.
그래픽 처리부(124)는 연산부(미도시) 및 렌더링부(미도시)를 이용하여 아이콘, 이미지, 텍스트 등과 같은 다양한 객체를 포함하는 화면을 생성한다. 연산부(미도시)는 수신된 제어 명령에 기초하여 화면의 레이아웃에 따라 각 객체들이 표시될 좌표값, 형태, 크기, 컬러 등과 같은 속성값을 연산한다. 렌더링부(미도시)는 연산부(미도시)에서 연산한 속성값에 기초하여 객체를 포함하는 다양한 레이아웃의 화면을 생성한다. 렌더링부(미도시)에서 생성된 화면은 디스플레이(150)의 디스플레이 영역 내에 표시된다.
한편, 상술한 프로세서(120)의 동작은 스토리지(110)에 저장된 프로그램에 의해 이루어질 수 있다.
스토리지(110)는 전자 장치(100)를 구동시키기 위한 O/S(Operating System) 소프트웨어 모듈, 인공지능 모델과 데이터 용량이 축소된 인공지능 모델을 포함하는 인공지능 모듈 및 인공지능 모델의 데이터 용량 축소 모듈 등과 같이 다양한 데이터를 저장한다.
통신부(130)는 다양한 유형의 통신방식에 따라 다양한 유형의 외부 장치와 통신을 수행하는 구성이다. 통신부(130)는 와이파이 칩(131), 블루투스 칩(132), 무선 통신 칩(133), NFC 칩(134) 등을 포함한다. 프로세서(120)는 통신부(130)를 이용하여 각종 외부 장치와 통신을 수행한다.
와이파이 칩(131), 블루투스 칩(132)은 각각 WiFi 방식, 블루투스 방식으로 통신을 수행한다. 와이파이 칩(131)이나 블루투스 칩(132)을 이용하는 경우에는 SSID 및 세션 키 등과 같은 각종 연결 정보를 먼저 송수신하여, 이를 이용하여 통신 연결한 후 각종 정보들을 송수신할 수 있다. 무선 통신 칩(133)은 IEEE, 지그비(zigbee), 3G(3rd Generation), 3GPP(3rd Generation Partnership Project), LTE(Long Term Evoloution) 등과 같은 다양한 통신 규격에 따라 통신을 수행하는 칩을 의미한다. NFC 칩(134)은 135kHz, 13.56MHz, 433MHz, 860~960MHz, 2.45GHz 등과 같은 다양한 RF-ID 주파수 대역들 중에서 13.56MHz 대역을 사용하는 NFC(Near Field Communication) 방식으로 동작하는 칩을 의미한다.
프로세서(130)는 통신부(130)를 통해 외부 장치로부터 인공지능 모델 또는 인공지능 모델에 포함된 매트릭스를 수신하고, 수신된 데이터를 스토리지(110)에 저장할 수 있다. 또는, 프로세서(130)는 인공지능 알고리즘을 통해 인공지능 모델을 직접 학습하고, 학습된 인공지능 모델을 스토리지(110)에 저장할 수도 있다. 여기서, 인공지능 모델은 적어도 하나의 매트릭스를 포함할 수 있다.
사용자 인터페이스부(140)는 다양한 사용자 인터랙션(interaction)을 수신한다. 여기서, 사용자 인터페이스부(140)는 전자 장치(100)의 구현 예에 따라 다양한 형태로 구현 가능하다. 예를 들어, 사용자 인터페이스부(140)는 전자 장치(100)에 구비된 버튼, 사용자 음성을 수신하는 마이크, 사용자 모션을 감지하는 카메라 등일 수 있다. 또는, 전자 장치(100)가 터치 기반의 전자 장치로 구현되는 경우 사용자 인터페이스부(140)는 터치패드와 상호 레이어 구조를 이루는 터치 스크린 형태로 구현될 수도 있다. 이 경우, 사용자 인터페이스부(140)는 상술한 디스플레이(150)로 사용될 수 있게 된다.
오디오 처리부(160)는 오디오 데이터에 대한 처리를 수행하는 구성요소이다. 오디오 처리부(160)에서는 오디오 데이터에 대한 디코딩이나 증폭, 노이즈 필터링 등과 같은 다양한 처리가 수행될 수 있다.
비디오 처리부(170)는 비디오 데이터에 대한 처리를 수행하는 구성요소이다. 비디오 처리부(170)에서는 비디오 데이터에 대한 디코딩, 스케일링, 노이즈 필터링, 프레임 레이트 변환, 해상도 변환 등과 같은 다양한 이미지 처리를 수행할 수 있다.
이상과 같은 방법을 통해 프로세서(120)는 인공지능 모델에 포함된 매트릭스의 데이터 용량을 축소할 수 있다.
이하에서는 도면을 통해 전자 장치(100)의 동작을 좀더 구체적으로 설명한다.
도 2a 및 도 2b 본 개시의 일 실시 예에 따른 인공지능 모델을 설명하기 위한 도면들이다.
도 2a는 세 개의 레이어와 두 개의 매트릭스를 포함하는 인공지능 모델의 일 예를 나타내는 도면으로, 프로세서(120)는 Li-1의 입력값들을 W12에 입력하여 Li의 중간값을 획득하며, Li의 중간값들을 W23에 입력하여 Li+1의 최종값을 획득할 수 있다. 다만, 도 2a는 인공지능 모델을 매우 간략하게 도시한 것으로, 실제로는 도 2a보다 더 많은 레이어들을 포함할 수 있다.
도 2b는 매트릭스의 일 예를 나타내는 도면으로, 매트릭스는 m × n의 형태일 수 있다. 예를 들어, 매트릭스는 10000 × 8000의 형태일 수 있다. 그리고, 매트릭스 내의 데이터는 각각 32 비트일 수 있다. 즉, 매트릭스는 32 비트인 데이터를 10000 × 8000개 포함할 수 있다. 다만, 이에 한정되는 것은 아니며, 매트릭스의 크기 및 각 데이터의 비트수는 얼마든지 다를 수도 있다.
도 2a 및 도 2b에 도시된 바와 같이, 매트릭스에 포함된 데이터 각각의 크기, 매트릭스에 포함된 데이터의 개수 및 인공지능 모델에 포함된 매트릭스의 개수를 고려하면, 인공지능 모델을 저장하기 위한 매우 큰 저장 공간이 필요하며, 인공지능 모델의 연산을 위해서도 상당한 전력이 소모될 수 있다. 그에 따라, 프로세서(120)는 매트릭스의 데이터 용량을 축소하여 저장 공간을 확보하고, 연산량을 감소시킬 수 있다.
도 3a 내지 도 3c는 본 개시의 일 실시 예에 따른 프루닝 동작을 설명하기 위한 도면들이다.
설명의 편의를 위해 도 3a에는 매트릭스가 4 × 4 형태인 것으로 설명한다.
프로세서(120)는 도 3a의 4 × 4의 매트릭스에 포함된 복수의 엘리먼트의 절대값을 도 3b와 같이 크기 순으로 정렬할 수 있다.
그리고, 프로세서(120)는 프루닝 레이트에 해당하는 개수의 엘리먼트의 값을 제로 값으로 변환할 수 있다. 예를 들어, 프로세서(120)는 도 3c에 도시된 바와 같이, 프루닝 레이트 25%에 해당하는 4개의 엘리먼트의 값을 제로 값으로 변환하여 프루닝된 제1 매트릭스를 획득할 수 있다. 여기서, 프루닝 레이트는 사용자에 의해 입력될 수 있다. 또는, 프루닝 레이트는 0을 초과하는 기설정된 값일 수 있다.
프로세서(120)는 테스트 데이터에 기초하여 제1 매트릭스를 포함하는 인공지능 모델의 제1 정확도를 획득할 수 있다. 그리고, 프로세서(120)는 제1 정확도가 기설정된 값을 기준으로 기설정된 범위 이내인지 식별할 수 있다.
여기서, 기설정된 값은 테스트 데이터에 기초하여 도 3a의 매트릭스를 포함하는 인공지능 모델의 정확도일 수 있다. 즉, 프로세서(120)는 프루닝 동작을 수행하기 전에, 테스트 데이터에 기초하여 도 3a의 매트릭스를 포함하는 인공지능 모델의 정확도를 획득할 수 있다. 여기서, 정확도 및 제1 정확도를 산출하기 위한 테스트 데이터는 모두 동일할 수 있다.
그리고, 기설정된 범위는 사용자에 의해 입력될 수 있다.
프로세서(120)는 제1 정확도가 기설정된 값을 기준으로 기설정된 범위 이내이면 샘플 데이터에 기초하여 제1 매트릭스를 포함하는 인공지능 모델을 리트레이닝할 수 있다. 즉, 1차 프루닝 후에도 제1 정확도가 일정 수준 유지되는 경우, 프로세서(120)는 제1 매트릭스를 포함하는 인공지능 모델의 리트레이닝 및 리트레이닝된 제1 매트릭스에 대한 추가 프루닝을 수행하게 된다.
또는, 프로세서(120)는 제1 정확도가 기설정된 값을 기준으로 기설정된 범위를 벗어나면 도 3a의 매트릭스에 포함된 복수의 엘리먼트의 크기에 기초하여 프루닝 레이트보다 작은 프루닝 레이트에 해당하는 개수의 엘리먼트의 값을 제로 값으로 변환하여 리프루닝된 제1 매트릭스를 획득할 수 있다. 즉, 1차 프루닝에 따라 제1 정확도가 상당히 낮아지는 경우, 프로세서(120)는 정확도 확보를 위해 프루닝 레이트를 낮추고, 리프루닝을 수행하게 된다. 예를 들어, 프로세서(120)는 프루닝 레이트를 12.5%로 낮추고, 2개의 엘리먼트의 값을 제로 값으로 변환하여 리프루닝된 제1 매트릭스를 획득할 수 있다.
프로세서(120)는 리프루닝된 제1 매트릭스를 획득한 후, 제1 정확도를 다시 획득하고, 제1 정확도가 기설정된 값을 기준으로 기설정된 범위 이내인지 식별할 수 있다. 이후의 동작은 이상에서 설명한 바와 동일하다.
이하에서는 제1 정확도가 기설정된 값을 기준으로 기설정된 범위 이내인 경우, 이후의 리트레이닝 및 추가 프루닝 동작에 대하여 설명한다.
도 4는 본 개시의 일 실시 예에 따른 리트레이닝된 제1 매트릭스를 나타낸다.
프로세서(120)는 도 4에 도시된 바와 같이, 샘플 데이터에 기초하여 도 3c의 제1 매트릭스를 포함하는 인공지능 모델을 리트레이닝할 수 있다. 여기서, 샘플 데이터는 도 3a의 매트릭스를 포함하는 인공지능 모델을 트레이닝할 때 이용된 샘플 데이터와 동일할 수 있다.
프로세서(120)는 리트레이닝 과정에서 처리 속도의 향상을 위해 적은 수의 mini-batch를 이용할 수 있다. 예를 들어, mini-batch는 한 epoch의 10% 이내일 수 있다.
리트레이닝에 따라 제로 값들이 다시 특정 수치로 변경될 수 있으며, 제로 값들 외의 나머지 값들도 수치가 변경될 수 있다.
도 5a 및 도 5b는 본 개시의 다양한 실시 예에 따른 추가 프루닝에 따른 효과를 설명하기 위한 도면들이다.
먼저, 프로세서(120)는 도 5a에 도시된 바와 같이, 프루닝 레이트를 25%보다 높은 50%에 해당하는 8개의 엘리먼트의 값을 제로 값으로 변환하여 프루닝된 제2 매트릭스를 획득할 수 있다. 이 경우, 도 3c에서 제로 값으로 변환되지 않은 엘리먼트까지 추가로 제로 값으로 변환될 수 있다.
다만, 도 5a에서는 설명의 편의를 위하여 갑작스럽게 프루닝 레이트를 증가시켰으나, 실제로는 좀더 완만하게 프루닝 레이트를 증가시킬 수도 있다.
즉, 프로세서(120)는 프루닝 레이트를 25%에서 26%으로 증가시킬 수 있다. 매트릭스에 포함된 복수의 엘리먼트의 개수의 26%는 4.16이므로, 프로세서(120)는 4.16을 반올림하여 4개의 엘리먼트를 제로 값으로 변환할 수 있다. 예를 들어, 프로세서(120)는 도 5b에 도시된 바와 같이, 2차 프루닝된 제2 매트릭스를 획득할 수 있다. 다만, 이에 한정되는 것은 아니며, 프로세서(120)는 올림 또는 내림하여 제로 값으로 변환할 엘리먼트의 개수를 결정할 수도 있다.
도 5b의 제2 매트릭스는 도 3c의 제1 매트릭스와 비교하여 동일한 개수의 엘리먼트가 제로 값으로 변환되었으나, 변환된 엘리먼트의 위치가 변경될 수 있다. 즉, 제로 값으로 변환된 엘리먼트를 포함시켜 프루닝을 추가적으로 수행함에 따라 정확도에 영향을 덜 미치는 엘리먼트가 제로 값으로 변경될 확률이 증가할 수 있다. 즉, 상대적으로 불필요한 엘리먼트를 제로 값을 변경함에 따라 정확도를 크게 변경하지 않으면서도 인공지능 모델의 데이터 용량을 축소시킬 수 있다.
프로세서(120)는 도 3c에서 설명한 바와 같이, 제2 매트릭스의 제2 정확도를 획득하고, 제2 정확도가 기설정된 값을 기준으로 기설정된 범위 이내인지 식별할 수 있다. 여기서, 제2 정확도의 획득 방법 및 기설정된 값을 기준으로 한 기설정된 범위는 도 3c와 동일할 수 있다.
만약, 제2 정확도가 기설정된 값을 기준으로 기설정된 범위 이내이면, 프로세서(120)는 제2 매트릭스를 포함하는 인공지능 모델의 리트레이닝 및 리트레이닝된 제2 매트릭스에 대한 추가 프루닝을 수행할 수 있으며, 이러한 동작은 도 4 내지 도 5b에서 설명한 바와 동일하다.
또는, 제2 정확도가 기설정된 값을 기준으로 기설정된 범위를 벗어나면, 프로세서(120)는 제1 매트릭스를 인공지능 모델에 포함된 매트릭스의 최종 매트릭스로 결정할 수 있다. 즉, 제2 매트릭스의 정확도는 기준이 미달되므로, 프로세서(120)는 정확도에 대한 기준에 부합하는 제1 매트릭스를 최종 매트릭스로 결정할 수 있다. 또한, 제1 매트릭스는 리트레이닝 전이므로, 일부 엘리먼트가 제로 값으로 변경된 상태이며, 데이터 용량이 축소된 상태일 수 있다.
다만, 이에 한정되는 것은 아니며, 프로세서(120)는 리트레이닝된 제1 매트릭스를 재프루닝할 수도 있다. 재프루닝에 이용되는 프루닝 레이트는 매트릭스의 프루닝에 이용된 프루닝 레이트와 바로 직전에 리트레이닝된 제1 매트릭스에 이용된 프루닝 레이트 사이의 값일 수 있다. 예를 들어, 매트릭스의 프루닝에 이용된 프루닝 레이트가 30%이고, 바로 직전에 리트레이닝된 제1 매트릭스에 이용된 프루닝 레이트가 40%이면, 리트레이닝된 제1 매트릭스의 재프루닝에 이용될 프루닝 레이트는 35%일 수 있다. 리트레이닝된 제1 매트릭스의 재프루닝에 따라 획득된 제2 매트릭스를 포함하는 인공지능 모델의 제2 정확도가 기준에 부합하면, 제1 매트릭스보다 데이터 용량을 낮추면서도 정확도를 유지할 수 있다.
이상에서는 정확도가 기준을 벗어날을 때, 프루닝 동작을 정지하는 것으로 설명하였으나, 이에 한정되는 것은 아니다. 예를 들어, 프로세서(120)는 이상과 같이 반복되는 프루닝 동작을 프루닝 횟수에 기초하여 종료할 수도 있다. 또는, 프로세서(120)는 매트릭스의 데이터 용량이 타겟 데이터 용량보다 작아지면 프루닝 동작을 종료할 수도 있다.
이상과 같이 프루닝 동작을 반복함에 따라 인공지능 모델의 정확도를 유지하면서도 인공지능 모델의 데이터 용량을 축소시킬 수 있다.
도 6a 및 도 6b는 본 개시의 일 실시 예에 따른 SVD를 통해 매트릭스를 분할하는 방법을 설명하기 위한 도면들이다.
도 6a의 상단은 인공지능 모델에 포함된 m × n의 매트릭스를 나타내며, 프로세서(120)는 도 6a의 하단에 도시된 바와 같이, 제1 랭크 값에 기초한 SVD를 통해 m × n의 매트릭스를 m × r의 제1 서브 매트릭스 및 r × n의 제2 서브 매트릭스로 분할할 수 있다. 즉, 프로세서(120)는 m × n의 매트릭스를 m × r의 제1 서브 매트릭스 및 r × n의 제2 서브 매트릭스로 분할함에 따라 데이터 용량을 축소시킬 수 있으며, low-rank factorization 기반의 압축을 수행할 수 있다.
여기서, 제1 랭크 값은 사용자에 의해 입력될 수 있으며, 제1 랭크 값이 작을수록 데이터 용량이 더 작을 수 있다. 다만, 제1 랭크 값이 작아지면 정확도도 낮아질 수 있다. 따라서, 정확도를 유지하면서 데이터 용량을 축소하기 위해 적절한 랭크 값을 설정해줄 필요가 있다.
프로세서(120)는 도 6a의 하단의 m × r의 제1 서브 매트릭스 및 r × n의 제2 서브 매트릭스를 곱하여 도 6b와 같은 m × n의 매트릭스를 획득할 수 있다. 다만, 이때 획득되는 m × n의 매트릭스는 복수의 서브 매트릭스로 분할하기 전의 m × n의 매트릭스와 미차가 있을 수 있다.
즉, 일반적으로 저장 공간이 부족한 장치는 도 6a의 하단의 m × r의 제1 서브 매트릭스 및 r × n의 제2 서브 매트릭스를 저장하고, 필요에 따라 제1 서브 매트릭스 및 제2 서브 매트릭스를 곱하여 필요한 연산을 수행하게 된다. 다만, 제1 서브 매트릭스 및 제2 서브 매트릭스를 곱하더라도 복수의 서브 매트릭스로 분할하기 전의 m × n의 매트릭스가 복원되는 것은 아니기 때문에 정확도의 손실이 있을 수 있다.
프로세서(120)는 도 3a 내지 도 5b에서 설명한 동작 중 프루닝 동작 대신 도 6a의 동작을 수행할 수 있다. 그리고, 프로세서(120)는 도 6b와 같이 복수의 서브 매트릭스를 곱하여 도 6a와 같이 분할된 복수의 서브 매트릭스의 정확도를 획득할 수 있다.
즉, 프로세서(120)는 도 3a 내지 도 5b에서 설명한 동작 중 프루닝 동작을 도 6a의 동작을 대체하고, 정확도 산출 전 도 6b와 같은 연산을 추가할 수 있다. 그리고, 프로세서(120)는 SVD를 통해 도 6b의 매트릭스를 추가적으로 분할할 수 있다. 이때, 도 3a 내지 도 5b의 프루닝 레이트 대신 랭크 값이 변경될 수 있다.
구체적으로, 프로세서(120)는 최초로 분할된 제1 서브 매트릭스 및 제2 서브 매트릭스의 제1 정확도가 기설정된 값을 기준으로 기설정된 범위 이내이면, 랭크 값을 낮춰서 도 6b의 매트릭스를 제3 서브 매트릭스 및 제4 서브 매트릭스로 분할할 수 있다.
그리고, 프로세서(120)는 제3 서브 매트릭스 및 제4 서브 매트릭스를 곱하여 제2 정확도를 획득하고, 제2 정확도가 기설정된 값을 기준으로 기설정된 범위 이내이면, SVD를 통한 매트릭스 분할을 반복할 수 있다.
또는, 프로세서(120)는 제2 정확도가 기설정된 값을 기준으로 기설정된 범위를 벗어나면, 기준에 미달된 제3 서브 매트릭스 및 제4 서브 매트릭스를 삭제하고, 제1 서브 매트릭스 및 제2 서브 매트릭스를 인공지능 모델에 포함된 매트릭스의 최종 매트릭스로 결정할 수 있다.
한편, 프로세서(120)는 최초로 분할된 제1 서브 매트릭스 및 제2 서브 매트릭스의 제1 정확도가 기설정된 값을 기준으로 기설정된 범위를 벗어나면, 랭크 값을 높여 최초 매트릭스를 재분할할 수 있다.
정확도에 기초하여 반복 동작 또는 종료 동작을 수행하는 방법은 도 3a 내지 도 5b에서 설명한 바와 동일하므로, 반복되는 설명은 생략한다.
도 7a 및 도 7b는 본 개시의 일 실시 예에 따른 효과를 설명하기 위한 히스토그램들이다.
도 7a 및 도 7b는 MNIST의 dataset에서 LeNet-5(caffe모델)을 이용한 결과이며, 도 7a는 종래의 프루닝 방법에 따른 히스토그램이며, 도 7b는 본원의 프루닝 방법에 따른 히스토그램을 나타내며, 0을 제외한 값들만 도시하였다.
종래의 프루닝 방법에 따르면 정확도를 유지하며 달성할 수 있는 최대 프루닝 레이트가 91%이나, 본원의 프루닝 방법에 따르면 정확도를 유지하며 달성할 수 있는 최대 프루닝 레이트가 99.5%로 증가된다.
또한, 도 7a에는 0에 가까운 값이 약 400개 가까이 존재하나, 도 7b에는 0에 가까운 값이 약 100개 이내이다. 즉, 본원의 프루닝 방법을 이용하면 정확도에 영향을 덜 미치는 엘리먼트가 제로 값으로 변경될 확률이 올라가며, 그에 따라 데이터 용량이 축소될 수 있다. 이는 살아남은 엘리먼트를 좀더 효율적으로 이용함을 의미한다.
한편, 도 7a 및 도 7b에 도시하지는 않았으나, SVD를 이용하는 경우 종래에는 트레이닝 직후 SVD를 한번만 수행하고 인공지능 모델을 만드는 반면, 본원에 따르면 SVD를 반복 수행함에 따라 정확도가 향상될 수 있다. 예를 들어, Tensorflow에서 제공하는 PTB dataset의 LSTM모델(medium 사이즈)에 대해 다양한 랭크 값(Rank)을 시도하면 하기와 같은 정확도가 획득될 수 있다.
Rank 128일 때, 종래 SVD의 test perplexity=87.398, 본원 SVD의 test perplexity=84.304
Rank 64일 때, 종래 SVD의 test perplexity=92.699, 본원 SVD의 test perplexity=85.297
Rank 32일 때, 종래 SVD의 test perplexity=107.454, 본원 SVD의 test perplexity=88.291
Perplexity는 낮을수록 좋으며, 동일한 랭크 값에서 본원 SVD는 종래보다 높은 정확도를 나타낸다.
도 8은 본 개시의 일 실시 예에 따른 전자 장치의 제어 방법을 설명하기 위한 흐름도이다.
샘플 데이터 및 샘플 데이터에 기초하여 트레이닝(training)된 인공지능 모델에 포함된 매트릭스가 저장된 전자 장치의 제어 방법은 먼저, 매트릭스에 포함된 복수의 엘리먼트의 크기에 기초하여 제1 비율에 해당하는 개수의 엘리먼트의 값을 제로 값으로 변환하여 프루닝(pruning)된 제1 매트릭스를 획득한다(S810). 그리고, 테스트 데이터에 기초하여 제1 매트릭스를 포함하는 인공지능 모델의 제1 정확도를 획득한다(S820). 그리고, 제1 정확도가 기설정된 값을 기준으로 기설정된 범위 이내이면 샘플 데이터에 기초하여 제1 매트릭스를 포함하는 인공지능 모델을 리트레이닝(retraining)한다(S830). 그리고, 리트레이닝된 제1 매트릭스에 포함된 복수의 엘리먼트의 크기에 기초하여 제1 비율보다 큰 제2 비율에 해당하는 개수의 엘리먼트의 값을 제로 값으로 변환하여 프루닝된 제2 매트릭스를 획득한다(S840).
여기서, 제1 매트릭스를 획득하는 단계(S810)는 매트릭스에 포함된 복수의 엘리먼트의 절대값의 크기가 작은 순으로 제1 비율에 해당하는 개수의 엘리먼트를 식별하고, 제2 매트릭스를 획득하는 단계(S840)는 리트레이닝된 제1 매트릭스에 포함된 복수의 엘리먼트의 절대값의 크기가 작은 순으로 제2 비율에 해당하는 개수의 엘리먼트를 식별할 수 있다.
한편, 테스트 데이터에 기초하여 제2 매트릭스를 포함하는 인공지능 모델의 제2 정확도를 획득하는 단계, 제2 정확도가 기설정된 값을 기준으로 기설정된 범위 이내이면 샘플 데이터에 기초하여 제2 매트릭스를 포함하는 인공지능 모델을 리트레이닝하는 단계 및 리트레이닝된 제2 매트릭스에 포함된 복수의 엘리먼트의 크기에 기초하여 제2 비율보다 큰 제3 비율에 해당하는 개수의 엘리먼트의 값을 제로 값으로 변환하여 프루닝된 제3 매트릭스를 획득하는 단계를 더 포함할 수 있다.
여기서, 테스트 데이터에 기초하여 제3 매트릭스를 포함하는 인공지능 모델의 제3 정확도를 획득하는 단계 및 제3 정확도가 기설정된 값을 기준으로 기설정된 범위를 벗어나면 제2 매트릭스를 인공지능 모델에 포함된 매트릭스의 최종 매트릭스로 결정하는 단계를 더 포함할 수 있다.
또는, 제3 매트릭스에 적용된 프루닝 횟수가 기설정된 횟수이면, 제3 매트릭스를 인공지능 모델에 포함된 매트릭스의 최종 매트릭스로 결정하는 단계를 더 포함할 수 있다.
한편, 제1 정확도가 기설정된 값을 기준으로 기설정된 범위를 벗어나면 매트릭스에 포함된 복수의 엘리먼트의 크기에 기초하여 제1 비율보다 작은 비율에 해당하는 개수의 엘리먼트의 값을 제로 값으로 변환하여 리프루닝(re-pruning)된 제1 매트릭스를 획득하는 단계를 더 포함할 수 있다.
그리고, 기설정된 값은 테스트 데이터에 기초하여 매트릭스를 포함하는 인공지능 모델의 정확도에 기초하여 획득될 수 있다.
한편, 제1 매트릭스를 획득하는 단계(S810)는 제1 비율에 기초한 프루닝 동작 대신, 제1 랭크(rank) 값에 기초한 SVD(singular value decomposition)를 통해 매트릭스를 제1 서브 매트릭스 및 제2 서브 매트릭스로 분할하고, 제1 서브 매트릭스 및 제2 서브 매트릭스를 결합하여 제1 매트릭스를 획득하며, 제2 매트릭스를 획득하는 단계(S840)는 제2 비율에 기초한 프루닝 동작 대신, 제1 랭크 값보다 작은 제2 랭크 값에 기초한 SVD를 통해 리트레이닝된 제1 매트릭스를 제3 서브 매트릭스 및 제4 서브 매트릭스로 분할하고, 제3 서브 매트릭스 및 제4 서브 매트릭스를 결합하여 제2 매트릭스를 획득할 수 있다.
여기서, 테스트 데이터에 기초하여 제2 매트릭스를 포함하는 인공지능 모델의 제2 정확도를 획득하는 단계 및 제2 정확도가 기설정된 값을 기준으로 기설정된 범위를 벗어나면 제1 서브 매트릭스 및 제2 서브 매트릭스를 인공지능 모델에 포함된 매트릭스의 최종 매트릭스로 결정할 수 있다.
또는, 제1 정확도가 기설정된 값을 기준으로 기설정된 범위를 벗어나면 제1 랭크 값보다 큰 제2 랭크 값에 기초한 SVD를 통해 매트릭스를 제1 서브 매트릭스 및 제2 서브 매트릭스로 재분할하는 단계 및 제1 서브 매트릭스 및 제2 서브 매트릭스를 결합하여 제1 매트릭스를 재획득하는 단계를 더 포함할 수 있다.
이상과 같은 본 개시의 다양한 실시 예에 따르면, 전자 장치는 정확도(accuracy)가 유지되는 동안 인공지능 모델의 데이터 용량을 축소하는 방법을 반복 적용하여, 인공지능 모델의 성능을 유지하면서도 인공지능 모델의 데이터 용량을 최소화할 수 있다.
한편, 이상에서는 인공지능 모델에 포함된 하나의 매트릭스를 이용하는 것으로 설명하였으나, 이상에서 설명한 방법은 인공지능 모델에 포함된 복수의 매트릭스에 각각 적용될 수도 있다.
한편, 본 개시의 일시 예에 따르면, 이상에서 설명된 다양한 실시 예들은 기기(machine)(예: 컴퓨터)로 읽을 수 있는 저장 매체(machine-readable storage media)에 저장된 명령어를 포함하는 소프트웨어로 구현될 수 있다. 기기는, 저장 매체로부터 저장된 명령어를 호출하고, 호출된 명령어에 따라 동작이 가능한 장치로서, 개시된 실시 예들에 따른 전자 장치(예: 전자 장치(A))를 포함할 수 있다. 명령이 프로세서에 의해 실행될 경우, 프로세서가 직접, 또는 프로세서의 제어 하에 다른 구성요소들을 이용하여 명령에 해당하는 기능을 수행할 수 있다. 명령은 컴파일러 또는 인터프리터에 의해 생성 또는 실행되는 코드를 포함할 수 있다. 기기로 읽을 수 있는 저장매체는, 비일시적(non-transitory) 저장매체의 형태로 제공될 수 있다. 여기서, '비일시적'은 저장매체가 신호(signal)를 포함하지 않으며 실재(tangible)한다는 것을 의미할 뿐 데이터가 저장매체에 반영구적 또는 임시적으로 저장됨을 구분하지 않는다.
또한, 본 개시의 일 실시 예에 따르면, 이상에서 설명된 다양한 실시 예들에 따른 방법은 컴퓨터 프로그램 제품(computer program product)에 포함되어 제공될 수 있다. 컴퓨터 프로그램 제품은 상품으로서 판매자 및 구매자 간에 거래될 수 있다. 컴퓨터 프로그램 제품은 기기로 읽을 수 있는 저장 매체(예: compact disc read only memory (CD-ROM))의 형태로, 또는 어플리케이션 스토어(예: 플레이 스토어TM)를 통해 온라인으로 배포될 수 있다. 온라인 배포의 경우에, 컴퓨터 프로그램 제품의 적어도 일부는 제조사의 서버, 어플리케이션 스토어의 서버, 또는 중계 서버의 메모리와 같은 저장 매체에 적어도 일시 저장되거나, 임시적으로 생성될 수 있다.
또한, 본 개시의 일 실시 예에 따르면, 이상에서 설명된 다양한 실시 예들은 소프트웨어(software), 하드웨어(hardware) 또는 이들의 조합을 이용하여 컴퓨터(computer) 또는 이와 유사한 장치로 읽을 수 있는 기록 매체 내에서 구현될 수 있다. 일부 경우에 있어 본 명세서에서 설명되는 실시 예들이 프로세서 자체로 구현될 수 있다. 소프트웨어적인 구현에 의하면, 본 명세서에서 설명되는 절차 및 기능과 같은 실시 예들은 별도의 소프트웨어 모듈들로 구현될 수 있다. 소프트웨어 모듈들 각각은 본 명세서에서 설명되는 하나 이상의 기능 및 동작을 수행할 수 있다.
한편, 상술한 다양한 실시 예들에 따른 기기의 프로세싱 동작을 수행하기 위한 컴퓨터 명령어(computer instructions)는 비일시적 컴퓨터 판독 가능 매체(non-transitory computer-readable medium)에 저장될 수 있다. 이러한 비일시적 컴퓨터 판독 가능 매체에 저장된 컴퓨터 명령어는 특정 기기의 프로세서에 의해 실행되었을 때 상술한 다양한 실시 예에 따른 기기에서의 처리 동작을 특정 기기가 수행하도록 한다. 비일시적 컴퓨터 판독 가능 매체란 레지스터, 캐쉬, 메모리 등과 같이 짧은 순간 동안 데이터를 저장하는 매체가 아니라 반영구적으로 데이터를 저장하며, 기기에 의해 판독(reading)이 가능한 매체를 의미한다. 비일시적 컴퓨터 판독 가능 매체의 구체적인 예로는, CD, DVD, 하드 디스크, 블루레이 디스크, USB, 메모리카드, ROM 등이 있을 수 있다.
또한, 상술한 다양한 실시 예들에 따른 구성 요소(예: 모듈 또는 프로그램) 각각은 단수 또는 복수의 개체로 구성될 수 있으며, 전술한 해당 서브 구성 요소들 중 일부 서브 구성 요소가 생략되거나, 또는 다른 서브 구성 요소가 다양한 실시 예에 더 포함될 수 있다. 대체적으로 또는 추가적으로, 일부 구성 요소들(예: 모듈 또는 프로그램)은 하나의 개체로 통합되어, 통합되기 이전의 각각의 해당 구성 요소에 의해 수행되는 기능을 동일 또는 유사하게 수행할 수 있다. 다양한 실시예들에 따른, 모듈, 프로그램 또는 다른 구성 요소에 의해 수행되는 동작들은 순차적, 병렬적, 반복적 또는 휴리스틱하게 실행되거나, 적어도 일부 동작이 다른 순서로 실행되거나, 생략되거나, 또는 다른 동작이 추가될 수 있다.
이상에서는 본 개시의 바람직한 실시 예에 대하여 도시하고 설명하였지만, 본 개시는 상술한 특정의 실시 예에 한정되지 아니하며, 청구범위에서 청구하는 본 개시의 요지를 벗어남이 없이 당해 개시에 속하는 기술분야에서 통상의 지식을 가진 자에 의해 다양한 변형실시가 가능한 것은 물론이고, 이러한 변형실시들은 본 개시의 기술적 사상이나 전망으로부터 개별적으로 이해되어져서는 안될 것이다.

Claims (15)

  1. 샘플 데이터 및 상기 샘플 데이터에 기초하여 트레이닝(training)된 인공지능 모델에 포함된 매트릭스가 저장된 스토리지; 및
    상기 매트릭스에 포함된 복수의 엘리먼트의 크기에 기초하여 제1 비율에 해당하는 개수의 엘리먼트의 값을 제로 값으로 변환하여 프루닝(pruning)된 제1 매트릭스를 획득하고,
    테스트 데이터에 기초하여 상기 제1 매트릭스를 포함하는 인공지능 모델의 제1 정확도를 획득하며,
    상기 제1 정확도가 기설정된 값을 기준으로 기설정된 범위 이내이면 상기 샘플 데이터에 기초하여 상기 제1 매트릭스를 포함하는 인공지능 모델을 리트레이닝(retraining)하고,
    상기 리트레이닝된 제1 매트릭스에 포함된 복수의 엘리먼트의 크기에 기초하여 상기 제1 비율보다 큰 제2 비율에 해당하는 개수의 엘리먼트의 값을 제로 값으로 변환하여 프루닝된 제2 매트릭스를 획득하는 프로세서;를 포함하는 전자 장치.
  2. 제1항에 있어서,
    상기 프로세서는,
    상기 매트릭스에 포함된 복수의 엘리먼트의 절대값의 크기가 작은 순으로 상기 제1 비율에 해당하는 개수의 엘리먼트를 식별하고,
    상기 리트레이닝된 제1 매트릭스에 포함된 복수의 엘리먼트의 절대값의 크기가 작은 순으로 상기 제2 비율에 해당하는 개수의 엘리먼트를 식별하는, 전자 장치.
  3. 제1항에 있어서,
    상기 프로세서는,
    상기 테스트 데이터에 기초하여 상기 제2 매트릭스를 포함하는 인공지능 모델의 제2 정확도를 획득하며,
    상기 제2 정확도가 상기 기설정된 값을 기준으로 상기 기설정된 범위 이내이면 상기 샘플 데이터에 기초하여 상기 제2 매트릭스를 포함하는 인공지능 모델을 리트레이닝하고,
    상기 리트레이닝된 제2 매트릭스에 포함된 복수의 엘리먼트의 크기에 기초하여 상기 제2 비율보다 큰 제3 비율에 해당하는 개수의 엘리먼트의 값을 제로 값으로 변환하여 프루닝된 제3 매트릭스를 획득하는, 전자 장치.
  4. 제3항에 있어서,
    상기 프로세서는,
    상기 테스트 데이터에 기초하여 상기 제3 매트릭스를 포함하는 인공지능 모델의 제3 정확도를 획득하고,
    상기 제3 정확도가 상기 기설정된 값을 기준으로 상기 기설정된 범위를 벗어나면 상기 제2 매트릭스를 상기 인공지능 모델에 포함된 상기 매트릭스의 최종 매트릭스로 결정하는, 전자 장치.
  5. 제3항에 있어서,
    상기 프로세서는,
    상기 제3 매트릭스에 적용된 프루닝 횟수가 기설정된 횟수이면, 상기 제3 매트릭스를 상기 인공지능 모델에 포함된 상기 매트릭스의 최종 매트릭스로 결정하는, 전자 장치.
  6. 제1항에 있어서,
    상기 프로세서는,
    상기 제1 정확도가 상기 기설정된 값을 기준으로 상기 기설정된 범위를 벗어나면 상기 매트릭스에 포함된 복수의 엘리먼트의 크기에 기초하여 상기 제1 비율보다 작은 비율에 해당하는 개수의 엘리먼트의 값을 제로 값으로 변환하여 리프루닝(re-pruning)된 제1 매트릭스를 획득하는, 전자 장치.
  7. 제1항에 있어서,
    상기 기설정된 값은,
    상기 테스트 데이터에 기초하여 상기 매트릭스를 포함하는 인공지능 모델의 정확도에 기초하여 획득된, 전자 장치.
  8. 제1항에 있어서,
    상기 프로세서는,
    상기 제1 비율에 기초한 프루닝 동작 대신, 제1 랭크(rank) 값에 기초한 SVD(singular value decomposition)를 통해 상기 매트릭스를 제1 서브 매트릭스 및 제2 서브 매트릭스로 분할하고, 상기 제1 서브 매트릭스 및 상기 제2 서브 매트릭스를 결합하여 상기 제1 매트릭스를 획득하며,
    상기 제2 비율에 기초한 프루닝 동작 대신, 상기 제1 랭크 값보다 작은 제2 랭크 값에 기초한 SVD를 통해 상기 리트레이닝된 제1 매트릭스를 제3 서브 매트릭스 및 제4 서브 매트릭스로 분할하고, 상기 제3 서브 매트릭스 및 상기 제4 서브 매트릭스를 결합하여 상기 제2 매트릭스를 획득하는, 전자 장치.
  9. 제8항에 있어서,
    상기 프로세서는,
    상기 테스트 데이터에 기초하여 상기 제2 매트릭스를 포함하는 인공지능 모델의 제2 정확도를 획득하고,
    상기 제2 정확도가 상기 기설정된 값을 기준으로 상기 기설정된 범위를 벗어나면 상기 제1 서브 매트릭스 및 상기 제2 서브 매트릭스를 상기 인공지능 모델에 포함된 상기 매트릭스의 최종 매트릭스로 결정하는, 전자 장치.
  10. 제8항에 있어서,
    상기 프로세서는,
    상기 제1 정확도가 상기 기설정된 값을 기준으로 상기 기설정된 범위를 벗어나면 상기 제1 랭크 값보다 큰 제2 랭크 값에 기초한 SVD를 통해 상기 매트릭스를 상기 제1 서브 매트릭스 및 상기 제2 서브 매트릭스로 재분할하고, 상기 제1 서브 매트릭스 및 상기 제2 서브 매트릭스를 결합하여 상기 제1 매트릭스를 재획득하는, 전자 장치.
  11. 샘플 데이터 및 상기 샘플 데이터에 기초하여 트레이닝(training)된 인공지능 모델에 포함된 매트릭스가 저장된 전자 장치의 제어 방법에 있어서,
    상기 매트릭스에 포함된 복수의 엘리먼트의 크기에 기초하여 제1 비율에 해당하는 개수의 엘리먼트의 값을 제로 값으로 변환하여 프루닝(pruning)된 제1 매트릭스를 획득하는 단계;
    테스트 데이터에 기초하여 상기 제1 매트릭스를 포함하는 인공지능 모델의 제1 정확도를 획득하는 단계;
    상기 제1 정확도가 기설정된 값을 기준으로 기설정된 범위 이내이면 상기 샘플 데이터에 기초하여 상기 제1 매트릭스를 포함하는 인공지능 모델을 리트레이닝(retraining)하는 단계; 및
    상기 리트레이닝된 제1 매트릭스에 포함된 복수의 엘리먼트의 크기에 기초하여 상기 제1 비율보다 큰 제2 비율에 해당하는 개수의 엘리먼트의 값을 제로 값으로 변환하여 프루닝된 제2 매트릭스를 획득하는 단계;를 포함하는 제어 방법.
  12. 제11항에 있어서,
    상기 제1 매트릭스를 획득하는 단계는,
    상기 매트릭스에 포함된 복수의 엘리먼트의 절대값의 크기가 작은 순으로 상기 제1 비율에 해당하는 개수의 엘리먼트를 식별하고,
    상기 제2 매트릭스를 획득하는 단계는,
    상기 리트레이닝된 제1 매트릭스에 포함된 복수의 엘리먼트의 절대값의 크기가 작은 순으로 상기 제2 비율에 해당하는 개수의 엘리먼트를 식별하는, 제어 방법.
  13. 제11항에 있어서,
    상기 테스트 데이터에 기초하여 상기 제2 매트릭스를 포함하는 인공지능 모델의 제2 정확도를 획득하는 단계;
    상기 제2 정확도가 상기 기설정된 값을 기준으로 상기 기설정된 범위 이내이면 상기 샘플 데이터에 기초하여 상기 제2 매트릭스를 포함하는 인공지능 모델을 리트레이닝하는 단계; 및
    상기 리트레이닝된 제2 매트릭스에 포함된 복수의 엘리먼트의 크기에 기초하여 상기 제2 비율보다 큰 제3 비율에 해당하는 개수의 엘리먼트의 값을 제로 값으로 변환하여 프루닝된 제3 매트릭스를 획득하는 단계;를 더 포함하는, 제어 방법.
  14. 제13항에 있어서,
    상기 테스트 데이터에 기초하여 상기 제3 매트릭스를 포함하는 인공지능 모델의 제3 정확도를 획득하는 단계; 및
    상기 제3 정확도가 상기 기설정된 값을 기준으로 상기 기설정된 범위를 벗어나면 상기 제2 매트릭스를 상기 인공지능 모델에 포함된 상기 매트릭스의 최종 매트릭스로 결정하는 단계;를 더 포함하는, 제어 방법.
  15. 제13항에 있어서,
    상기 제3 매트릭스에 적용된 프루닝 횟수가 기설정된 횟수이면, 상기 제3 매트릭스를 상기 인공지능 모델에 포함된 상기 매트릭스의 최종 매트릭스로 결정하는 단계;를 더 포함하는, 제어 방법.
PCT/KR2019/005603 2018-08-28 2019-05-10 전자 장치 및 그 제어 방법 WO2020045794A1 (ko)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US17/258,617 US20210279589A1 (en) 2018-08-28 2019-05-10 Electronic device and control method thereof

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR1020180101592A KR20200027080A (ko) 2018-08-28 2018-08-28 전자 장치 및 그 제어 방법
KR10-2018-0101592 2018-08-28

Publications (1)

Publication Number Publication Date
WO2020045794A1 true WO2020045794A1 (ko) 2020-03-05

Family

ID=69642975

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2019/005603 WO2020045794A1 (ko) 2018-08-28 2019-05-10 전자 장치 및 그 제어 방법

Country Status (3)

Country Link
US (1) US20210279589A1 (ko)
KR (1) KR20200027080A (ko)
WO (1) WO2020045794A1 (ko)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20200027085A (ko) * 2018-08-30 2020-03-12 삼성전자주식회사 전자 장치 및 그 제어 방법
KR20210136706A (ko) * 2020-05-08 2021-11-17 삼성전자주식회사 전자 장치 및 이의 제어 방법
DE102020213057A1 (de) * 2020-10-15 2022-04-21 Volkswagen Aktiengesellschaft Verfahren und Vorrichtung zum Überprüfen eines beim teilautomatisierten oder vollautomatisierten Steuern eines Fahrzeugs verwendeten KI-basierten Informationsverarbeitungssystems

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150255061A1 (en) * 2014-03-07 2015-09-10 Microsoft Corporation Low-footprint adaptation and personalization for a deep neural network
US9400955B2 (en) * 2013-12-13 2016-07-26 Amazon Technologies, Inc. Reducing dynamic range of low-rank decomposition matrices
CN107368891A (zh) * 2017-05-27 2017-11-21 深圳市深网视界科技有限公司 一种深度学习模型的压缩方法和装置
US20170337471A1 (en) * 2016-05-18 2017-11-23 Nec Laboratories America, Inc. Passive pruning of filters in a convolutional neural network
US20180046915A1 (en) * 2016-08-12 2018-02-15 Beijing Deephi Intelligence Technology Co., Ltd. Compression of deep neural networks with proper use of mask

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11429849B2 (en) * 2018-05-11 2022-08-30 Intel Corporation Deep compressed network

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9400955B2 (en) * 2013-12-13 2016-07-26 Amazon Technologies, Inc. Reducing dynamic range of low-rank decomposition matrices
US20150255061A1 (en) * 2014-03-07 2015-09-10 Microsoft Corporation Low-footprint adaptation and personalization for a deep neural network
US20170337471A1 (en) * 2016-05-18 2017-11-23 Nec Laboratories America, Inc. Passive pruning of filters in a convolutional neural network
US20180046915A1 (en) * 2016-08-12 2018-02-15 Beijing Deephi Intelligence Technology Co., Ltd. Compression of deep neural networks with proper use of mask
CN107368891A (zh) * 2017-05-27 2017-11-21 深圳市深网视界科技有限公司 一种深度学习模型的压缩方法和装置

Also Published As

Publication number Publication date
KR20200027080A (ko) 2020-03-12
US20210279589A1 (en) 2021-09-09

Similar Documents

Publication Publication Date Title
WO2018164378A1 (en) Electronic apparatus for compressing language model, electronic apparatus for providing recommendation word and operation methods thereof
WO2019164232A1 (ko) 전자 장치, 이의 영상 처리 방법 및 컴퓨터 판독가능 기록 매체
WO2019182346A1 (ko) 인공지능 모델을 이용하여 사용자 음성을 변조하기 위한 전자 장치 및 이의 제어 방법
WO2019172546A1 (en) Electronic apparatus and control method thereof
WO2020045794A1 (ko) 전자 장치 및 그 제어 방법
EP3577571A1 (en) Electronic apparatus for compressing language model, electronic apparatus for providing recommendation word and operation methods thereof
WO2021225256A1 (ko) 전자 장치 및 이의 제어 방법
AU2018319215B2 (en) Electronic apparatus and control method thereof
WO2020017898A1 (en) Electronic apparatus and control method thereof
WO2019143227A1 (en) Electronic device providing text-related image and method for operating the same
WO2019245186A1 (ko) 전자 장치 및 그의 제어 방법
WO2021101134A1 (en) Electronic apparatus and control method thereof
WO2020091519A1 (en) Electronic apparatus and controlling method thereof
WO2019231130A1 (ko) 전자 장치 및 그의 제어방법
WO2020096255A1 (en) Electronic apparatus and control method thereof
EP3867824A1 (en) Electronic apparatus and control method thereof
WO2018097439A1 (ko) 발화의 문맥을 공유하여 번역을 수행하는 전자 장치 및 그 동작 방법
WO2019164144A1 (ko) 전자 장치 및 이의 자연어 생성 방법
EP3744008A1 (en) Electronic apparatus for compression and decompression of data and compression method thereof
WO2019216514A1 (en) Electronic apparatus for compression and decompression of data and compression method thereof
WO2019190171A1 (ko) 전자 장치 및 그 제어 방법
WO2021075758A1 (en) Electronic apparatus and controlling method thereof
WO2020166796A1 (ko) 전자 장치 및 그 제어 방법
WO2020149493A1 (ko) 전자 장치 및 이의 제어 방법
WO2019231068A1 (en) Electronic device and control method thereof

Legal Events

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

Ref document number: 19855429

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19855429

Country of ref document: EP

Kind code of ref document: A1