ReRAM random write error-oriented typical deep learning network precision compensation method

By combining ReRAM device error distribution modeling and Bayesian neural network training, a prior distribution is constructed and a posterior mean penalty term is introduced, which solves the problem that ReRAM write errors affect the accuracy of neural networks and improves the robustness and accuracy of the network without increasing hardware overhead.

CN121009929AActive Publication Date: 2025-11-25HARBIN INST OF TECH +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511153249.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-18
Publication Date
2025-11-25
Estimated Expiration
2045-08-18

AI Technical Summary

Technical Problem

ReRAM devices have random errors during the writing process, which affect the inference accuracy of neural networks. Existing technologies cannot effectively utilize error statistics for algorithm-level compensation.

Method used

By combining write error distribution modeling of ReRAM devices with Bayesian neural network training, a prior distribution is constructed, and a posterior mean penalty term is introduced during training to modify the loss function to suppress error amplification and improve hardware robustness.

Benefits of technology

Without increasing hardware overhead, it significantly improves the inference accuracy and robustness of neural networks, making it suitable for low-power, low-precision environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121009929A_ABST
    Figure CN121009929A_ABST
Patent Text Reader

Abstract

The invention relates to a typical deep learning network precision compensation method oriented to a ReRAM random write error. The invention relates to the technical field of artificial intelligence hardware acceleration and neural network model optimization, and the method comprises the steps: carrying out the multiple writing of different target conductance values on a ReRAM device, and building the probability distribution of a conductance value error through kernel density estimation; fitting the obtained distribution into normal distribution, and establishing a function relationship between a standard deviation and an ideal conductivity value; and prior distribution of weights in the Bayesian neural network is constructed according to the function, and an L2 regular penalty term is introduced into a posteriori distribution mean value in the training process so as to suppress error amplification sensitivity. According to the method, the model-level compensation of the ReRAM hardware error is realized, and the network reasoning precision and robustness are effectively improved under the condition that redundant mapping or online calibration is not needed.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to the technical field of artificial intelligence hardware acceleration and neural network model optimization, and is a typical deep learning network precision compensation method for ReRAM random write errors. BACKGROUND

[0002] With the continuous improvement of the energy efficiency demand of artificial intelligence inference tasks, brain-like computing architecture based on ReRAM devices has gradually become a research hotspot. ReRAM devices have the advantages of non-volatility and high density, and are widely used in neural network weight storage and matrix multiplication operation acceleration.

[0003] ReRAM (Resistive Random Access Memory) is a non-volatile memory developed by Fujitsu, which is based on the principle of memristor and uses the resistance state change in the metal-dielectric layer-metal (MIM) three-layer structure to store data. It combines the read-write speed of dynamic random memory (DRAM) and the non-volatility of solid state disk (SSD), and can retain data after power failure, has the characteristics of low power consumption and compatibility with CMOS process.

[0004] The technology research and development started in 2013 when Matsushita launched the first ReRAM product in the world. Fujitsu and Matsushita jointly developed a 4MB chip in 2016, and launched a 12Mbit capacity product MB85AS12MT in 2022. International mainstream enterprises including Onkyo, Elpida, Sony, Micron, and Hynix have all laid out RRAM commercial applications. ReRAM has a read-write speed 1000 times faster than NANDFlash and a power consumption reduction of 15 times, and can be applied to the Internet of Things, autonomous driving, PCs, and compute-in-memory architecture, achieving instant response without loading time and breaking through the von Neumann bottleneck. Fujitsu plans to develop a new generation of products by expanding the capacity through stacking technology.

[0005] However, due to the non-ideal physical mechanism of ReRAM, in the actual writing process, even if the same pulse sequence is applied, there is obvious fluctuation in the final conductance value. This random write error will significantly affect the inference accuracy of neural networks, especially in low-power and low-precision mapping environments.

[0006] In the prior art, the following methods are mainly used to alleviate the influence of ReRAM errors: using multiple ReRAM units to redundantly store the same weight to improve accuracy, but significantly increasing area and power consumption; repeatedly reading and writing in the ReRAM array to train the network, which can improve the accuracy, but the hardware overhead is large; some documents try to use Bayesian neural networks (BNN) instead of CNN to improve the tolerance to weight perturbations, but the design of the prior distribution is often empirical and cannot be customized and optimized for the ReRAM error model.

