CN114330688A - Model online migration training method, device and chip based on resistive random access memory - Google Patents

Model online migration training method, device and chip based on resistive random access memory Download PDF

Info

Publication number
CN114330688A
CN114330688A CN202111591016.0A CN202111591016A CN114330688A CN 114330688 A CN114330688 A CN 114330688A CN 202111591016 A CN202111591016 A CN 202111591016A CN 114330688 A CN114330688 A CN 114330688A
Authority
CN
China
Prior art keywords
conductance
neural network
random access
access memory
resistive random
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202111591016.0A
Other languages
Chinese (zh)
Inventor
施正
张涌
曹国忠
萧得富
张硕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen Semiconductor Industry Technology Research And Development Co ltd
Original Assignee
Xiamen Semiconductor Industry Technology Research And Development Co ltd
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 Xiamen Semiconductor Industry Technology Research And Development Co ltd filed Critical Xiamen Semiconductor Industry Technology Research And Development Co ltd
Priority to CN202111591016.0A priority Critical patent/CN114330688A/en
Publication of CN114330688A publication Critical patent/CN114330688A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Semiconductor Memories (AREA)

Abstract

The invention discloses a model online migration training method, a device and a chip based on a resistive random access memory. The method comprises the following steps: the neural network weight corresponding to each layer of the neural network model needing to be mapped onto the resistive random access memory is obtained based on an offline training process of the neural network model, and a conductance offset function of a plurality of conductances supported by the resistive random access memory is obtained, so that the neural network model is subjected to online migration training through iterative training according to the conductance offset function to update the neural network weight, and further, the memristor array conductance value is updated according to the updated neural network weight to obtain the trained resistive random access memory. Therefore, the neural network weight mapped to the array of the resistive random access memory has better adaptability, and the over-fitting problem of the traditional online training method for executing the migration training in a single time is effectively solved.

Description

