# US 2024/0005134 A1 · Neural network retraining and gradient sparse method based on aging sensing of memristors

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2024/0005134 A1
- Document ID: US20240005134A1
- Status: Published application
- Kind: A1
- Application number: 18/028,566
- Filed: 2022-04-29
- Published: 2024-01-04
- Earliest claimed: 2022-04-22
- Assignees: Zhejiang University
- Applicants: Zhejiang University
- Inventors: Xunzhao YIN; Wenwen YE; Cheng ZHUO
- Web page: https://patentgrep.com/patent/US20240005134A1

## CPC

- G06N 3/063: using electronic means
- G06N 3/065: Analogue means
- G06N 3/084: Backpropagation, e.g. using gradient descent
- G06N 3/096: Transfer learning
- Y02D 10/00: Energy efficient computing, e.g. low power processors, power management or thermal management
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- Y02D: CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE

## Abstract

The invention discloses a neural network retraining and gradient sparse method based on the aging sensing of memristors. For the accuracy rate of hardware online reasoning decreases after cross-array aging, the extreme values of programmable weights under a current aging condition is calculated by using the known aging information of memristor, and a neural network model is retrained according to this, so as to improve the accuracy rate of the current hardware online reasoning. In the process of retraining, network weights exceeding the extreme values of programmable weights are automatically truncated. For the working life of the memristor, the sparsity of derivatives of the neural network is utilized to discard the derivatives with a small absolute value in hardware adjustment process, so as to ensure that the memristor corresponding to small derivatives would not be applied voltage, prevent the aging process of the memristors and prolong the service life thereof.

## Claims

### Claim 1

A neural network retraining and gradient sparse method based on the aging sensing of a memristor, wherein the method comprises following steps:
S1: collecting aging information of the memristor and calculating an effective programmable resistance range of an aged memristor:
Rmaxaged=Rmaxfresh−G(T,t)
Rminaged=Rminfresh−H(T,t)
wherein, Rmaxaged and Rminaged are respectively a maximum value and a minimum value of a programmable resistance after aging of the memristors of a cross-array; Rmaxfresh and Rminfresh are respectively a maximum programmable resistance and a minimum programmable resistance that can be stored by a new memristor; and G(T, t) and H(T, t) are Arrhenius aging equations, of which parameters can be extracted through measurement data;
S2: based on the effective programmable resistance range obtained in the S1, calculating reciprocal values respectively to obtain a programmable conductivity range of the aged memristor in which the maximum and minimum values are respectively Gmaxaged and Gminaged, and calculating a maximum value and a minimum values of programmable weight parameters in a neural network task to be executed according to following formula:
W
min
aged
=
(
G
min
aged
-
G
min
fresh
)
⁢
W
max
-
W
min
G
max
fresh
-
G
min
fresh
+
W
min
⁢
W
max
aged
=
(
G
max
aged
-
G
min
fresh
)
⁢
W
max
-
W
min
G
max
fresh
-
G
min
fresh
+
W
min
wherein, Gmaxfresh and Gminfresh are respectively a maximum conductance and a minimum conductance that can be stored by the new memristor in the cross-array, and Wmaxaged and Wminaged are respectively a maximum value and a minimum value of the programmable weights corresponding to the cross-array, and Wmax and Wmin are respectively a maximum value and a minimum value of synaptic weights in an initial model of a neural network;
S3: retraining an existing neural network model based on extreme values of the programmable weight parameters of the neural network;
S4: mapping an adjusted synaptic weight parameters of the neural network to the cross-array based on the memristor so as to obtain a resistance value of a basic memory unit;
S5: classifying derivatives into two groups according to a positive value or a negative value of the derivatives obtained by a neural network backward propagation method, calculating the average values of the two groups of derivatives of the positive value and the negative value respectively, and ignoring the derivatives of which absolute values are lower than an average values, that is, setting the derivatives as 0; and then performing online hardware fine tuning on a resistance stored by a corresponding memristor according to a current derivative value, that is, applying a positive voltage or a negative voltage corresponding to a derivative symbol to the memristor:
V
ij
=
{
+
V
0
if
⁢
grad
ij
<
0
-
V
0
if
⁢
grad
ij
>
0
wherein, gradij is the derivative obtained by calculating the derivative of neural network Loss function value Loss with respect to weight wij, Loss is a hardware reasoning result and an actual loss function value; V0 is a standard voltage applied to an memristor memory unit during online adjustment; Vij is the voltage applied to the memristor memory unit in row i and column j of the cross-array; and
repeating the steps until an online hardware reasoning accuracy rate thereof meets an requirement, which is manually specified.

### Claim 2 (depends on 1)

The neural network retraining and gradient sparse method based on the aging sensing of memristors according to claim 1, wherein the S3 specifically comprises:
truncating a weight beyond a range of programmable parameters and directly assigning the truncated weight as a maximum weight value or a minimum weight value nearest from a current value, and based on current truncated parameters, propagating backward the neural network to obtain the derivatives and continuing to adjust the parameters; and repeating above operations until the current truncated parameters meet a programmable weight range and an accuracy rate of a simulation reasoning is not significantly reduced.

### Claim 3 (depends on 2)

The neural network retraining and gradient sparse method based on the aging sensing of memristors according to claim 2, wherein the S4 specifically comprises:
S4.1: according to a mapping relationship between the weight and a conductance, calculating the conductance value G that should be stored by all of the memristors of the cross-array corresponding to all of the synaptic weights W of the neural network, wherein the mapping relationship is as follows:
G
=
G
max
-
G
min
W
max
-
W
min
⁢
(
W
-
W
min
)
+
G
min
wherein, Wmax and Wmin are respectively a maximum value and a minimum value of the synaptic weights in the neural network model, and Gmax and Gmin are respectively the a maximum value and a minimum value of a programmable effective conductance of the memristor;
S4.2: according to a reciprocal relationship between the conductance and the resistance, calculating a reciprocal of a calculated conductance to obtain the resistance value that should be stored by all of the memristors in the cross-array: R=1/G, and, Rmax=1/Gmin and Rmin=1/Gmax, Rmax and Rmin are respectively a maximum value and a minimum value of the programmable resistance of the memristor;
S4.3: applying a voltage to the memristor memory unit corresponding to a synaptic position of the neural network so as to store a nearest quantized resistance corresponding to a calculated resistance R.

### Claim 4 (depends on 1)

The neural network retraining and gradient sparse method based on the aging sensing of memristors according to claim 1, wherein, in the S2, calculating the programmable the maximum value and the minimum value of the weights of the neural network is performed with a maximum value and a minimum value of each layer respectively searched according to the programmable weight of each layer of a current neural network, and an extreme value of a current programmable conductance of the memristor corresponding to each layer of the neural network.

### Claim 5 (depends on 2)

The neural network retraining and gradient sparse method based on the aging sensing of memristors according to claim 2, wherein, in the S2, calculating the programmable the maximum value and the minimum value of the weights of the neural network is performed with a maximum value and a minimum value of each layer respectively searched according to the programmable weight of each layer of a current neural network, and an extreme value of a current programmable conductance of the memristor corresponding to each layer of the neural network.

### Claim 6 (depends on 3)

The neural network retraining and gradient sparse method based on the aging sensing of memristors according to claim 3, wherein, in the S2, calculating the programmable the maximum value and the minimum value of the weights of the neural network is performed with a maximum value and a minimum value of each layer respectively searched according to the programmable weight of each layer of a current neural network, and an extreme value of a current programmable conductance of the memristor corresponding to each layer of the neural network.