[0007] Therefore, there is an urgent need for a method that can fully utilize the ReRAM error statistical law, embed the neural network training process, and improve the hardware inference robustness from the algorithm level. SUMMARY

[0008] The application provides a typical deep learning network precision compensation method for ReRAM random write errors. The application realizes algorithm-level compensation for hardware errors by combining ReRAM device actual write error distribution modeling and Bayesian neural network training mechanism, and solves the problem of decreased inference precision in existing deployment. The application provides the following technical solutions: A typical deep learning network precision compensation method for ReRAM random write errors, the method comprising the following steps: The method comprises the following steps: Step 1: In the ReRAM device, for the target conductance value G ideal , the same pulse number is repeatedly applied multiple times, the conductance value after writing is recorded, and the probability distribution curve is obtained by using kernel density estimation (KDE); Step 2: The obtained conductance distribution is fitted as a normal distribution, the mean value is extracted, and the above steps are repeated at multiple target conductance values to establish a function relationship between the standard deviation and the target conductance value ; Step 3: Construct a prior distribution based on the function relationship obtained in step 2 as the prior probability distribution of the weight parameters of each layer of the Bayesian neural network; Step 4: In the variational inference training process of the BNN, modify the loss function, introduce an L2 regularization term of the posterior mean, and use it to punish the sum of squares of the mean items in all weight distributions; Step 5: Train the Bayesian neural network based on the modified loss function to obtain the posterior mean parameter of the weight distribution, and map the mean parameter as the weight value to the ReRAM array for precision compensation.

[0009] Preferably, the function relationship between the standard deviation and the target conductance value is a linear function:

[0010] Wherein, k is a proportionality coefficient fitted by multiple ReRAM write experiments.

[0011] Preferably, the kernel density estimation (KDE) used in step 1 is a Gaussian kernel function to smooth the probability density distribution of the ReRAM write conductance value.

[0012] Preferably, step 3 is specifically: The prior distribution based on the function relationship obtained in step 2 is constructed as the prior probability distribution of the weight parameters of each layer of the Bayesian neural network The prior distribution is set as:

[0013] Preferably, step 4 is specifically: The BNN is trained using the variational Bayesian method, and a posterior mean penalty term is introduced on the basis of the standard variational inference loss function ELBO:

[0014] The regular term constrains the mean of the posterior distribution, compresses the weight amplitude, and suppresses the error amplification effect of ReRAM.

[0015] Preferably, the posterior mean penalty term is:

[0016] wherein, represents the mean of the ith weight distribution, is a regularization coefficient for adjusting the influence degree of the term.

[0017] Preferably, step 5 is specifically: The posterior mean of each weight in the trained Bayesian neural network is extracted as the conductance value mapped to the ReRAM array, and the number of pulses required to be applied is determined through table lookup or fitting relationship for writing. A disturbance subject to is introduced on the written conductance to simulate the inference accuracy under the error of the actual device.

[0018] A typical deep learning network precision compensation system for ReRAM random write error, the system comprises: A data recording module for target conductance value G ideal The same number of pulses is repeatedly applied multiple times, the conductance value after writing is recorded, and the probability distribution curve is obtained using kernel density estimation KDE; A fitting module that fits the obtained conductance distribution to a normal distribution, extracts the mean, and repeats the above steps at multiple target conductance values to establish the function relationship between the standard deviation and the target conductance value ; A model building module that constructs a prior distribution based on the obtained function relationship as the prior probability distribution of the weight parameters of each layer of the Bayesian neural network; The model training module modifies a loss function, introduces an L2 regularization term of a posterior mean during a variational inference training process of the BNN, and punishes a sum of squares of mean terms in all weight distributions. The inference compensation module trains the Bayesian neural network based on the modified loss function, obtains a posterior mean parameter of the weight distribution, and maps the mean parameter as a weight value to the ReRAM array for precision compensation.