Model online migration training method, device and chip based on resistive random access memory
Technical Field
The invention relates to the field of memory-computation-integrated chip design, in particular to a method, a device and a chip for model online migration training based on a resistive random access memory.
Background
In recent years, research and application of artificial intelligence has made a significant breakthrough. At present, a general purpose processor GPUGPU (graphic processing unit) and a special purpose processor TPU (tensor processor) have obvious effects on accelerating neural network training and reasoning. However, CMOS circuits consume a lot of energy to perform complex tasks and are less energy efficient. Compared with a CMOS) based complementary metal oxide semiconductor), the RRAM (resistive random access memory) chip has the advantages of on-chip weight storage, online learning, and scalability to a larger array. And the RRAM chip can quickly complete the neural network core calculation-matrix-vector multiplication, greatly improves the calculation energy efficiency, and is one of the key technologies for realizing a high-performance artificial intelligence chip in the future.
Currently, many researches have been made on reasoning and training aspects using the resistive memory. However, due to the fact that the memristor device has non-ideal characteristics, the non-ideal characteristics affect the process of performing online training on the basis of the resistive random access memory, and the model obtained through online training is low in accuracy.
Disclosure of Invention
In order to solve the above problems, embodiments of the present invention creatively provide a method, an apparatus, and a chip for model online migration training based on a resistive random access memory.
According to a first aspect of the present invention, a method for training model online migration based on a resistive random access memory is provided, where the method includes: acquiring neural network weights corresponding to each layer of a neural network model to be mapped to a resistive random access memory, wherein the neural network weights are obtained based on an offline training process of the neural network model; acquiring a conductance offset function of a plurality of conductances supported by the resistive random access memory; performing online migration training on the neural network model through iterative training according to the conductance offset function so as to update the neural network weight; and updating the memristor array conductance value of the resistive random access memory according to the updated neural network weight to obtain the trained resistive random access memory.
According to an embodiment of the present invention, the obtaining a conductance offset function of a plurality of conductances supported by the resistive random access memory includes: acquiring a conductance value of each conductance of a plurality of conductances supported by the resistive random access memory at set time intervals to determine a change curve of each conductance along with time; determining a conductance value probability density function of the conductance as a conductance offset function for the conductance from the variation curve.
According to an embodiment of the present invention, for each of a plurality of conductances supported by the resistive random access memory, collecting a conductance value of the conductance once at set intervals to determine a time-dependent change curve of each conductance, includes: configuring the conductance of the resistive random access memory as the minimum ideal conductance supported by the resistive random access memory, collecting the actual conductance value of the minimum ideal conductance once every set time, and recording the actual conductance value and time; under the condition that the actual conductance value acquisition times of the minimum ideal conductance reach set acquisition times, determining a change curve of the minimum conductance along with time according to the actual conductance value and time; configuring the conductance of the resistive random access memory into a second ideal conductance, wherein the value of the second ideal conductance is equal to an ideal conductance step length doubled on the basis of the minimum ideal conductance, and repeatedly executing the operation to determine a change curve of the second ideal conductance along with time; thus, the above operations are executed in a circulating mode until the conductance of the resistive random access memory is configured to be the maximum ideal conductance, the value of the maximum ideal conductance is equal to the ideal conductance step increased by N-1 times on the basis of the minimum ideal conductance, and the above operations are repeatedly executed to determine the change curve of the maximum ideal conductance along with the time; wherein N represents the number of conductances supported by the resistive memory; the ideal conductance step length is equal to the ratio of the difference value of the maximum ideal conductance and the minimum ideal conductance to the number of conductances supported by the resistive random access memory.
According to an embodiment of the present invention, performing online migration training on the neural network model through iterative training according to the conductance offset function to update the neural network weights includes: determining a current adjustment value that requires an adjustment to an output vector of a neural network layer of the neural network model based on a conductance offset function for a plurality of conductances; and updating the neural network weights of the plurality of neural network layers of the neural network model in sequence according to the sequence from the input layer to the output layer of the neural network layer and according to the current adjustment values of the plurality of neural network layers.
According to an embodiment of the present invention, updating the memristor array conductance value of the resistive random access memory according to the updated neural network weight to obtain a trained resistive random access memory includes: judging whether the output of the neural network model meets a set end condition or not according to the updated neural network weights of the plurality of neural network layers of the neural network model; under the condition that the output of the neural network model meets a set ending condition, ending the online migration training of the neural network model, and updating the memristor array conductance value of the resistive memory according to the updated neural network weights of the plurality of neural network layers of the neural network model.
According to an embodiment of the present invention, determining whether or not an output of the neural network model satisfies a set termination condition based on updated neural network weights of a plurality of neural network layers of the neural network model includes: according to the updated neural network weights of a plurality of neural network layers of the neural network model, judging the output precision of the neural network model obtained by the current round of online transfer training; and under the condition that the variance of the output precision of the neural network model obtained by the final set round of online transfer training is smaller than a set variance threshold, judging that the output of the neural network model meets a set end condition.
According to the second aspect of the present invention, there is also provided a model online migration training apparatus based on a resistive random access memory, the apparatus including: the initial model acquisition module is used for acquiring neural network weights corresponding to all layers of a neural network model to be mapped to the resistive random access memory, and the neural network weights are obtained based on an offline training process of the neural network model; the conductance offset acquisition module is used for acquiring a conductance offset function of a plurality of conductances supported by the resistive random access memory; the model training and updating module is used for carrying out online migration training on the neural network model through iterative training according to the conductance offset function so as to update the neural network weight; and the chip updating module is used for updating the memristor array conductance value of the resistive random access memory according to the updated neural network weight to obtain the trained resistive random access memory.
According to an embodiment of the present invention, the conductance offset obtaining module includes: the conductance time relation determining submodule is used for acquiring the conductance value of each conductance in a plurality of conductances supported by the resistance change type memory at set time intervals so as to determine a change curve of each conductance along with time; and the offset function determination submodule is used for determining a conductance value probability density function of the conductance according to the change curve, and the conductance value probability density function serves as a conductance offset function aiming at the conductance.
According to an embodiment of the present invention, the conductance time relationship determining submodule acquires, for each of a plurality of conductances supported by the resistive random access memory, a conductance value of the conductance at set intervals to determine a change curve of each conductance with time, and the conductance time relationship determining submodule includes: configuring the conductance of the resistive random access memory as the minimum ideal conductance supported by the resistive random access memory, collecting the actual conductance value of the minimum ideal conductance once every set time, and recording the actual conductance value and time; under the condition that the actual conductance value acquisition times of the minimum ideal conductance reach set acquisition times, determining a change curve of the minimum conductance along with time according to the actual conductance value and time; configuring the conductance of the resistive random access memory into a second ideal conductance, wherein the value of the second ideal conductance is equal to an ideal conductance step length doubled on the basis of the minimum ideal conductance, and repeatedly executing the operation to determine a change curve of the second ideal conductance along with time; thus, the above operations are executed in a circulating mode until the conductance of the resistive random access memory is configured to be the maximum ideal conductance, the value of the maximum ideal conductance is equal to the ideal conductance step increased by N-1 times on the basis of the minimum ideal conductance, and the above operations are repeatedly executed to determine the change curve of the maximum ideal conductance along with the time; wherein N represents the number of conductances supported by the resistive memory; the ideal conductance step length is equal to the ratio of the difference value of the maximum ideal conductance and the minimum ideal conductance to the number of conductances supported by the resistive random access memory.
According to the third aspect of the invention, a chip is further provided, and the chip includes the model online migration training device based on the resistive random access memory as described above.
The embodiment of the invention discloses a method, a device and a chip for model online migration training based on an impedance memory. The method comprises the steps of obtaining neural network weights corresponding to each layer of a neural network model to be mapped onto a resistive random access memory, wherein the neural network weights are obtained based on an offline training process of the neural network model, obtaining a conductance offset function of a plurality of conductances supported by the resistive random access memory, carrying out online migration training on the neural network model through iterative training according to the conductance offset function so as to update the neural network weights, and further updating memristor array conductance values of the resistive random access memory according to the updated neural network weights so as to obtain the trained resistive random access memory. Therefore, the conductance offset function of the neural network convolution layer weight conductance value changing along with the time is added in the iterative process of the migration training, so that the migration training on the resistive random access memory can learn the rule that the conductance value corresponding to the neural network weight changes along with the time, and the neural network can learn the offset characteristic of the conductance value of each conductance of the resistive random access memory, so that the neural network weight mapped to the array of the resistive random access memory has better adaptability, and the over-fitting problem of the traditional online training method for executing the migration training in the single time of the resistive random access memory is effectively solved.
It is to be understood that the teachings of the present invention need not achieve all of the above-described benefits, but rather that specific embodiments may achieve specific technical results, and that other embodiments of the present invention may achieve benefits not mentioned above.
Drawings
The above and other objects, features and advantages of exemplary embodiments of the present invention will become readily apparent from the following detailed description read in conjunction with the accompanying drawings. Several embodiments of the invention are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings and in which:
in the drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
FIG. 1 illustrates an architectural schematic diagram of a memristor array of an applied scenario resistive memory of an embodiment of the present disclosure;
FIG. 2 is a schematic diagram illustrating an implementation flow of a model online migration training method based on a resistive memory according to an embodiment of the present invention;
FIG. 3 is a graph showing conductance versus time for an embodiment of the present invention;
FIG. 4 is a flowchart illustrating an implementation flow of a specific application example of the method for model online migration training based on the resistive memory according to the embodiment of the present invention;
FIG. 5 is a schematic diagram illustrating a composition structure of a model online migration training apparatus based on a resistive memory according to an embodiment of the present invention.
Detailed Description
The principles and spirit of the present invention will be described with reference to a number of exemplary embodiments. It is understood that these embodiments are given only to enable those skilled in the art to better understand and to implement the present invention, and do not limit the scope of the present invention in any way. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
The technical solution of the present invention is further elaborated below with reference to the drawings and the specific embodiments.
Fig. 1 shows an architecture schematic diagram of a memristor array of an application scenario resistive memory according to an embodiment of the present invention.
Referring to fig. 1, the model online migration training method based on the resistive random access memory according to the embodiment of the present invention may be applied to the resistive random access memory, a memristor array architecture of the resistive random access memory is shown in fig. 1, an input voltage of a memristor array of a resistive random access memory RRAM is V, and an output vector is I.
Input voltage V1And the output vector I1Corresponding conductance G11, input voltage V2And the output vector I1The corresponding conductance is G21, and so on, the input voltage VmAnd the output vector InThe corresponding conductance is Gmn.
It should be noted that fig. 1 is only to describe the model online migration training method based on the resistive random access memory in the embodiment of the present invention more clearly, and an exemplary description is made of a specific application scenario of the method, and is not used to limit the application scenario of the model online migration training method based on the resistive random access memory in the embodiment of the present invention.
FIG. 2 is a schematic flow chart illustrating an implementation of the method for training model online migration based on the resistive memory according to the embodiment of the present invention.
Referring to fig. 2, an embodiment of the present invention provides a method for training model online migration based on a resistive memory, which at least includes the following operation flows: operation 201, obtaining neural network weights corresponding to each layer of a neural network model to be mapped onto the resistive random access memory, where the neural network weights are obtained based on an offline training process of the neural network model; operation 202, obtaining a conductance offset function of a plurality of conductances supported by the resistive random access memory; operation 203, performing online migration training on the neural network model through iterative training according to the conductance offset function to update the neural network weight; and in operation 204, updating the memristor array conductance value of the resistive random access memory according to the updated neural network weight to obtain the trained resistive random access memory.
In operation 201, neural network weights corresponding to each layer of a neural network model to be mapped onto the resistive random access memory are obtained, and the neural network weights are obtained based on an offline training process of the neural network model.
In the embodiment of the invention, the neural network to be mapped on the resistive random access memory is trained offline, the offline training is to train the weights of the neural network by using a standard learning algorithm in an external computer, and the weights of the neural network corresponding to each layer in the neural network model are obtained after the offline training is finished.
In operation 202, a conductance offset function of a plurality of conductances supported by a resistive switching memory is obtained.
In this embodiment of the present invention, the conductance values of the conductances may be collected once at set intervals for each of the plurality of conductances supported by the resistive memory, thereby determining a change curve of each conductance over time, and thereby determining the probability density function of the conductance values of the conductances as a conductance offset function for the conductances according to the change curve.
Specifically, the conductance of the resistive random access memory can be configured to be the minimum ideal conductance supported by the resistive random access memory, the actual conductance value of the minimum ideal conductance is collected once every set time, and the actual conductance value and the time are recorded; under the condition that the actual conductance value acquisition times of the minimum ideal conductance reach the set acquisition times, determining a change curve of the minimum conductance along with time according to the actual conductance value and the time; configuring the conductance of the resistive random access memory into a second ideal conductance, wherein the value of the second ideal conductance is equal to the ideal conductance step length doubled on the basis of the minimum ideal conductance, and repeatedly executing the operation to determine the change curve of the second ideal conductance along with time; thus, the operation is executed in a circulating mode until the conductance of the resistive random access memory is configured to be the maximum ideal conductance, the value of the maximum ideal conductance is equal to the ideal conductance step length increased by N-1 times on the basis of the minimum ideal conductance, the operation is executed repeatedly, and the change curve of the maximum ideal conductance along with the time is determined; wherein N represents the number of conductances supported by the resistive memory; the ideal conductance step size is equal to the ratio of the difference value of the maximum ideal conductance and the minimum ideal conductance to the number of conductances supported by the resistance change type memory.
For example, the minimum ideal conductance supported by RRAM is Gmin, and the maximum ideal conductance supported by RRAM is Gmax: and (3) the maximum conductance value of the RRAM device, namely the ideal conductance step length Gstep of the memristor array of the RRAM is (Gmax-Gmin)/the number N of conductances supported by the RRAM. Here, the number of conductances supported by the RRAM refers to the number of conductances that each device in the RRAM can represent, for example, the number of conductances that G11 in fig. 1 can represent may be 8 or 16. The ideal conductance is proposed because the conductance will shift during practical application, and Gmin and Gmax are only theoretical conductance values.
In determining the time-dependent profile of each conductance, all the conductances of the RRAM may be first configured as Gmin, and the actual values of the conductance of the RRAM may be collected once every set time. In this way, when the actual conductance value acquisition frequency reaches the set acquisition frequency, the actual conductance value acquisition of the minimum ideal conductance Gmin is finished. And recording the conductivity value and the acquisition time in the acquisition process, and further drawing a change curve of the conductivity value along with the time according to the conductivity value and the acquisition time recorded in the conductivity value acquisition process. The set collection times may be 8000, 9000, 10000, 11000, 12000, 15000, etc.
For each of the multiple conductances Gmin + NGstep supported by RRAM, the above operation is used to determine the time-dependent profile of each conductance.
Fig. 3 is a schematic diagram showing a change curve of conductance with time according to an embodiment of the present invention, and as shown in fig. 3, a change curve of each conductance of an RRAM with time point is shown in a case that the number of the conductances supported by the RRAM is 8. The abscissa is time, the ordinate is a conductance value, and a change curve of an actual conductance value of Gmin along with time, a change curve of an actual conductance value of Gmin + Gstep along with time, and a change curve of an actual conductance value of Gmin +2Gstep along with time … … Gmax are sequentially arranged from bottom to top in the graph.
After determining the respective change curves over time for the plurality of conductances supported by the RRAM, a conductance value probability density function for the conductance may be determined as a conductance offset function for the conductance from the change curves.
For example, for one of the conductances, fluctuation data of the conductance may be calculated according to a change curve of the conductance with time, such as: the average value of the actual conductance values obtained by multiple times of collection and the standard deviation of the actual conductance values obtained by multiple times of collection. From the mean and variance of the actual conductance values, a probability density function P of the conductance values for each conductance may be generated. For example: referring again to FIG. 3, the probability density functions for Gmin Gmax may be P0-P7 in that order.
Therefore, under the condition that the conductance values of Gmin-Gmax are used in the online migration training process of the neural network model, on the basis of the ideal conductance values of Gmin-Gmax, the deviation values of Gmin-Gmax are randomly selected according to probability density functions P0-P7, the conductance values of Gmin-Gmax are updated, and therefore the neural network weights corresponding to all layers of the neural network model are updated.
In operation 203, the neural network model is subjected to online migration training by iterative training according to the conductance offset function to update the neural network weights.
In this embodiment of the present invention, a current adjustment value that needs to be adjusted for an output vector of a neural network layer of the neural network model may be first determined based on a conductance offset function for a plurality of conductances, and then, the neural network weights of the plurality of neural network layers of the neural network model may be sequentially updated according to the current adjustment values of the plurality of neural network layers in order from an input layer to an output layer of the neural network layer.
For example, the neural network layer of the neural network model, from the input layer to the output layer, may include: a plurality of convolutional layers, max-pooling layers, and full-link layers, etc. During the on-line migration training of the neural network model, for each convolutional layer, a current adjustment value that needs to be adjusted for the output vector of the neural network layer of the neural network model is determined according to the conductance offset function determined in operation 202.
Referring again to FIG. 1, for the first convolutional layer of the neural network model, its ideal output vector I1The actual output vector needs to consider the conductance offset, and here, the process of updating the neural network weights of the neural network layers of the neural network model is briefly described according to the ideal conductance value and the conductance offset function.
For the first row in fig. 1, the actual value of the output vector I1 can be represented by equation (1):
I1+Δi1=(G11+G11Δ)V1+(G21+G21Δ)V2+……(Gm1+Gm1Δ)Vm
formula (1)
Where I1 denotes a rational output vector, I1 is (Gmin + N1Gstep) V1+ … + (Gmin + NmGstep) Vm, since ideal conductance G11 is Gmin + N1Gstep, ideal conductance G21 is Gmin + N1Gstep, and ideal conductance Gm1 is Gmin + NmGstep.
Thus, the above formula (1) can be modified to obtain the following formulas (2), (3) and (4) in order:
i1+ Δ I1 ═ V1+ … + (Gmin + NmGstep) Vm + G11 Δ ═ V1+ Gm1 Δ ═ Vm formula (2)
Δ i1 ═ G11 Δ × V1+ Gm1 Δ × Vm equation (3)
Δ i1 ═ Σ f (Gk1 Δ × Vn), k ∈ [1, m ] formula (4)
Wherein Δ i1 represents the current value that needs to be added during the neural network weight calculation for the first convolutional layer;
gmin + NmGstep represents the ideal conductance value for the mth conductance supported by RRAM;
gm1 Δ represents the conductance deviation produced by the devices of the memristor array of the RRAM at the mth conductance;
vm denotes the mth input voltage of the RRAM device, which has a plurality of input voltages, different input voltages representing different input values.
Gstep denotes the ideal conductance step of the memristor array of the RRAM, Gstep is (Gmax-Gmin)/N, and N denotes the number of conductances supported by the RRAM.
In a similar manner, the current value Δ in ═ Σ f (Gkn Δ × Vn), k ∈ [1, m ], which needs to be adjusted in the neural network weight calculation for the nth convolutional layer can be obtained.
As such, a conductance offset function determined in operation 202 may be utilized to determine Gkn Δ during training of each convolutional layer, and further determine the current values that need to be adjusted for that convolutional layer based on Gkn Δ. Further, the neural network weight of the convolutional layer determined after the conductance of the convolutional layer is compensated by the conductance offset function is determined to be used as input data of the convolutional layer of the next layer, and the neural network weights of the convolutional layers and the largest pooling layer are updated in sequence.
In operation 204, the memristor array conductance value of the resistive random access memory is updated according to the updated neural network weight, so that the trained resistive random access memory is obtained.
In the embodiment of the present invention, it is determined whether or not the output of the neural network model satisfies the setting end condition based on the neural network weights of the plurality of neural network layers of the updated neural network model. And under the condition that the output of the neural network model meets the set end condition, ending the online migration training of the neural network model, and updating the memristor array conductance value of the resistive random access memory according to the neural network weights of the plurality of neural network layers of the updated neural network model.
Specifically, the final output data of the neural network model can be determined according to the updated neural network weights of the plurality of neural network layers of the neural network model, and whether the precision of the neural network model meets the preset precision or not can be judged according to the final output data. For example; for the neural network model for data identification, whether the identification rate of the neural network model meets the set identification rate threshold value or not can be judged according to the final output data. And if the final output data can judge that the precision of the neural network model meets the preset precision, ending the online migration training of the neural network model. If the final output data can judge that the precision of the neural network model does not meet the preset precision, iterative training is carried out from the first convolution layer of the neural network model. And finally outputting data to judge whether the precision of the neural network model meets the preset precision.
In this embodiment of the present invention, the output accuracy of the neural network model obtained by the current round of online migration training may be determined based on the updated neural network weights of the plurality of neural network layers of the neural network model, and the output of the neural network model may be determined to satisfy the setting end condition when the variance of the output accuracy of the neural network model obtained by the last set round of online migration training is smaller than the set variance threshold.
For example, for a neural network model, a round of online migration training is completed from a first convolutional layer to a maximum pooling layer, and the accuracy of the neural network model after the round of online migration training can be determined. And circularly performing multiple rounds of online migration training, judging that the online migration training of the neural network model is finished if the variance of the accuracy of the neural network model obtained by the last round of setting is smaller than a set threshold, and updating the conductance value of the resistive random access memory corresponding to the full connection layer according to the neural network weight of each layer of the neural network determined in the last round.
Fig. 4 is a schematic implementation flow diagram of a specific application example of the model online migration training method based on the resistive memory according to the embodiment of the present invention.
Referring to fig. 4, a specific application example of the model online migration training method based on the resistive memory according to the embodiment of the present invention at least includes the following operation flows:
in operation 401, a random parameter table of Δ in is generated at n neural network layers of a neural network.
Specifically, Δ in may be determined by referring to the specific operation of operation 202, which is not described herein again.
Operation 402, compensating the first neural network layer convolutional layer conv1 according to Δ i 1;
in operation 403, compensating the second neural network layer convolutional layer conv2 according to Δ i 2;
operation 404, compensating the convn of the nth neural network layer convolution layer convn according to the delta in;
operation 405, updating parameters of the max pooling layer Maxpool of the neural network;
at operation 406, conductance values of the fully-connected layers of the neural network are updated.
And (4) circularly executing (402) -406 until the variance of the recognition rate of the neural network model for the last X times is smaller than the set threshold value. And judging that the online migration training of the neural network model is finished. In each round of executing 402-406, the value of Δ in may be randomly selected according to a random parameter table of Δ in.
In operation 407, the neural network weights of the neural network model layers are mapped to the resistive random access memory.
The specific implementation processes of operations 401 to 408 are similar to the specific implementation processes of operations 201 to 204 in the embodiment shown in fig. 2, and are not described here again.
Fig. 5 is a schematic diagram illustrating a composition structure of an online model migration training apparatus based on a resistive memory according to an embodiment of the present invention, and referring to fig. 5, the apparatus 50 includes: an initial model obtaining module 501, configured to obtain a neural network weight corresponding to each layer of a neural network model to be mapped onto a resistive random access memory, where the neural network weight is obtained based on an offline training process of the neural network model; a conductance offset obtaining module 502, configured to obtain a conductance offset function of multiple conductances supported by the resistive random access memory; the model training and updating module 503 performs online migration training on the neural network model through iterative training according to the conductance offset function to update the neural network weight; and the chip updating module 504 is configured to update the memristor array conductance value of the resistive random access memory according to the updated neural network weight, so as to obtain the trained resistive random access memory.
In this embodiment of the present invention, conductance offset obtaining module 502 includes: the conductance time relation determining submodule is used for acquiring the conductance value of each conductance in a plurality of conductances supported by the resistive memory at set time intervals so as to determine a change curve of each conductance along with time; and the offset function determination submodule is used for determining a conductance value probability density function of the conductance according to the change curve, and the conductance value probability density function is used as a conductance offset function aiming at the conductance.
In this embodiment of the present invention, the conductance time relation determining submodule collects the conductance value of each conductance at set time intervals for each conductance of the plurality of conductances supported by the resistive memory, so as to determine the change curve of each conductance with time, and includes: configuring the conductance of the resistive random access memory into the minimum ideal conductance supported by the resistive random access memory, collecting the actual conductance value of the minimum ideal conductance once every set time, and recording the actual conductance value and the time; under the condition that the actual conductance value acquisition times of the minimum ideal conductance reach the set acquisition times, determining a change curve of the minimum conductance along with time according to the actual conductance value and the time; configuring the conductance of the resistive random access memory into a second ideal conductance, wherein the value of the second ideal conductance is equal to the ideal conductance step length doubled on the basis of the minimum ideal conductance, and repeatedly executing the operation to determine the change curve of the second ideal conductance along with time; thus, the operation is executed in a circulating mode until the conductance of the resistive random access memory is configured to be the maximum ideal conductance, the value of the maximum ideal conductance is equal to the ideal conductance step length increased by N-1 times on the basis of the minimum ideal conductance, the operation is executed repeatedly, and the change curve of the maximum ideal conductance along with the time is determined; wherein N represents the number of conductances supported by the resistive memory; the ideal conductance step size is equal to the ratio of the difference value of the maximum ideal conductance and the minimum ideal conductance to the number of conductances supported by the resistance change type memory.
The embodiment of the invention also provides a chip which comprises the model online migration training device based on the resistive random access memory.
The embodiment of the invention discloses a method, a device and a chip for model online migration training based on an impedance memory. The neural network weight corresponding to each layer of the neural network model needing to be mapped onto the resistive random access memory is obtained, the neural network weight is obtained based on an offline training process of the neural network model, a conductance offset function of a plurality of conductances supported by the resistive random access memory is obtained, online migration training is conducted on the neural network model through iterative training according to the conductance offset function so as to update the neural network weight, and further, the memristor array conductance value of the resistive random access memory is updated according to the updated neural network weight so as to obtain the trained resistive random access memory. Therefore, the conductance offset function of the neural network convolution layer weight conductance value changing along with the time is added in the iterative process of the migration training, so that the migration training on the resistive random access memory can learn the rule that the conductance value corresponding to the neural network weight changes along with the time, and the neural network can learn the offset characteristic of the conductance value of each conductance of the resistive random access memory, so that the neural network weight mapped to the array of the resistive random access memory has better adaptability, and the over-fitting problem of the traditional online training method for executing the migration training in the single time of the resistive random access memory is effectively solved.
Here, it should be noted that: the above description of the model online migration training and the chip embodiment based on the resistance random access memory is similar to the description of the method embodiment shown in fig. 1 to 4, and has similar beneficial effects to the method embodiment shown in fig. 1 to 4, and therefore, the description is omitted. For the technical details that are not disclosed in the model online migration training and the chip embodiment of the resistive random access memory according to the present invention, please refer to the description of the method embodiments shown in fig. 1 to 4 of the present invention for understanding, and therefore, for brevity, no further description is provided.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of a unit is only one logical function division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units; can be located in one place or distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, all the functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately regarded as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
Those of ordinary skill in the art will understand that: all or part of the steps for realizing the method embodiments can be completed by hardware related to program instructions, the program can be stored in a computer readable storage medium, and the program executes the steps comprising the method embodiments when executed; and the aforementioned storage medium includes: various media that can store program codes, such as a removable memory device, a Read Only Memory (ROM), a magnetic disk, or an optical disk.
Alternatively, the integrated unit of the present invention may be stored in a computer-readable storage medium if it is implemented in the form of a software functional module and sold or used as a separate product. Based on such understanding, the technical solutions of the embodiments of the present invention may be essentially implemented or a part contributing to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the methods of the embodiments of the present invention. And the aforementioned storage medium includes: a removable storage device, a ROM, a magnetic or optical disk, or other various media that can store program code.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A model online migration training method based on a resistive random access memory is characterized by comprising the following steps:
acquiring neural network weights corresponding to each layer of a neural network model to be mapped to a resistive random access memory, wherein the neural network weights are obtained based on an offline training process of the neural network model;
acquiring a conductance offset function of a plurality of conductances supported by the resistive random access memory;
performing online migration training on the neural network model through iterative training according to the conductance offset function so as to update the neural network weight;
and updating the memristor array conductance value of the resistive random access memory according to the updated neural network weight to obtain the trained resistive random access memory.
2. The method according to claim 1, wherein the obtaining a conductance offset function of a plurality of conductances supported by the resistive switching memory comprises:
acquiring a conductance value of each conductance of a plurality of conductances supported by the resistive random access memory at set time intervals to determine a change curve of each conductance along with time;
determining a conductance value probability density function of the conductance as a conductance offset function for the conductance from the variation curve.
3. The method according to claim 2, wherein collecting, for each of a plurality of conductances supported by the resistive random access memory, a conductance value of the conductance once every set time interval to determine a time variation curve of each conductance, comprises:
configuring the conductance of the resistive random access memory as the minimum ideal conductance supported by the resistive random access memory, collecting the actual conductance value of the minimum ideal conductance once every set time, and recording the actual conductance value and time;
under the condition that the actual conductance value acquisition times of the minimum ideal conductance reach set acquisition times, determining a change curve of the minimum conductance along with time according to the actual conductance value and time;
configuring the conductance of the resistive random access memory into a second ideal conductance, wherein the value of the second ideal conductance is equal to an ideal conductance step length doubled on the basis of the minimum ideal conductance, and repeatedly executing the operation to determine a change curve of the second ideal conductance along with time;
thus, the above operations are executed in a circulating mode until the conductance of the resistive random access memory is configured to be the maximum ideal conductance, the value of the maximum ideal conductance is equal to the ideal conductance step increased by N-1 times on the basis of the minimum ideal conductance, and the above operations are repeatedly executed to determine the change curve of the maximum ideal conductance along with the time;
wherein N represents the number of conductances supported by the resistive memory;
the ideal conductance step length is equal to the ratio of the difference value of the maximum ideal conductance and the minimum ideal conductance to the number of conductances supported by the resistive random access memory.
4. The method of claim 1, wherein performing online migration training of the neural network model by iterative training to update the neural network weights according to the conductance offset function comprises:
determining a current adjustment value that requires an adjustment to an output vector of a neural network layer of the neural network model based on a conductance offset function for a plurality of conductances;
and updating the neural network weights of the plurality of neural network layers of the neural network model in sequence according to the sequence from the input layer to the output layer of the neural network layer and according to the current adjustment values of the plurality of neural network layers.
5. The method according to claim 1, wherein updating the memristor array conductance values of the resistive random access memory according to the updated neural network weights to obtain a trained resistive random access memory comprises:
judging whether the output of the neural network model meets a set end condition or not according to the updated neural network weights of the plurality of neural network layers of the neural network model;
under the condition that the output of the neural network model meets a set ending condition, ending the online migration training of the neural network model, and updating the memristor array conductance value of the resistive memory according to the updated neural network weights of the plurality of neural network layers of the neural network model.
6. The method of claim 5, wherein determining whether the output of the neural network model satisfies a set termination condition based on the updated neural network weights of the plurality of neural network layers of the neural network model comprises:
according to the updated neural network weights of a plurality of neural network layers of the neural network model, judging the output precision of the neural network model obtained by the current round of online transfer training;
and under the condition that the variance of the output precision of the neural network model obtained by the final set round of online transfer training is smaller than a set variance threshold, judging that the output of the neural network model meets a set end condition.
7. A model online migration training device based on a resistive random access memory is characterized by comprising:
the initial model acquisition module is used for acquiring neural network weights corresponding to all layers of a neural network model to be mapped to the resistive random access memory, and the neural network weights are obtained based on an offline training process of the neural network model;
the conductance offset acquisition module is used for acquiring a conductance offset function of a plurality of conductances supported by the resistive random access memory;
the model training and updating module is used for carrying out online migration training on the neural network model through iterative training according to the conductance offset function so as to update the neural network weight;
and the chip updating module is used for updating the memristor array conductance value of the resistive random access memory according to the updated neural network weight to obtain the trained resistive random access memory.
8. The apparatus of claim 7, wherein the conductance offset acquisition module comprises:
the conductance time relation determining submodule is used for acquiring the conductance value of each conductance in a plurality of conductances supported by the resistance change type memory at set time intervals so as to determine a change curve of each conductance along with time;
and the offset function determination submodule is used for determining a conductance value probability density function of the conductance according to the change curve, and the conductance value probability density function serves as a conductance offset function aiming at the conductance.
9. The apparatus of claim 8, wherein the conductance time relationship determining submodule collects, for each conductance of the plurality of conductances supported by the resistive random access memory, a conductance value of the conductance at set intervals to determine a time variation curve of each conductance, and comprises:
configuring the conductance of the resistive random access memory as the minimum ideal conductance supported by the resistive random access memory, collecting the actual conductance value of the minimum ideal conductance once every set time, and recording the actual conductance value and time;
under the condition that the actual conductance value acquisition times of the minimum ideal conductance reach set acquisition times, determining a change curve of the minimum conductance along with time according to the actual conductance value and time;
configuring the conductance of the resistive random access memory into a second ideal conductance, wherein the value of the second ideal conductance is equal to an ideal conductance step length doubled on the basis of the minimum ideal conductance, and repeatedly executing the operation to determine a change curve of the second ideal conductance along with time;
thus, the above operations are executed in a circulating mode until the conductance of the resistive random access memory is configured to be the maximum ideal conductance, the value of the maximum ideal conductance is equal to the ideal conductance step increased by N-1 times on the basis of the minimum ideal conductance, and the above operations are repeatedly executed to determine the change curve of the maximum ideal conductance along with the time;
wherein N represents the number of conductances supported by the resistive memory;
the ideal conductance step length is equal to the ratio of the difference value of the maximum ideal conductance and the minimum ideal conductance to the number of conductances supported by the resistive random access memory.
10. A chip comprising the resistive random access memory based model online migration training device as claimed in any one of claims 7 to 9.
CN202111591016.0A 2021-12-23 2021-12-23 Model online migration training method, device and chip based on resistive random access memory Pending CN114330688A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111591016.0A CN114330688A (en) 2021-12-23 2021-12-23 Model online migration training method, device and chip based on resistive random access memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111591016.0A CN114330688A (en) 2021-12-23 2021-12-23 Model online migration training method, device and chip based on resistive random access memory

