[go: up one dir, main page]

TWI794910B - Memory and training method for neutral network based on memory - Google Patents

Memory and training method for neutral network based on memory Download PDF

Info

Publication number
TWI794910B
TWI794910B TW110127884A TW110127884A TWI794910B TW I794910 B TWI794910 B TW I794910B TW 110127884 A TW110127884 A TW 110127884A TW 110127884 A TW110127884 A TW 110127884A TW I794910 B TWI794910 B TW I794910B
Authority
TW
Taiwan
Prior art keywords
training
memory
neural network
influencing factors
synapses
Prior art date
Application number
TW110127884A
Other languages
Chinese (zh)
Other versions
TW202305672A (en
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 TW110127884A priority Critical patent/TWI794910B/en
Publication of TW202305672A publication Critical patent/TW202305672A/en
Application granted granted Critical
Publication of TWI794910B publication Critical patent/TWI794910B/en

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Semiconductor Memories (AREA)

Abstract

The present invention discloses a memory and a training method for neutral network based on memory. The training method includes: obtaining one or more transfer functions of a memory corresponding to one or more influence factors; determining a training plan according to an ideal case and the one or more influence factors; training the neutral network according to the training plan and the one or more transfer functions to obtain a plurality of weights of the trained neutral network; and programming the memory according to the weights.

Description

記憶體及用於基於記憶體的類神經網路的訓練方法Memory and training method for memory-based neural network

本發明是有關於一種記憶體及用於基於記憶體的類神經網路的訓練方法。The invention relates to a memory and a training method for a neural network based on the memory.

類神經網路是一種可用於機器學習的數學模型。過去,類神經網路是在計算機裝置上以軟體的方式建立數學模型,並藉由處理器根據數學模型進行運算。隨著對運算速度的要求提高,使用具有高速運算能力的記憶體來實現類神經網路也成為研究的重點。這種方式稱之為記憶體內計算(computing in memory)。雖然記憶體內計算有許多優點,但由於記憶體具備的特性,例如受到溫度、讀寫次數等的影響,記憶胞的輸入與輸出之間的關係通常不是理想中的線性。如何降低非理想的記憶體對根據記憶體內計算得到的結果所做的決策正確性產生的不良影響是一個重要的課題。A neural network is a mathematical model that can be used for machine learning. In the past, the neural network is to establish a mathematical model in the form of software on a computer device, and use the processor to perform calculations based on the mathematical model. As the requirements for computing speed increase, the use of memory with high-speed computing capabilities to implement neural networks has become the focus of research. This approach is called computing in memory. Although in-memory computing has many advantages, due to the characteristics of memory, such as being affected by temperature, read and write times, etc., the relationship between the input and output of memory cells is usually not ideally linear. How to reduce the adverse effect of non-ideal memory on the correctness of decision-making based on the results calculated in memory is an important issue.

本發明一實施例係揭露一種用於基於記憶體的類神經網路的訓練方法。訓練方法包括:取得一記憶體的對應於一或多個影響因子的一或多個轉換函數;根據一理想狀況及該一或多個影響因子決定一訓練計畫;根據該訓練計畫及該一或多個轉換函數,對該類神經網路進行訓練,以得到經過訓練的該類神經網路的複數個權重;以及根據該些權重編程該記憶體。An embodiment of the present invention discloses a training method for a memory-based neural network. The training method includes: obtaining one or more conversion functions corresponding to one or more influencing factors of a memory; determining a training plan according to an ideal situation and the one or more influencing factors; according to the training plan and the One or more transformation functions for training the type of neural network to obtain a plurality of weights of the type of trained neural network; and programming the memory according to the weights.

本發明另一實施例係揭露一種記憶體。記憶體包括複數個記憶胞,用以代表一類神經網路的複數個突觸。各該記憶胞包括一電阻器。該些電阻器的電阻值係根據以下方式決定:取得該些記憶胞的對應於一或多個影響因子的一或多個轉換函數;根據一理想狀況及該一或多個影響因子決定一訓練計畫;根據該訓練計畫及該一或多個轉換函數,對該類神經網路進行訓練,以得到經過訓練的該類神經網路的該些突觸的複數個權重;以及根據該些權重決定該些記憶體胞的該些電阻器的電阻值。Another embodiment of the present invention discloses a memory. The memory includes a plurality of memory cells to represent a plurality of synapses of a type of neural network. Each memory cell includes a resistor. The resistance values of the resistors are determined according to the following methods: obtain one or more transfer functions corresponding to one or more influencing factors of the memory cells; determine a training according to an ideal situation and the one or more influencing factors program; according to the training program and the one or more transfer functions, the type of neural network is trained to obtain a plurality of weights of the synapses of the trained type of neural network; and according to the The weight determines the resistance values of the resistors of the memory cells.

為了對本發明之上述及其他方面有更佳的瞭解,下文特舉實施例,並配合所附圖式詳細說明如下:In order to have a better understanding of the above-mentioned and other aspects of the present invention, the following specific examples are given in detail with the accompanying drawings as follows:

請參照第1圖,第1圖繪示運算記憶體的示意圖。運算記憶體10包括多條字元線WL1~WL3、多條位元線BL1~BL3及多個記憶胞C11~C33。各記憶胞C11~C33耦接至一條對應的字元線及一條對應的位元線。記憶胞C11~C33可分別包括一可變電阻器,電阻值分別為R11~R33。在一實施例中,可變電阻器可藉由一電晶體來實現。運算記憶體10可通過記憶體內運算實現一類神經網路的乘加(sum of product)。運算記憶體10的操作原理詳述如下。Please refer to Figure 1, which shows a schematic diagram of an operational memory. The operation memory 10 includes a plurality of word lines WL1-WL3, a plurality of bit lines BL1-BL3, and a plurality of memory cells C11-C33. Each memory cell C11-C33 is coupled to a corresponding word line and a corresponding bit line. The memory cells C11-C33 may respectively include a variable resistor, and the resistance values are R11-R33 respectively. In one embodiment, the variable resistor can be realized by a transistor. The operation memory 10 can realize a type of multiplication and addition (sum of product) of a neural network through operations in the memory. The operation principle of the computing memory 10 is described in detail as follows.

記憶胞C11~C33可用以代表類神經網路中的突觸。記憶胞C11~C33的可變電阻器的電阻值R11~R33或電導值(即電阻值的倒數)可用以代表突觸的權重。字元線WL1~WL3的輸入電壓V1~V3可用以代表輸入資料。位元線BL1~BL3的輸出電流I1~I3分別為:I1=V1*1/R11+V2*1/R21+V3*1/R31,I2=V1*1/R12+V2*1/R22+V3*1/R32,I3=V1*1/R13+V2*1/R23+V3*1/R33。電流I1~I3代表輸入資料經過類神經網路運算後的結果。電流I1~I3可被送入一決策電路(未繪出)進行後續的運算以產生一決策。Memory cells C11~C33 can be used to represent synapses in a neural network. The resistance values R11-R33 or conductance values (ie the reciprocal of the resistance value) of the variable resistors of the memory cells C11-C33 can be used to represent the weight of the synapse. The input voltages V1-V3 of the word lines WL1-WL3 can be used to represent input data. The output currents I1~I3 of the bit lines BL1~BL3 are respectively: I1=V1*1/R11+V2*1/R21+V3*1/R31, I2=V1*1/R12+V2*1/R22+V3 *1/R32, I3=V1*1/R13+V2*1/R23+V3*1/R33. The currents I1~I3 represent the results of the input data after the neural network-like operation. The currents I1 - I3 can be sent to a decision circuit (not shown) for subsequent operations to generate a decision.

需要說明的是,第1圖的例子為了方便說明而進行簡化。在實際的應用中,運算記憶體的記憶胞數量通常是很龐大的,且運算記憶體的架構也會隨著所要實現的類神經網路而有所變化。It should be noted that the example in FIG. 1 is simplified for convenience of description. In practical applications, the number of memory cells of the computing memory is usually very large, and the architecture of the computing memory will also vary with the neural network to be implemented.

為了提高決策的準確性,通常需要對類神經網路進行訓練。例如,將訓練資料輸入至類神經網路進行運算,根據類神經網路的運算結果產生決策,將決策與對應於訓練資料的解答(ground truth)進行比較,並根據比較結果對類神經網路中的權重進行調整。現行針對基於記憶體的類神經網路有兩種訓練方式:(1) 以計算機裝置配合軟體根據類神經網路的理想數學模型進行訓練,以及(2) 在記憶體上實際進行訓練。然而,方式(1)未考慮到記憶體的非理想特性,方式(2)未考慮到理想的數學模型。兩種方式訓練出的類神經網路運行在記憶體上都會使得後續產生的決策正確性不足。為了解決上述問題,本發明提出一種用於基於記憶體的類神經網路的訓練方法。In order to improve the accuracy of decision-making, it is usually necessary to train the quasi-neural network. For example, input the training data into the neural network for calculation, generate a decision based on the calculation result of the neural network, compare the decision with the answer (ground truth) corresponding to the training data, and compare the neural network based on the comparison result. Adjust the weights in . There are currently two training methods for memory-based neural networks: (1) using computer devices and software to train according to the ideal mathematical model of neural networks, and (2) actually training on memory. However, method (1) does not take into account the non-ideal characteristics of the memory, and method (2) does not take into account the ideal mathematical model. The neural network trained by the two methods runs on the memory, which will make the subsequent decision-making accuracy insufficient. In order to solve the above problems, the present invention proposes a training method for memory-based neural network.

請參照第2圖,第2圖繪示根據本發明一實施例的訓練方法的流程圖。本訓練方法可應用在基於記憶體的類神經網路。Please refer to FIG. 2 , which is a flow chart of a training method according to an embodiment of the present invention. This training method can be applied to memory-based neural networks.

在步驟S201中,取得對應於一類神經網路的一記憶體的對應於一或多個影響因子的一或多個轉換函數。對應於類神經網路的記憶體代表的是該記憶體是做為硬體用以實現該類神經網路。轉換函數代表的是對應於影響因子,記憶體的記憶胞的輸入與輸出之間的關係。影響因子可包括不同的溫度、不同的讀寫次數、不同的輸入電壓、每次讀取操作時的變化、記憶保持能力及寫入誤差等。所謂記憶保持能力指的是資料儲存在記憶胞內的時間。所謂寫入值誤差指的是編程時寫入的實際值與理想值之間的差異。例如,影響因子可包括溫度攝氏40度、溫度攝氏50度、讀寫次數五千次、讀寫次數一萬次等。對於實際狀況下的記憶體,記憶胞所包括的元件例如電晶體及可變電阻器通常是非理想的。這種不理想會導致記憶胞的輸入電壓與輸出電流的比值會受到影響因子的影響而非定值。In step S201, one or more transfer functions corresponding to one or more influencing factors of a memory corresponding to a type of neural network are acquired. The memory corresponding to the neural network means that the memory is used as hardware to realize the neural network. The conversion function represents the relationship between the input and output of the memory cell of the memory corresponding to the impact factor. Influencing factors may include different temperatures, different read and write times, different input voltages, changes in each read operation, memory retention capability, and write error, etc. The so-called memory retention capacity refers to the time that information is stored in memory cells. The so-called written value error refers to the difference between the actual value written during programming and the ideal value. For example, the impact factor may include a temperature of 40 degrees Celsius, a temperature of 50 degrees Celsius, 5,000 times of reading and writing, and 10,000 times of reading and writing. For actual memory, elements such as transistors and variable resistors included in memory cells are usually not ideal. This imperfection will cause the ratio of the input voltage to the output current of the memory cell to be affected by the influencing factors rather than a fixed value.

請參照第3圖,第3圖顯示對應於一特定溫度的記憶胞的輸入電壓與輸出電流的關係。第3圖中,橫軸為記憶胞的輸入電壓,縱軸為記憶胞的輸出電流,多條曲線為不同的轉換函數,對應於針對記憶胞的多個所要編程的電阻值。在理想狀況中,特定的權重對應於特定的電阻值,權重不變電阻值就不應改變。也就是說,在理想狀況下輸入電壓與輸出電流之間的比值應為定值,即轉換函數應為直線。然而,實際的狀況(非理想狀況)下,輸入電壓與輸出電流的比值會隨著輸入電壓而改變。於是,從第3圖中可看出,實際狀況下的轉換函數並非直線。Please refer to FIG. 3, which shows the relationship between the input voltage and the output current of a memory cell corresponding to a specific temperature. In Fig. 3, the horizontal axis is the input voltage of the memory cell, the vertical axis is the output current of the memory cell, and the multiple curves are different transfer functions, corresponding to multiple resistance values to be programmed for the memory cell. In an ideal situation, a specific weight corresponds to a specific resistance value, and the resistance value should not change without changing the weight. That is to say, under ideal conditions, the ratio between the input voltage and the output current should be a constant value, that is, the transfer function should be a straight line. However, under actual conditions (non-ideal conditions), the ratio of input voltage to output current will vary with the input voltage. Therefore, it can be seen from Fig. 3 that the transfer function under actual conditions is not a straight line.

需要說明的是,轉換函數可以通過實際測試、根據歷史記錄及其它任何方式得到。本發明不予以限定。It should be noted that the conversion function can be obtained through actual testing, according to historical records, or in any other way. The present invention is not limited.

在步驟S203中,根據該一或多個影響因子及一理想狀況決定一訓練計畫。理想狀況代表的是記憶體不受任何影響因子影響而完全符合類神經網路的理想數學模型。換言之,理想狀況下,對於各個記憶胞而言,對應於特定電阻值的輸入電壓與輸出電流的比值為定值。在一實施例中,決定訓練計畫可包括步驟S401~S407,如第4圖所示。在步驟S401中,決定理想狀況或非理想狀況。決定為理想狀況時執行步驟S403,決定為非理想狀況時執行步驟S405。在步驟S403中,決定訓練次數,並更新訓練計畫。在步驟S405中,決定影響因子。也就是從眾多影響因子中選擇一個後執行步驟S403以決定針對該訓練因子的訓練次數。在步驟S407中,決定訓練計畫是否配置完成,若決定為否,回到步驟S401,若決定為是結束本流程。為了更容易理解,以下舉一實際例子做為說明。首先執行步驟S401及S403,以將理想情況及次數為五次加入至訓練計畫,接著回到步驟S401決定非理想情況,並執行步驟S405及S403決定影響因子為溫度攝氏40度及次數為十次並加入至訓練計畫,接著再回到步驟S401決定非理想狀況並執行步驟S405及S403決定影響因子為讀寫次數一萬次及次數為七次並加入至訓練計畫,之後結束本流程。如此可得到訓練計畫為:[(理想狀況,五次);(溫度攝氏40度,十次);(讀寫次數一萬次,七次)]。在一實施例中,可進一步對訓練計畫的內容進行排程。例如,前述例子中排程後的訓練計畫可為:[(理想狀況,二次);(溫度攝氏40度,五次);(理想狀況,一次);(讀寫次數一萬次,三次);(理想狀況,一次);(讀寫次數一萬次,四次);(理想狀況,一次);(溫度攝氏40度,五次)]。也就是說,針對理想狀況及不同影響因子的訓練可交錯進行,且針對相同影響因子的訓練不必需要接續著完成。針對不同影響因子穿插訓練可使類神經網路不會過於受特定的影響因子影響,從而使多個影響因子對類神經網路有較平均的貢獻。實際的訓練計畫可以根據記憶體的實際特性來適應性配置各個影響因子的出現頻率與訓練次數。例如,當記憶體對於溫度較為敏感,通過提高溫度的影響因子在訓練計畫中的頻率與訓練次數,可以使得經過訓練的類神經網路更善於應對溫度變化帶來的影響。In step S203, a training plan is determined according to the one or more influencing factors and an ideal situation. The ideal situation represents that the memory is not affected by any influencing factors and fully conforms to the ideal mathematical model of the neural network. In other words, ideally, for each memory cell, the ratio of the input voltage to the output current corresponding to a specific resistance value is constant. In one embodiment, determining the training plan may include steps S401-S407, as shown in FIG. 4 . In step S401, an ideal condition or an unideal condition is determined. Step S403 is executed when it is determined to be an ideal situation, and Step S405 is executed when it is determined to be an unideal situation. In step S403, the training times are determined, and the training plan is updated. In step S405, the influencing factor is determined. That is, step S403 is executed after one of the influencing factors is selected to determine the training times for the training factor. In step S407, it is determined whether the configuration of the training plan is completed, if the determination is no, return to step S401, if the determination is yes, the process ends. For easier understanding, a practical example is given below as an illustration. First execute steps S401 and S403 to add the ideal situation and the number of times to the training plan as five times, then return to step S401 to determine the non-ideal situation, and execute steps S405 and S403 to determine the influencing factor as the temperature of 40 degrees Celsius and the number of times as ten Then return to step S401 to determine the unsatisfactory situation and execute steps S405 and S403 to determine the impact factor is 10,000 reading and writing times and 7 times and add to the training plan, then end this book process. In this way, the training plan can be obtained as: [(ideal situation, five times); (temperature 40 degrees Celsius, ten times); (reading and writing times 10,000 times, seven times)]. In one embodiment, the content of the training plan can be further scheduled. For example, the training plan after scheduling in the aforementioned example can be: [(ideal condition, twice); (temperature 40 degrees Celsius, five times); (ideal condition, once); (reading and writing times 10,000 times, Three times); (ideal situation, one time); (10,000 reading and writing times, four times); (ideal situation, one time); (temperature 40 degrees Celsius, five times)]. That is to say, the training for ideal conditions and different influencing factors can be interleaved, and the training for the same influencing factor does not need to be completed consecutively. Interspersed training for different impact factors can prevent the neural network from being too affected by specific impact factors, so that multiple impact factors can contribute more evenly to the neural network. The actual training plan can adaptively configure the occurrence frequency and training times of each influencing factor according to the actual characteristics of the memory. For example, when the memory is more sensitive to temperature, by increasing the frequency and training times of the temperature-influencing factor in the training plan, the trained neural network can be better able to cope with the impact of temperature changes.

在步驟S205中,根據訓練計畫及與訓練計畫相關聯的轉換函數,以計算機裝置及軟體模擬對類神經網路進行訓練,以得到經過訓練的類神經網路的多個權重。模擬指的是以計算機裝置的處理器執行類神經網路的數學模型運算,並以軟體輔助模擬非理想狀況。所謂以軟體輔助模擬非理想狀況是指每次執行對應於影響因子的訓練時,針對類神經網路中的每一個突觸,根據對應於影響因子的轉換函數、該突觸對應的權重及輸入該突觸的輸入值調整輸出於該突觸的輸出值。在一實施例中,對類神經網路的訓練可根據訓練計畫依序執行。在另一實施例中,對類神經網路的訓練可根據訓練計畫以任意次序執行。一般而言,單次的訓練流程包括:輸入訓練資料至類神經網路;藉由類神經網路根據訓練資料計算以得到一或多個決策參數;根據決策參數產生一決策;根據決策與對應於訓練資料的一解答計算一分數;以及根據分數調整類神經網路的一或多個權重。由於訓練流程的細節已有許多現有技術,故在此不再多加描述。In step S205 , according to the training plan and the conversion function associated with the training plan, the neural network is trained with a computer device and software simulation, so as to obtain a plurality of weights of the trained neural network. Simulation refers to the execution of neural network-like mathematical model operations by the processor of a computer device, and the simulation of non-ideal conditions with software assistance. The so-called software-assisted simulation of non-ideal conditions means that each time the training corresponding to the impact factor is performed, for each synapse in the neural network, according to the conversion function corresponding to the impact factor, the weight corresponding to the synapse, and the input The input value of the synapse adjusts the output value of the synapse. In one embodiment, the training of the neural network can be performed sequentially according to the training plan. In another embodiment, the training of the neural network can be performed in any order according to the training plan. Generally speaking, a single training process includes: input training data into the neural network; obtain one or more decision parameters by calculating according to the training data through the neural network; generate a decision according to the decision parameters; calculating a score on a solution of the training data; and adjusting one or more weights of the neural network based on the score. Since there are many existing technologies for the details of the training process, no further description is given here.

在步驟S207中,根據權重編程記憶體的記憶胞,以得到用以實現類神經網路的記憶體(運算記憶體)。In step S207, the memory cells of the memory are programmed according to the weights to obtain a memory (operational memory) for realizing a neural network.

需要注意的是,任何適合的記憶體類型皆可應用本發明的訓練方法。例如相變化記憶體(phase-change memory,PCM)、鐵電隨機存取記憶體(Ferroelectronic RAM,FeRAM)等均能夠適用本發明提出的訓練方法。It should be noted that any suitable memory type can be applied to the training method of the present invention. For example, phase-change memory (phase-change memory, PCM), ferroelectric random access memory (Ferroelectronic RAM, FeRAM), etc. can all be applicable to the training method proposed by the present invention.

此外,根據上述訓練方法,本發明還提出一種記憶體。記憶體具有多個記憶胞。各該記憶胞包括一電阻器。該些記憶胞用以代表一類神經網路的多個突觸。該些記憶胞的該些電阻器的電阻值係根據藉由上述訓練方法得到的多個權重決定。In addition, according to the above training method, the present invention also proposes a memory. A memory has multiple memory cells. Each memory cell includes a resistor. These memory cells are used to represent multiple synapses of a type of neural network. The resistance values of the resistors of the memory cells are determined according to a plurality of weights obtained through the above training method.

請參照表一。表一中,ACCi為根據計算機裝置模擬理想狀況下的經過訓練的類神經網路進行運算所得到的決策的正確性,ACCn為根據用以實現訓練後的類神經網路的記憶體進行運算所得到的決策的正確性。由表一中可看出,在五次測試中,理想狀況的正確性與記憶體內運算的正確性差距皆在2%以內。這代表本發明提出的訓練方法能夠有效改善以記憶體實現類神經網路時因記憶體本身特性造成的後續決策正確性降低的問題。   ACCi ACCn |ACCi-ACCn|/ACCi 測試1 0.8756 0.8818 0.71% 測試2 0.8668 0.8735 0.77% 測試3 0.8683 0.8745 1.55% 測試4 0.8731 0.8651 0.78% 測試5 0.8585 0.8529 0.65% 表一 Please refer to Table 1. In Table 1, ACCi is the correctness of the decision obtained by simulating the trained neural network under ideal conditions according to the computer device, and ACCn is the correctness of the decision based on the memory used to realize the trained neural network. the correctness of the resulting decision. It can be seen from Table 1 that in the five tests, the gap between the correctness of the ideal situation and the correctness of the internal memory operation is within 2%. This means that the training method proposed by the present invention can effectively improve the problem that the correctness of subsequent decision-making is reduced due to the characteristics of the memory itself when the memory is used to implement the neural network. ACCi ACCn |ACCi-ACCn|/ACCi test 1 0.8756 0.8818 0.71% test 2 0.8668 0.8735 0.77% test 3 0.8683 0.8745 1.55% test 4 0.8731 0.8651 0.78% test 5 0.8585 0.8529 0.65% Table I

綜上所述,雖然本發明已以實施例揭露如上,然其並非用以限定本發明。本發明所屬技術領域中具有通常知識者,在不脫離本發明之精神和範圍內,當可作各種之更動與潤飾。因此,本發明之保護範圍當視後附之申請專利範圍所界定者為準。To sum up, although the present invention has been disclosed by the above embodiments, it is not intended to limit the present invention. Those skilled in the art of the present invention can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention should be defined by the scope of the appended patent application.

10:運算記憶體 C11~C33:記憶胞 WL1~WL3:字元線 BL1~BL3:位元線 S201~S207、S401~S407:步驟 10: Operational memory C11~C33: memory cells WL1~WL3: character line BL1~BL3: Bit lines S201~S207, S401~S407: steps

第1圖繪示運算記憶體的示意圖。 第2圖繪示根據本發明一實施例的訓練方法的流程圖。 第3圖繪示轉換函數的示意圖。 第4圖繪示根據本發明一實施例的決定訓練計畫的流程圖。 FIG. 1 shows a schematic diagram of an operational memory. FIG. 2 shows a flowchart of a training method according to an embodiment of the present invention. Fig. 3 shows a schematic diagram of the transfer function. FIG. 4 shows a flow chart of determining a training plan according to an embodiment of the present invention.

S201~S207:步驟S201~S207: steps

Claims (10)

一種用於基於記憶體的類神經網路的訓練方法,包括: 取得一記憶體的對應於一或多個影響因子的一或多個轉換函數; 根據一理想狀況及該一或多個影響因子決定一訓練計畫; 根據該訓練計畫及該一或多個轉換函數,對該類神經網路進行訓練,以得到經過訓練的該類神經網路的複數個權重;以及 根據該些權重編程該記憶體。 A training method for a memory-based neural network comprising: obtaining one or more transfer functions corresponding to one or more influencing factors of a memory; determining a training program according to an ideal situation and the one or more influencing factors; training the neural network according to the training plan and the one or more transformation functions to obtain a plurality of weights of the trained neural network; and The memory is programmed according to the weights. 如請求項1所述之訓練方法,其中該一或多個影響因子包括溫度、讀寫次數、輸入電壓、每次讀取操作的變化、記憶保持能力及寫入誤差。The training method as claimed in claim 1, wherein the one or more influencing factors include temperature, reading and writing times, input voltage, variation of each reading operation, memory retention capacity and writing error. 如請求項1所述之訓練方法,其中根據一理想狀況及該一或多個影響因子決定一訓練計畫包括: 決定該理想狀況的一第一訓練次數,並更新該訓練計畫; 從該一或多個影響因子選擇至少其中之一,決定對應於所選的各該一或多個影響因子的一第二訓練次數,並更新訓練計畫。 The training method as described in claim 1, wherein determining a training plan according to an ideal situation and the one or more influencing factors includes: Determine a first training times for the ideal situation, and update the training plan; Select at least one of the one or more influencing factors, determine a second training times corresponding to each of the selected one or more influencing factors, and update the training plan. 如請求項1所述之訓練方法,其中根據該訓練計畫及該一或多個轉換函數,對該類神經網路進行訓練,以得到經過訓練的該類神經網路的複數個權重中,執行針對決定的該影響因子的訓練時,係根據對應於決定的該影響因子的該一或多個轉換函數、該類神經網路的複數個突觸的複數個輸入、該些突觸的複數個待訓練的權重調整該些突觸的複數個輸出。The training method as described in Claim 1, wherein the neural network of this type is trained according to the training plan and the one or more transformation functions, so as to obtain the plurality of weights of the neural network of the trained type, The training for the influencing factor of the decision is performed according to the one or more transfer functions corresponding to the influencing factor of the decision, the plurality of inputs of the plurality of synapses of the neural network of the type, the plurality of synapses of the synapses The weights to be trained adjust the plural outputs of these synapses. 如請求項3所述之訓練方法,其中該訓練計畫中,對應於該理想狀況的訓練係穿插配置於對應於該一或多個影響因子的訓練之間。The training method according to claim 3, wherein in the training plan, the training corresponding to the ideal situation is interspersed with the training corresponding to the one or more influencing factors. 一種記憶體,包括: 複數個記憶胞,用以代表一類神經網路的複數個突觸,各該記憶胞包括一電阻器,該些電阻器的電阻值係根據以下方方式決定: 取得該些記憶胞的對應於一或多個影響因子的一或多個轉換函數; 根據一理想狀況及該一或多個影響因子決定一訓練計畫; 根據該訓練計畫及該一或多個轉換函數,對該類神經網路進行訓練,以得到經過訓練的該類神經網路的該些突觸的複數個權重;以及 根據該些權重決定該些記憶體胞的該些電阻器的電阻值。 A memory comprising: A plurality of memory cells are used to represent a plurality of synapses of a type of neural network, each of the memory cells includes a resistor, and the resistance value of the resistors is determined according to the following method: Obtain one or more transfer functions corresponding to one or more influencing factors of the memory cells; determining a training program according to an ideal situation and the one or more influencing factors; training the neural network according to the training plan and the one or more transfer functions to obtain a plurality of weights of the synapses of the trained neural network; and The resistance values of the resistors of the memory cells are determined according to the weights. 如請求項6所述之記憶體,其中該一或多個影響因子包括溫度、讀寫次數、輸入電壓、每次讀取的變化、記憶保持能力及寫入誤差。The memory according to claim 6, wherein the one or more influencing factors include temperature, read/write times, input voltage, variation per read, memory retention capability, and write error. 如請求項6所述之記憶體,其中根據一理想狀況及該一或多個影響因子決定一訓練計畫包括: 決定該理想狀況的一第一訓練次數,並更新該訓練計畫; 從該一或多個影響因子選擇至少其中之一,決定對應於所選的各該一或多個影響因子的一第二訓練次數,並更新訓練計畫。 The memory as described in claim 6, wherein determining a training plan according to an ideal situation and the one or more influencing factors includes: Determine a first training times for the ideal situation, and update the training plan; Select at least one of the one or more influencing factors, determine a second training times corresponding to each of the selected one or more influencing factors, and update the training plan. 如請求項6所述之記憶體,其中根據該訓練計畫及該一或多個轉換函數,對該類神經網路進行訓練,以得到經過訓練的該類神經網路的複數個權重中,執行針對決定的該影響因子的訓練時,係根據對應於決定的該影響因子的該一或多個轉換函數、該類神經網路的複數個突觸的複數個輸入、該些突觸的複數個待訓練的權重調整該些突觸的複數個輸出。The memory as described in claim 6, wherein the neural network of this type is trained according to the training plan and the one or more transformation functions, so that among the plurality of weights of the neural network after training, The training for the influencing factor of the decision is performed according to the one or more transfer functions corresponding to the influencing factor of the decision, the plurality of inputs of the plurality of synapses of the neural network of the type, the plurality of synapses of the synapses The weights to be trained adjust the plural outputs of these synapses. 如請求項8所述之記憶體,其中該訓練計畫中,對應於該理想狀況的訓練係穿插配置於對應於該一或多個影響因子的訓練之間。The memory according to claim 8, wherein in the training plan, the training corresponding to the ideal situation is interspersed with the training corresponding to the one or more influencing factors.
TW110127884A 2021-07-29 2021-07-29 Memory and training method for neutral network based on memory TWI794910B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW110127884A TWI794910B (en) 2021-07-29 2021-07-29 Memory and training method for neutral network based on memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW110127884A TWI794910B (en) 2021-07-29 2021-07-29 Memory and training method for neutral network based on memory

Publications (2)

Publication Number Publication Date
TW202305672A TW202305672A (en) 2023-02-01
TWI794910B true TWI794910B (en) 2023-03-01

Family

ID=86661407

Family Applications (1)

Application Number Title Priority Date Filing Date
TW110127884A TWI794910B (en) 2021-07-29 2021-07-29 Memory and training method for neutral network based on memory

Country Status (1)

Country Link
TW (1) TWI794910B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US12277968B2 (en) 2023-06-07 2025-04-15 Macronix International Co., Ltd. In-memory computation device
TWI857640B (en) * 2023-06-07 2024-10-01 旺宏電子股份有限公司 In-memory computation device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109901784A (en) * 2017-12-08 2019-06-18 群联电子股份有限公司 Data access method, memory control circuit unit, and memory storage device
US20200034686A1 (en) * 2018-07-24 2020-01-30 Sandisk Technologies Llc Differential non-volatile memory cell for artificial neural network
WO2020125839A1 (en) * 2018-12-18 2020-06-25 GRID INVENT gGmbH Electronic element and electrically controlled display element
TW202044126A (en) * 2019-05-22 2020-12-01 力旺電子股份有限公司 Control circuit for multiply accumulate circuit of neural network system
US20210103806A1 (en) * 2019-10-04 2021-04-08 Samsung Electronics Co., Ltd. Reinforcement learning pulse programming

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109901784A (en) * 2017-12-08 2019-06-18 群联电子股份有限公司 Data access method, memory control circuit unit, and memory storage device
US20200034686A1 (en) * 2018-07-24 2020-01-30 Sandisk Technologies Llc Differential non-volatile memory cell for artificial neural network
WO2020125839A1 (en) * 2018-12-18 2020-06-25 GRID INVENT gGmbH Electronic element and electrically controlled display element
TW202044126A (en) * 2019-05-22 2020-12-01 力旺電子股份有限公司 Control circuit for multiply accumulate circuit of neural network system
US20210103806A1 (en) * 2019-10-04 2021-04-08 Samsung Electronics Co., Ltd. Reinforcement learning pulse programming

Also Published As

Publication number Publication date
TW202305672A (en) 2023-02-01

Similar Documents

Publication Publication Date Title
CN113785290B (en) Memory device and method of controlling the same
TWI699711B (en) Memory devices and manufacturing method thereof
Fu et al. Mitigating nonlinear effect of memristive synaptic device for neuromorphic computing
TWI794910B (en) Memory and training method for neutral network based on memory
Huang et al. Efficient and optimized methods for alleviating the impacts of IR-drop and fault in RRAM based neural computing systems
US10340001B2 (en) Single-readout high-density memristor crossbar
Eldebiky et al. CorrectNet: Robustness enhancement of analog in-memory computing for neural networks by error suppression and compensation
CN115688899A (en) Memory and training method for neural network based on memory
Chiang et al. Hardware-robust in-rram-computing for object detection
CN117973473A (en) Calculation precision compensation architecture and method for deep learning and calculation integrated chip
CN117273109A (en) Construction method and device of hybrid neural network based on quantum neurons
US12046283B2 (en) Compute-in-memory array and module, and data computing method
US20210312272A1 (en) Neuromorphic circuit, neuromorphic array learning method, and program
Gi et al. Fundamental issues of implementing hardware neural networks using memristor
Deleu et al. Learning operations on a stack with Neural Turing Machines
US8676547B2 (en) Parameter extraction method
CN118690812A (en) Lightweight visual Transformer training optimization method, device and medium
US20230161557A1 (en) Compute-in-memory devices and methods of operating the same
Youn et al. Investigation on the worst read scenario of a ReRAM crossbar array
US20230229922A1 (en) Training method, operating method and memory system
CN116702837A (en) Deployment method and device of model
Zhao et al. Compensation architecture design utilizing residual resource to mitigate impacts of nonidealities in RRAM-based computing-in-memory chips
CN116151344B (en) Current compensation method and device for memristor array access resistor
Pallathuvalappil et al. Explainable model prediction of memristor
CN112801274B (en) Artificial intelligence processing device, weight parameter reading and writing method and device