[0019] A readable storage medium stores data in the form of conductance, and is characterized in that operations can be performed locally on the storage device to realize the integration of storage and calculation, so as to realize a typical deep learning network precision compensation method for ReRAM random write errors.

[0020] The present application has the following beneficial effects: Compared with the prior art, the present application establishes an error statistical model based on the actual ReRAM device characteristics, constructs a -G mapping relationship that can be embedded in the prior of the Bayesian neural network.

[0021] The present application introduces a posterior mean penalty to further compress high-error weights and improve system inference robustness; compared with the prior art, the present application can realize precision improvement through one-time training without hardware redundancy or complex online training. BRIEF DESCRIPTION OF DRAWINGS

[0022] In order to more clearly illustrate the specific embodiments of the present application or the technical solutions in the prior art, the following will briefly introduce the drawings needed to be used in the specific embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.

[0023] Figure 1 The overall flowchart of the method of the present application is shown; Figure 2 The kernel density estimation results and normal distribution fitting curve diagrams of the present application under multiple conductance target values are shown; Figure 3 The standard deviation of the present application is shown between the target conductance and the fitting curve; Figure 4 The improved BNN training loss function structure diagram of the present application is shown. DETAILED DESCRIPTION

[0024] The technical solutions of the present application will be described clearly and completely below in conjunction with the drawings. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the present application.

[0025] The present application will be described in detail below in conjunction with specific embodiments. Embodiment one: According to Figures 1 to 4 As shown in the drawings, the specific optimization technical solution adopted by the present application to solve the above technical problems is: the present application relates to a typical deep learning network precision compensation method for ReRAM random write error.

[0027] The present application provides a typical deep learning network precision compensation method for ReRAM random write error, which comprises the following steps: Step 1: In the ReRAM device, for the target conductance value G ideal , the same pulse number is repeatedly applied for multiple times, the conductance value after writing is recorded, and the probability distribution curve is obtained by using kernel density estimation (KDE); Step 2: fitting the obtained conductance distribution as a normal distribution, extracting the mean value, and repeating the above steps under multiple target conductance values to establish the function relationship between the standard deviation and the target conductance value ; Step 3: constructing a prior distribution based on the function relationship obtained in step 2 as the prior probability distribution of the weight parameters of each layer of the Bayesian neural network; Step 4: in the variational inference training process of BNN, modify the loss function, introduce the L2 regularization term of the posterior mean, and use it to punish the sum of squares of the mean items in all weight distributions; Step 5: based on the modified loss function, the Bayesian neural network is trained to obtain the posterior mean parameter of the weight distribution, and the mean parameter is mapped to the ReRAM array as the weight value for precision compensation.

[0028] The application relates to a ReRAM random write error-oriented deep learning network precision compensation method, and belongs to the technical field of neural network model hardware mapping and inference optimization. The method comprises the following steps: multiple times of writing of different target conductance values on a ReRAM device, establishment of a probability distribution of conductance value errors by using kernel density estimation; fitting of the obtained distribution into a normal distribution, and establishment of a function relationship between a standard deviation and an ideal conductance value; construction of a prior distribution of weights in a Bayesian neural network (BNN) according to the function, and introduction of an L2 regular penalty term into a posterior distribution mean value in a training process to inhibit error amplification sensitivity; obtaining of a group of robust weight means by training, and mapping to a ReRAM array for inference. The method realizes model-level compensation of ReRAM hardware errors, effectively improves network inference precision and robustness without redundant mapping or online calibration, and has good universality and engineering practical value. Specific embodiment two: The difference between the second embodiment of the application and the first embodiment is only that: The function relationship between the standard deviation and the target conductance value is a linear function form:

[0030] Wherein, k is a proportional coefficient fitted by multiple ReRAM write experiments. Specific embodiment three: The difference between the third embodiment of the application and the second embodiment is only that: The kernel density estimation KDE used in step 1 is a Gaussian kernel function to smooth the probability density distribution of the ReRAM write conductance value. Specific embodiment four: The difference between the fourth embodiment of the application and the third embodiment is only that: The step 3 is specifically: The prior distribution based on the function relationship obtained in step 2 is constructed as the prior probability distribution of the weight parameters of each layer of the Bayesian neural network, and the prior distribution of each weight of the trained traditional CNN network is set as: Specific embodiment five: The difference between the fifth embodiment of the application and the fourth embodiment is only that: The step 4 is specifically: The BNN is trained by using a variational Bayesian method, and a posterior mean penalty term is introduced on the basis of a standard variational inference loss function ELBO:

[0034] ​​The regular term constrains the mean of the posterior distribution, compresses the weight amplitude, and suppresses the ReRAM error amplification effect. Specific embodiment six: The difference between the embodiment six and the embodiment five is only that: The posterior mean penalty term is:

[0036] wherein, represents the mean of the i-th weight distribution, is a regularization coefficient for adjusting the influence degree of the term. Specific embodiment seven: The difference between the embodiment seven and the embodiment six is only that: The step 5 is specifically: extracting the posterior mean of each weight in the trained Bayesian neural network as the conductance value mapped to the ReRAM array, determining the number of pulses required to be applied for writing through table lookup or fitting relationship, introducing disturbance subject to on the written conductance to simulate the inference accuracy under the actual device error. Specific embodiment eight: The difference between the embodiment eight and the embodiment seven is only that: The present application provides a typical deep learning network accuracy compensation system for ReRAM random write error, which comprises: A data recording module is provided for a target conductance value G ideal , the same number of pulses is repeatedly applied for multiple times, the conductance value after writing is recorded, and the probability distribution curve thereof is obtained by using kernel density estimation (KDE); A fitting module is provided for fitting the obtained conductance distribution into a normal distribution, extracting the mean value, and repeating the above steps under multiple target conductance values to establish a function relationship between the standard deviation and the target conductance value ; A model building module is provided for constructing a prior distribution based on the obtained function relationship as the prior probability distribution of the weight parameters of each layer of the Bayesian neural network; A model training module is provided for modifying the loss function in the variational inference training process of the BNN, introducing an L2 regular term of the posterior mean to punish the sum of squares of the mean terms in all weight distributions; An inference compensation module is provided for training the Bayesian neural network based on the modified loss function to obtain the posterior mean parameter of the weight distribution, and mapping the mean parameter as the weight value to the ReRAM array for accuracy compensation. Specific embodiment nine: The difference between the embodiment nine and the embodiment eight is only that: The application provides a readable storage medium which stores data in the form of conductance, can perform operation locally in a storage device, realizes integration of storage and calculation, and is used for realizing a typical deep learning network precision compensation method for ReRAM random write errors.

[0040] The method comprises the following steps: Step 1: in the ReRAM device, for a target conductance value G ideal , the same pulse number is repeatedly applied for multiple times, the conductance value after writing is recorded, and a probability distribution curve is obtained by using kernel density estimation (KDE); Step 2: the obtained conductance distribution is fitted as a normal distribution, the mean value is extracted, and the above steps are repeated under multiple target conductance values, and a function relationship between the standard deviation and the target conductance value is established; Step 3: a prior distribution based on the function relationship obtained in step 2 is constructed as a prior probability distribution of weight parameters of each layer of a Bayesian neural network (BNN); Step 4: in the variational inference training process of the BNN, a L2 regularization term of a posterior mean value is introduced into a loss function to punish the sum of squares of mean values in all weight distributions; Step 5: the BNN is trained based on the modified loss function, the posterior mean value parameter of the weight distribution is obtained, and the mean value parameter is mapped to the ReRAM array as a weight value for precision compensation. Specific embodiment ten: The difference between the embodiment ten and the embodiment nine is only that: A computer device comprises a memory and a processor, the memory stores a computer program, and the processor realizes a typical deep learning network precision compensation method for ReRAM random write errors when executing the computer program.

[0042] The method comprises the following steps: Step 1: in the ReRAM device, for a target conductance value G ideal , the same pulse number is repeatedly applied for multiple times, the conductance value after writing is recorded, and a probability distribution curve is obtained by using kernel density estimation (KDE); Step 2: the obtained conductance distribution is fitted as a normal distribution, the mean value is extracted, and the above steps are repeated under multiple target conductance values, and a function relationship between the standard deviation and the target conductance value is established; Step 3: Construct the prior distribution based on the function relationship obtained in step 2 as the prior probability distribution of the weight parameters of each layer of the Bayesian neural network; Step 4: During the variational inference training process of the BNN, modify the loss function to introduce an L2 regularization term for the posterior mean to punish the sum of squares of the mean items in all weight distributions; Step 5: Train the Bayesian neural network based on the modified loss function to obtain the posterior mean parameters of the weight distribution, and map the mean parameters as weight values to the ReRAM array for precision compensation. Embodiment eleven: The difference between embodiment eleven and embodiment ten is only that: The present application belongs to the field of artificial intelligence hardware acceleration and neural network model optimization, and specifically relates to a typical deep learning network precision compensation method for ReRAM random write errors, aiming to improve the inference robustness and accuracy when deploying neural networks on ReRAM arrays.

[0044] As Figure 1 shown, the implementation process of the present application includes five steps: Step one, in the ReRAM device, for the target conductance value G ideal , repeatedly apply the same pulse number multiple times, record the conductance value after writing, and use kernel density estimation (KDE) to obtain the probability distribution curve; In this embodiment, a series of target conductance values are selected, specifically 6 , 9 , 12 , 15 , 18 、 21 , 24 , 27 , write on the ReRAM device by applying a fixed number of pulses, and repeat 1000 times to record the final conductance value obtained by each writing. The data of each target conductance value is modeled using Gaussian kernel density estimation (KDE) for probability density, as Figure 2 shown, the obtained distribution is approximately normal distribution; In step one, the kernel density estimation used is Gaussian kernel function to smooth the probability density distribution of ReRAM write conductance value; Step two, fit the obtained conductance distribution as normal distribution, extract the mean , and repeat the above steps at multiple target conductance values to establish the function relationship between the standard deviation and the target conductance value , ; As Figure 3As shown, both have good linear correlation, and finally establish the error function model as follows:

[0045] Where k is the fitting coefficient, indicating that the higher the conductance value, the greater the error.

[0046] Step three, construct the prior distribution based on the function relationship obtained in step 2 as the prior probability distribution of each layer weight parameter of the Bayesian neural network (BNN); In this example, the error model is used to construct the prior distribution of each weight in the Bayesian neural network (BNN). For each weight in the trained traditional CNN network , its prior distribution is set as:

[0047] Where is determined by the above formula, that is, it is modeled differently according to the conductance value it maps.

[0048] Step four, in the variational inference training process of BNN, modify the loss function, in addition to containing the KL divergence between the expected negative log-likelihood item and the prior-posterior, further introduce the L2 regularization term of the posterior mean, to punish the sum of squares of the mean item in all weight distributions; In this example, the Bayesian neural network is trained using the variational Bayesian method. As Figure 4 shown, based on the standard variational inference loss function (ELBO), further introduce the posterior mean penalty term:

[0049] This regularization term constrains the mean of the posterior distribution, which helps to compress the weight amplitude, suppress the ReRAM error amplification effect, and improve the final deployment robustness.

[0050] In step four, the posterior mean penalty term is ; Where represents the mean of the i-th weight distribution, is the regularization coefficient for adjusting the influence degree of this term.

[0051] In step four, in the inference stage, a normal disturbance obeying the relationship is introduced for each write conductance in the ReRAM array to simulate the actual influence of ReRAM write error on network performance.

[0052] ​Step five, train the BNN based on the modified loss function to obtain the posterior mean parameter of the weight distribution, and map the mean parameter as the weight value to the ReRAM array for subsequent inference execution.

[0053] extract the posterior mean of each weight in the trained BNN , and as the conductance value mapped to the ReRAM array. By looking up the table or fitting the relationship, determine the number of pulses required to be applied for writing. In the inference stage, in order to more truly evaluate the influence of ReRAM error, a disturbance subject to can be introduced on the written conductance to simulate the inference accuracy under actual device error.

[0054] In step five, the trained weight mean is directly mapped as the conductance target value of the device in the ReRAM array, combined with the conductance-pulse relationship, and written by determining the number of pulses.

[0055] Experimental results show that this method can significantly improve the robustness of typical neural networks (such as LeNet, AlexNet, VGG, etc.). Compared with the original CNN or BNN scheme without error modeling, the inference accuracy is significantly improved under the same ReRAM writing error level, and has good generalization and practical deployment value.

[0056] The present application relates to a kind of depth learning network precision compensation methods for ReRAM random write error, belong to neural network model hardware mapping and inference optimization technical field.The method includes the following steps: on ReRAM device, multiple write is carried out to different target conductance value, and the probability distribution of conductance value error is established using kernel density estimation;The distribution obtained is fitted as normal distribution, and a function relationship between standard deviation and ideal conductance value is established;According to the function, the prior distribution of the weight in the Bayesian neural network (BNN) is constructed, and L2 regular penalty term is introduced to the posterior distribution mean in the training process, to suppress error amplification sensitivity;A group of robust weight mean is obtained by training, and is mapped to ReRAM array for inference.The method realizes the model level compensation of ReRAM hardware error, effectively improves the network inference precision and robustness without redundant mapping or online calibration, and has good universality and engineering practical value. DETAILED DESCRIPTION TWELVE The difference between the twelfth embodiment of the present application and the eleventh embodiment is only that: The present application provides a typical depth learning network precision compensation method for ReRAM random write error, comprising the following steps: Step one, in ReRAM device, for target conductance value G ideal, the same number of pulses are repeatedly applied, the conductance value after writing is recorded, and the probability distribution curve is obtained using kernel density estimation (KDE); Step two, the obtained conductance distribution is fitted as a normal distribution, and the mean value is extracted , and the above steps are repeated at multiple target conductance values to establish the standard deviation and the function relationship of the target conductance value G ideal , ; Step three, construct the prior distribution based on the function relationship obtained in step 2 as the prior probability distribution of the weight parameters of each layer of the Bayesian neural network (BNN); Step four, in the variational inference training process of BNN, modify the loss function, in addition to including the KL divergence between the expected negative log-likelihood term and the prior-posterior, further introduce the L2 regularization term of the posterior mean to punish the sum of squares of the mean term in all weight distributions; Step five, based on the modified loss function, train the BNN to obtain the posterior mean parameter of the weight distribution, and map the mean parameter as the weight value to the ReRAM array for subsequent inference execution.

[0058] In step one, the function relationship between the standard deviation and the target conductance value G ideal is a linear function: ; Wherein k is the proportionality coefficient fitted by multiple groups of ReRAM writing experiments.

[0059] Further, in step one, the kernel density estimation used is a Gaussian kernel function to smooth the probability density distribution of ReRAM writing conductance value.

[0060] In step four, the posterior mean penalty term is ; Wherein, represents the mean of the i-th weight distribution, is a regularization coefficient that adjusts the degree of influence of the term.

[0061] In step four, in the inference stage, a normal disturbance subject to the relationship is introduced to each writing conductance in the ReRAM array to simulate the actual influence of ReRAM writing error on network performance.

[0062] In step five, the trained weight mean is directly mapped as the conductance target value of the device in the ReRAM array, combined with the conductance-pulse relationship, and written by determining the pulse number.

[0063] Compared with the prior art, the present application establishes an error statistical model based on the characteristics of actual ReRAM devices, and constructs a - G mapping relationship.

[0064] The present application introduces a posterior mean penalty to further compress high error weights and improve system inference robustness; compared with existing solutions, without hardware redundancy or complex online training, precision improvement can be achieved through one-time training.

[0065] The above is only one preferred embodiment of the typical deep learning network precision compensation method for ReRAM random write error, and the protection scope of the typical deep learning network precision compensation method for ReRAM random write error is not limited to the above-mentioned embodiment. Any technical solution under the same idea belongs to the protection scope of the present application. It should be noted that for those skilled in the art, some improvements and changes without departing from the principles of the present application should also be considered as the protection scope of the present application.

Claims

1. A method for compensating accuracy of a typical deep learning network facing ReRAM random write error, characterized in that: The method comprises the following steps: Step 1: In the ReRAM device, for the target conductance value G ideal , the same number of pulses is repeatedly applied multiple times, the conductance value after writing is recorded, and the probability distribution curve is obtained using kernel density estimation (KDE). Step 2: Fit the resulting conductance distribution to a normal distribution, extract the mean, and repeat the above steps at multiple target conductance values to establish the standard deviation as a function of the target conductance value ​ Step 3: constructing a prior distribution based on the function relationship obtained in step 2 as the prior probability distribution of the weight parameters of each layer of the Bayesian neural network; Step 4: in the variational inference training process of the BNN, the loss function is modified, and an L2 regularization term of the posterior mean is introduced to punish the sum of squares of the mean items in all weight distributions; Step 5: based on the modified loss function, the Bayesian neural network is trained to obtain the posterior mean parameter of the weight distribution, and the mean parameter is mapped to the ReRAM array as the weight value for precision compensation.

2. The method of claim 1, wherein: Standard deviation The function relationship between the target conductance value is a linear function form: Wherein, k is a proportional coefficient fitted through a plurality of ReRAM write experiments.

3. The method of claim 1 or 2, characterized in that: The kernel density estimation KDE used in step 1 is a Gaussian kernel function to smooth the probability density distribution of the ReRAM write conductance value.

4. The method of claim 3, wherein: Step 3 is specifically: Construct the prior distribution based on the function relationship obtained in step 2 as the prior probability distribution of the weight parameters of each layer of the Bayesian neural network, and set the prior distribution of each weight in the trained traditional CNN network as: , the prior distribution is set as: 。 5. The method of claim 4, wherein: Step 4 is specifically: The BNN is trained using the variational Bayesian method, and a posterior mean penalty term is introduced based on the standard variational inference loss function ELBO: The regularization term constrains the mean of the posterior distribution, compresses the weight amplitude, and suppresses the ReRAM error amplification effect.

6. The method of claim 5, characterized in that: The posterior mean penalty term is: wherein, denotes the mean of the i-th weight distribution, is a regularization coefficient that adjusts the degree of influence of this term.

7. The method of claim 6, wherein: Step 5 is specifically: extracting the posterior mean of each weight in the trained bayesian neural network , as conductance values mapped to the ReRAM array, determine the number of pulses needed to be applied for writing by look-up table or fitting relationship, introduce perturbation on the written conductance following , simulate inference accuracy under actual device error.

8. A typical deep learning network precision compensation system for ReRAM random write error, characterized by: The system comprises: A data recording module, in a ReRAM device, for a target conductance value G ideal The same number of pulses is repeatedly applied multiple times, the conductance value after writing is recorded, and the probability distribution curve is obtained using kernel density estimation (KDE). a fitting module that fits the resulting conductance distribution to a normal distribution, extracts the mean value, and repeats the above steps at a plurality of target conductance values to establish a function relationship of the standard deviation to the target conductance value with the target conductance value ​ A model building module that constructs a prior distribution based on the obtained function relationship as the prior probability distribution of the weight parameters of each layer of the Bayesian neural network; A model training module that modifies the loss function and introduces an L2 regularization term of the posterior mean to punish the sum of squares of the mean items in all weight distributions in the variational inference training process of the BNN; A compensation module that trains the Bayesian neural network based on the modified loss function to obtain the posterior mean parameter of the weight distribution, and maps the mean parameter to the ReRAM array as the weight value for precision compensation.

9. A readable storage medium storing data in the form of electrical conductance, characterized in that, The system can perform operations locally on the storage device to realize compute-in-memory, and is used to implement a typical deep learning network precision compensation method for ReRAM random write errors.

10. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that: The processor implements a typical deep learning network precision compensation method for ReRAM random write errors when executing the computer program.

Citation Information

Patent Citations

  • Embedded digital twinning structure damage quantification method, equipment and medium

    CN119089326A

  • Unsupervised object-oriented decompositional normalizing flow

    US20230237819A1