Publications (1)

Publication Number Publication Date
CN114330688A true CN114330688A (en) 2022-04-12

Family

ID=81053928

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111591016.0A Pending CN114330688A (en) 2021-12-23 2021-12-23 Model online migration training method, device and chip based on resistive random access memory

Country Status (1)

Country Link
CN (1) CN114330688A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115311506A (en) * 2022-10-11 2022-11-08 之江实验室 Image classification method and device based on quantization factor optimization of resistive random access memory

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110796241A (en) * 2019-11-01 2020-02-14 清华大学 Training method and training device of neural network based on memristor
US20200293855A1 (en) * 2019-03-14 2020-09-17 International Business Machines Corporation Training of artificial neural networks
US20200327406A1 (en) * 2019-04-10 2020-10-15 International Business Machines Corporation Training of artificial neural networks
US20200334525A1 (en) * 2019-04-18 2020-10-22 International Business Machines Corporation Mitigation of conductance drift in neural network resistive processing units
CN111931924A (en) * 2020-07-31 2020-11-13 清华大学 Memristor neural network chip architecture compensation method based on online migration training
CN112070204A (en) * 2020-07-24 2020-12-11 中国科学院计算技术研究所 Neural network mapping method and accelerator based on resistive random access memory
CN112825153A (en) * 2019-11-20 2021-05-21 华为技术有限公司 Data processing method in neural network system and neural network system
CN113505887A (en) * 2021-09-12 2021-10-15 浙江大学 Memristor memory neural network training method aiming at memristor errors

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200293855A1 (en) * 2019-03-14 2020-09-17 International Business Machines Corporation Training of artificial neural networks
US20200327406A1 (en) * 2019-04-10 2020-10-15 International Business Machines Corporation Training of artificial neural networks
US20200334525A1 (en) * 2019-04-18 2020-10-22 International Business Machines Corporation Mitigation of conductance drift in neural network resistive processing units
CN110796241A (en) * 2019-11-01 2020-02-14 清华大学 Training method and training device of neural network based on memristor
CN112825153A (en) * 2019-11-20 2021-05-21 华为技术有限公司 Data processing method in neural network system and neural network system
CN112070204A (en) * 2020-07-24 2020-12-11 中国科学院计算技术研究所 Neural network mapping method and accelerator based on resistive random access memory
CN111931924A (en) * 2020-07-31 2020-11-13 清华大学 Memristor neural network chip architecture compensation method based on online migration training
CN113505887A (en) * 2021-09-12 2021-10-15 浙江大学 Memristor memory neural network training method aiming at memristor errors

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王炯琦等: "基于UKF神经网络的姿态测量信息融合算法", 《***仿真学报》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115311506A (en) * 2022-10-11 2022-11-08 之江实验室 Image classification method and device based on quantization factor optimization of resistive random access memory

Similar Documents

Publication Publication Date Title
TWI769754B (en) Method and device for determining target business model based on privacy protection
Rusiecki Trimmed categorical cross‐entropy for deep learning with label noise
Chen et al. Online modeling with tunable RBF network
Dong et al. Convolutional neural networks based on RRAM devices for image recognition and online learning tasks
JP2021507349A (en) A method for storing weights in a crosspoint device of a resistance processing unit array, its crosspoint device, a crosspoint array for performing a neural network, its system, and a method for performing a neural network. Method
CN111052152B (en) Control device including array of nerve-like elements, method for calculating discretization step length, and program
CN106327357B (en) A kind of load identification method based on improvement probabilistic neural network
Zhang et al. Decoupling capacitor selection algorithm for PDN based on deep reinforcement learning
Elattar Prediction of wind power based on evolutionary optimised local general regression neural network
CN110781595B (en) Method, device, terminal and medium for predicting energy use efficiency (PUE)
TWI787691B (en) Apparatus and method for neural network computation
CN114169649A (en) Traffic flow prediction method based on space-time data embedding
CN114330688A (en) Model online migration training method, device and chip based on resistive random access memory
Zheng et al. Hardware-friendly actor-critic reinforcement learning through modulation of spike-timing-dependent plasticity
Zhao et al. Short‐term load demand forecasting through rich features based on recurrent neural networks
CN115800274B (en) 5G distribution network feeder automation self-adaptation method, device and storage medium
Chen A PSO-based method for extracting fuzzy rules directly from numerical data
CN115358178B (en) Circuit yield analysis method based on fusion neural network
Pazouki et al. Adaptive learning algorithm for RBF neural networks in kernel spaces
CN114662658A (en) On-chip optical network hot spot prediction method based on LSTM neural network
CN115984025A (en) Influence propagation estimation method and system based on deep learning graph network model
CN115392594A (en) Electrical load model training method based on neural network and feature screening
D’Agostino et al. Synaptic metaplasticity with multi-level memristive devices
Krestinskaya et al. Approximate probabilistic neural networks with gated threshold logic
CN115699028A (en) Efficient tile mapping for line-by-line convolutional neural network mapping that simulates artificial intelligence network reasoning

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination