METHOD AND APPARATUS FOR TRAINING MEMRISTOR-BASED NEURAL NETWORKS - Patent application
The hybrid training method for memristor-based neural networks addresses inefficiencies in von Neumann architectures and memristor non-idealities by combining off-chip programming with on-chip adjustments, enhancing energy efficiency and performance.
Patent Information
- Application Number
- JP2022525403
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2019-11-01
- Filing Date
- 2020-03-06
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2040-03-06
AI Technical Summary
Conventional hardware platforms for deep neural networks based on von Neumann architecture are energy-inefficient due to the high data transfer requirements between storage and calculation elements, and memristor-based systems face challenges from non-ideal characteristics like device-to-device non-uniformity and conductance drift, leading to performance degradation.
A hybrid training method for memristor-based neural networks that combines off-chip training to program memristor arrays with conductance values representing weight parameters, followed by on-chip adjustments to update these values, addressing non-ideal characteristics and simplifying the training process.
This approach enhances the energy efficiency and performance of neural networks by reducing complexity and cost, while mitigating issues like device yield and non-uniformity, thereby improving recognition accuracy.
Smart Images

Figure 00000021_0000 
Figure 00000021_0001 
Figure 00000021_0002
Abstract
Description
[Technical field]
[0001] This application claims priority to a Chinese patent application having application number 201911059194.1, filed on November 1, 2019, the entire contents of which are hereby incorporated by reference into this application.
[0002] SUMMARY OF THE DISCLOSURE The embodiments of the present disclosure relate to a method and an apparatus for training a memristor-based neural network. [Background technology]
[0003] The rise of deep neural network algorithms has brought about an intelligent information technology revolution. Based on various deep neural network algorithms, it can realize image recognition and segmentation, object detection, and complete speech and text translation, generation and other processes. Using deep neural network algorithms to process various workloads is a type of data-centric computation, and the hardware platform that realizes the algorithm requires high-performance and low-power processing capabilities. However, the traditional hardware platform for realizing the algorithm is based on a Von Neumann architecture that separates memory and computation, and this architecture requires data to be moved back and forth between memory elements and computation elements during computation. Therefore, the energy efficiency of the architecture is lower in the computation of deep neural networks that contain a large number of parameters. Therefore, developing a new type of computing hardware for running deep neural network algorithms has become an urgent problem to be solved. Summary of the Invention
[0004] At least one embodiment of the present disclosure provides a method for training a memristor-based neural network, the neural network including a plurality of neuron layers connected in series and weight parameters between the neuron layers, the training method including: training weight parameters of the neural network; programming a memristor array based on the trained weight parameters, and writing the trained weight parameters to the memristor array; and updating weight parameters of at least one layer of the neural network by adjusting at least a portion of a conductance value of the memristor array.
[0005] For example, in the training method provided by at least one embodiment of the present disclosure, the steps of training weight parameters of the neural network, programming a memristor array based on the trained weight parameters, and writing the trained weight parameters to the memristor array include, in the process of training weight parameters of the neural network, directly obtaining quantized weight parameters of the neural network according to constraints of conductance states of the memristor array, and writing the quantized weight parameters to the memristor array.
[0006] For example, in the training method provided by at least one embodiment of the present disclosure, the steps of training weight parameters of the neural network, programming a memristor array based on the trained weight parameters, and writing the trained weight parameters to the memristor array include: performing a quantization operation on the trained weight parameters based on constraints of a conductance state of the memristor array to obtain quantized weight parameters; and writing the quantized weight parameters to the memristor array.
[0007] For example, in the training method provided by at least one embodiment of the present disclosure, the quantization operation includes uniform quantization and non-uniform quantization.
[0008] For example, in the training method provided by at least one embodiment of the present disclosure, writing the quantized weight parameters to the memristor array includes obtaining a target interval of a conductance state of the memristor array based on the quantized weight parameters; determining whether the conductance state of each memristor of the memristor array is within the target interval, and if not, determining whether the conductance state of each memristor of the memristor array has exceeded the target interval, applying a reverse pulse if the conductance state has exceeded the target interval, applying a forward pulse if the conductance state has not exceeded the target interval, and writing the quantized weight parameters to the memristor array if the conductance state is within the target interval.
[0009] For example, in the training method provided by at least one embodiment of the present disclosure, the step of updating weight parameters of at least one layer of the neural network by adjusting the conductance values of some memristors in the memristor array includes: training the memristor array based on a forward arithmetic operation and a backward arithmetic operation; and applying a forward voltage or a reverse voltage to some memristors of the memristor array based on results of the forward arithmetic operation and the backward arithmetic operation to update the conductances of the some memristors of the memristor array.
[0010] For example, in a training method provided by at least one embodiment of the present disclosure, the backward computation operation is performed only on at least a portion of the memristors of the memristor array.
[0011] For example, in the training method provided by at least one embodiment of the present disclosure, the memristor array includes memristors arranged in an array of multiple rows and multiple columns, and the step of training the memristor array based on forward and backward arithmetic operations includes performing the forward and backward arithmetic operations on the multiple rows and columns of memristors of the memristor array in parallel, row by row, column by column, or as a whole.
[0012] For example, in the training method provided by at least one embodiment of the present disclosure, weight parameters corresponding to at least a portion of the memristors of the memristor array are updated row by row or column by column.
[0013] For example, in the training method provided by at least one embodiment of the present disclosure, the forward and backward calculation operations use only a portion of training set data to train the memristor array.
[0014] For example, in the training method provided by at least one embodiment of the present disclosure, updating weight parameters of at least one layer of the neural network by adjusting at least a portion of the conductance values of the memristor array includes updating weight parameters of a last layer or last layers of the neural network.
[0015] For example, the training method provided by at least one embodiment of the present disclosure further includes a step of the memristor array outputting an output result of the neural network based on the updated weight parameters.
[0016] At least one embodiment of the present disclosure further provides an apparatus for training a memristor-based neural network, including: an off-chip training unit configured to train weight parameters of the neural network, and program a memristor array based on the trained weight parameters, and write the trained weight parameters to the memristor array, and an on-chip training unit configured to adjust at least a portion of the conductance values of the memristor array to update weight parameters of at least one layer of the neural network.
[0017] For example, in a training apparatus provided by at least one embodiment of the present disclosure, the off-chip training unit includes an input unit and a read / write unit, and the on-chip training unit includes an arithmetic unit, an update unit and an output unit, wherein the input unit is configured to input trained weight parameters, the read / write unit is configured to write the trained weight parameters to the memristor array, the arithmetic unit is configured to train the memristor array based on a forward arithmetic operation and a backward arithmetic operation, the update unit is configured to apply a forward voltage or a reverse voltage to at least a portion of the memristor array based on results of the forward arithmetic operation and the backward arithmetic operation to update weight parameters corresponding to at least a portion of the memristor array, and the output unit is configured to calculate an output result of the neural network based on the updated weight parameters.
[0018] For example, in the training apparatus provided by at least one embodiment of the present disclosure, the off-chip training unit further includes a quantization unit, which is configured to, in a process of training weight parameters of the neural network, directly obtain quantized weight parameters of the neural network according to a constraint of a conductance state of the memristor array and write the quantized weight parameters into the memristor array, or to perform a quantization operation on the trained weight parameters to obtain quantized weight parameters based on a constraint of a conductance state of the memristor array.
[0019] For example, in the training apparatus provided by at least one embodiment of the present disclosure, the arithmetic unit is configured to perform the backward arithmetic operation only on at least a portion of the memristors of the memristor array.
[0020] For example, in the training apparatus provided by at least one embodiment of the present disclosure, the memristor array includes memristors arranged in an array of multiple rows and multiple columns, and the arithmetic unit is configured to perform the forward arithmetic operation and the backward arithmetic operation on the multiple rows and multiple columns of memristors of the memristor array in parallel, row by row, column by column, or as a whole.
[0021] For example, in the training apparatus provided by at least one embodiment of the present disclosure, the updating unit is configured to update weight parameters corresponding to at least a portion of the memristors of the memristor array in a row-by-row or column-by-column manner.
[0022] For example, in the training apparatus provided by at least one embodiment of the present disclosure, the on-chip training unit is further configured to update weight parameters of a last layer or last layers of the neural network.
[0023] In order to more clearly describe the technical solutions according to the embodiments of the present disclosure, the accompanying drawings of the embodiments are briefly introduced below. Obviously, the drawings in the following description are only related to some embodiments of the present disclosure, and are not intended to limit the present disclosure. [Brief description of the drawings]
[0024] [Figure 1] FIG. 1 is a schematic diagram of a neural network. [Diagram 2] FIG. 2 is a schematic structural diagram of a memristor array. [Diagram 3] FIG. 3 is a flowchart of a training method provided by at least one embodiment of the present disclosure. [Figure 4] FIG. 4 is a schematic diagram of the training method described in FIG. [Diagram 5] FIG. 5 is a flowchart of an example of a training method provided by at least one embodiment of the present disclosure. [Figure 6] FIG. 6 is a schematic diagram of the cumulative probability of a memristor in 32 conductance states provided by at least one embodiment of the present disclosure. [Figure 7] FIG. 7 is a flowchart of another example of a training method provided by at least one embodiment of the present disclosure. [Figure 8] FIG. 8 is a schematic diagram of a weight parameter distribution provided by at least one embodiment of the present disclosure. [Figure 9] FIG. 9 is a flowchart for writing weight parameters to a memristor array provided by at least one embodiment of the present disclosure. [Figure 10] FIG. 10 is a flowchart of yet another example of a training method provided by at least one embodiment of the present disclosure. [Figure 11A] FIG. 11A is a schematic diagram of a forward computation operation provided by at least one embodiment of the present disclosure. [Figure 11B]FIG. 11B is a schematic diagram of a backward computation operation provided by at least one embodiment of the present disclosure. [Figure 11C] FIG. 11C is a schematic diagram of an update operation provided by at least one embodiment of the present disclosure. [Figure 12A] FIG. 12A is a schematic diagram of an exemplary method of forward computation provided by at least one embodiment of the present disclosure. [Figure 12B] FIG. 12B is a schematic diagram of an exemplary method of forward arithmetic operations provided by at least one embodiment of the present disclosure. [Figure 12C] FIG. 12C is a schematic diagram of an exemplary method of forward arithmetic operations provided by at least one embodiment of the present disclosure. [Figure 12D] FIG. 12D is a schematic diagram of an exemplary method of forward arithmetic operations provided by at least one embodiment of the present disclosure. [Figure 13A] FIG. 13A is a schematic diagram of an exemplary method of backward computation provided by at least one embodiment of the present disclosure. [Figure 13B] FIG. 13B is a schematic diagram of an exemplary method of backward computation provided by at least one embodiment of the present disclosure. [Figure 13C] FIG. 13C is a schematic diagram of an exemplary method of backward computation provided by at least one embodiment of the present disclosure. [Figure 13D] FIG. 13D is a schematic diagram of an exemplary method of backward computation provided by at least one embodiment of the present disclosure. [Figure 14A] FIG. 14A is a schematic diagram of an example method of an update operation provided by at least one embodiment of the present disclosure. [Figure 14B] FIG. 14B is a schematic diagram of an example method of an update operation provided by at least one embodiment of the present disclosure. [Figure 14C] FIG. 14C is a schematic diagram of an example method of an update operation provided by at least one embodiment of the present disclosure. [Figure 14D]FIG. 14D is a schematic diagram of an example method of an update operation provided by at least one embodiment of the present disclosure. [Figure 15] FIG. 15 is a schematic block diagram of a neural network training apparatus provided in accordance with at least one embodiment of the present disclosure. [Figure 16] FIG. 16 is a schematic block diagram of an example of a training device provided in accordance with at least one embodiment of the present disclosure. [Figure 17] FIG. 17 is a schematic block diagram of another example of a training device provided in accordance with at least one embodiment of the present disclosure. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0025] In order to more clearly describe the objectives, technical solutions and advantages of the embodiments of the present disclosure, the technical solutions of the embodiments of the present disclosure will be described clearly and completely below with reference to the drawings of the embodiments of the present disclosure. It goes without saying that the described embodiments are only some of the embodiments of the present disclosure, and are not all of the embodiments. Based on the above-described embodiments of the present disclosure, any other embodiments that a person skilled in the art can obtain without requiring creative labor will fall within the scope of protection of the present disclosure.
[0026] Unless otherwise defined, technical or scientific terms used in this disclosure shall have the ordinary meaning as understood by a person skilled in the art to which this disclosure belongs. The words "first", "second" and similar words used in this disclosure do not denote any order, quantity, or importance, but are used only to distinguish different components. Similarly, similar words such as "one", "one", "the" and the like do not denote a quantity limit, but denote at least one. Similar words such as "comprise" or "contain" mean that the element or thing appearing before the word covers the element or thing listed after the word and their equivalents, but does not exclude other elements or things. Similar words such as "connected" or "coupled" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Top", "bottom", "left", "right", and the like are used only to indicate relative positions, and if the absolute positions of the objects described are changed, the relative positions may change accordingly.
[0027] Memristor-type devices (e.g., resistive memory, phase change memory, conductive bridge memory, etc.) are non-volatile devices whose conductance state can be adjusted by applying an external excitation. According to Kirchhoff's law and Ohm's law, an array composed of such devices can complete multiply accumulate operations in parallel, with both storage and computation occurring at each element of the array. Based on this computing architecture, in-memory computing can be realized, which does not require large amounts of data movement. At the same time, multiply accumulate operations are a core computing task required to operate neural networks. Therefore, the conductance of the memristor-type devices in the array can be used to represent weight values, and based on this in-memory computing, energy-efficient neural network operations can be realized.
[0028] At present, there are two main ways to realize deep neural network algorithms based on in-memory computing. One is the on-chip training (insitu training) method, that is, all the conductance weights of the neural network are obtained according to insitu training. In this method, based on the actual conductance weights, the forward and backward operations of the algorithm are realized, the conductance values of the weights are adjusted, and the whole training process is continuously repeated until the algorithm converges. The other is the off-chip training method, that is, the weight values of the network are first obtained by training on other hardware, and then, based on the weight target, the devices in the array are programmed to the conductance state corresponding to the corresponding weight value.
[0029] Memristor-type devices have various non-ideal characteristics, such as device-to-device non-uniformity, due to deviations in physical mechanisms and manufacturing processes. At the same time, the weight scale of deep neural networks is so large that multiple memristor arrays are required to fully map the weight parameters of deep neural networks. Thus, there are random variations between different arrays and between different devices in the same array, as well as problems such as device failure due to device yield and drift in the conductance state of devices. When implementing deep neural network algorithms based on in-memory computing, the non-ideal characteristics of these devices will degrade system functionality, such as reducing the accuracy of target recognition.
[0030] For example, when an on-chip training method is used to obtain all weight parameters, they can be adjusted by a self-adaptive algorithm, but it requires multiple cycles of training to be repeated end-to-end, which complicates the process (e.g., by a residual inverse transfer algorithm in the convolutional layer), and requires very high hardware costs. In addition, it is limited by the nonlinearity and asymmetry of the weight adjustment process of the memristor-type device, making it difficult to efficiently achieve a high-performance (e.g., high recognition rate) deep neural network by on-chip training.
[0031] For example, an off-chip training method can be used to train the weight parameters, and then the trained weight parameters can be programmed into a memristor array, i.e., the conductance value of each element in the memristor array can be used to represent the weight parameters of the neural network, and the inference calculation function of the neural network can be realized using the memristor array in in-memory computing. In this way, the training can be completed using an existing computing platform, but during the weight programming process, due to the influence of non-ideal characteristics such as device yield issues, non-uniformity, conductance drift, and random fluctuations, errors will inevitably occur in the process of writing the weights into the conductance of the device, leading to poor performance of the neural network system.
[0032] At least one embodiment of the present disclosure provides a method for training a memristor-based neural network, the neural network including a plurality of neuron layers connected in series and weight parameters between the neuron layers, the training method including: training the weight parameters of the neural network, and programming a memristor array based on the trained weight parameters to write the trained weight parameters to the memristor array; and updating the weight parameters of at least one layer of the neural network by adjusting at least a portion of the conductance values of the memristor array.
[0033] An embodiment of the present disclosure further provides a training device corresponding to the above training method.
[0034] The training method and training apparatus provided by the embodiments of the present disclosure make up for the shortcomings of on-chip and off-chip training methods used in deploying a neural network system on a hardware system based on a memristor array. From the perspective of a neural network system, the training method and training apparatus solve the problem of performance degradation of a neural network system caused by various non-ideal characteristics such as device variations, and can deploy various neural networks on a hardware system based on a memristor array efficiently and at low cost.
[0035] Hereinafter, embodiments and examples of the present disclosure will be described in detail with reference to the accompanying drawings.
[0036] As shown in FIG. 1, the neural network 10 includes an input layer 11, at least one hidden layer 12, and an output layer 13. For example, the neural network 10 includes L (L is an integer equal to or greater than 3) neuron layers connected in sequence. For example, the input layer 11 includes a first neuron layer, the at least one hidden layer 12 includes second to L-1 neuron layers, and the output layer 13 includes an L neuron layer. For example, the input layer 11 transmits received input data to the at least one hidden layer 12, and the at least one hidden layer 12 calculates and transforms the input data for each layer and transmits it to the output layer 13, which outputs the output result of the neural network 10. For example, as shown in FIG. 1, the layers of the neural network 10 are fully connected.
[0037] As shown in Fig. 1, the input layer 11, at least one hidden layer 12, and the output layer 13 each include multiple neuron nodes 14, and the number of neuron nodes 14 in each layer can be set according to various application situations. For example, when there are M pieces of input data (M is an integer greater than 1), the input layer 11 has M neuron nodes 14.
[0038] As shown in FIG. 1, two adjacent neuron layers of a neural network 10 are connected through a weight parameter network 15. For example, the weight parameter network is realized by a memristor array as shown in FIG. 2. For example, the weight parameters can be directly programmed into the conductance of the memristor array. For example, the weight parameters can be mapped into the conductance of the memristor array according to a certain rule. For example, the difference in the conductance of two memristors can be used to represent the weight parameters. The present disclosure describes the technical solution of the present disclosure by directly programming the weight parameters into the conductance of the memristor array or by mapping the weight parameters into the conductance of the memristor array according to a certain rule, which is merely an example and does not limit the present disclosure.
[0039] 2, a memristor array may include multiple memristors (e.g., memristor 1511) arranged in an array. For example, according to Kirchhoff's law, the output current of a memristor array can be determined according to the following equation:
number
[0040] In the above formula, v i denotes the voltage excitation input by neuron node i of the input layer, and i j denotes the output current of neuron node j in the next layer, and g i、j denotes the conductance matrix of the memristor array.
[0041] For example, a memristor array has a threshold voltage, and if the magnitude of the input voltage is less than the threshold voltage of the memristor array, the conductance of the memristor array will not change. In this case, by inputting a voltage lower than the threshold voltage, the memristor's conductance can be calculated, and by inputting a voltage higher than the threshold voltage, the memristor's conductance value can be changed.
[0042] At least one embodiment of the present disclosure provides a method for training a memristor-based neural network. FIG. 3 is a flowchart of the training method, and FIG. 4 is a schematic diagram of the training method. The training method can be implemented in software, hardware, firmware, or any combination thereof. Hereinafter, the neural network training method provided by the embodiment of the present disclosure will be described in detail with reference to FIG. 3 and FIG. 4. As shown in FIG. 3, the neural network training method includes steps S110 and S120.
[0043] Step S110: Train weight parameters of the neural network, and program the memristor array based on the trained weight parameters to write the trained weight parameters into the memristor array.
[0044] Step S120: Update weight parameters of at least one layer of the neural network by adjusting at least a portion of the conductance values of the memristor array.
[0045] For example, in the embodiment of the present disclosure, the training method is a hybrid training method. For example, step S110 is an off-chip training process, i.e., a training process before the weight parameters are written to the memristor array, and step S120 is an on-chip training process, i.e., a training process after the weight parameters are written to the memristor array. In the conventional on-chip training process, the weight parameters of the entire neural network need to be updated, but in the hybrid training method provided by the embodiment of the present disclosure, for example, as shown in FIG. 4, after the weight parameters of the neural network 10 are trained off-chip in step S110, the trained weight parameters are written to the memristor array, and in the on-chip training process described in step S120, it is only necessary to update and adjust the weight parameters of one key layer or multiple important layers in the neural network. That is, it is not necessary to update all of the weight parameters represented by the conductance values of all the memristor arrays. This can greatly simplify the complexity of memristor neural network systems while addressing non-ideal characteristics such as device yield issues, non-uniformity, conductance drift, and random fluctuations, reduce the overhead of neural network systems, and reduce the cost of implementing neural networks.
[0046] Furthermore, when the weight parameters of the neural network 10 provided by the embodiment of the present disclosure are trained off-chip in step S110, there is no need to consider the constraints when writing to the memristor array, that is, in the off-chip training process, as long as the weights are obtained by a basic algorithm, there is no need to consider the non-ideal factors of the memristor device, which can simplify the off-chip training process of the neural network. Of course, the constraints when writing to the memristor array can also be considered, and the embodiment of the present disclosure does not limit this.
[0047] The hybrid training process of the neural network is described in detail below.
[0048] In step S110, a neural network is trained off-chip to obtain weight parameters of the neural network. For example, the step further includes quantizing the weights according to the constraints of the conductance state of the memristor array used, and programming the quantized weight parameters into the memristor array. If the performance constraints of the memristor are taken into account in the off-chip training process, the quantized weight values that comply with the characteristics of the memristor can be directly obtained. If the performance constraints of the memristor are not taken into account during training, the trained weight parameters need to be quantized uniformly or non-uniformly according to the conductance state of the memristor, and the target weight parameters available for programming are obtained.
[0049] For example, in some examples, the process of training the weight parameters of the neural network can take into account the characteristics of the memristor device. For example, the constraints on the range of conductance values of each memristor in the memristor array (i.e., the constraints on the conductance states of the memristor array) can be taken into account. That is, in the process of training the weight parameters of the neural network off-chip, the weight parameters are constrained according to the range of conductance values of each memristor in the memristor array. In this case, the trained weight parameters can be directly written to the memristor array without scaling.
[0050] For example, Figure 5 is a flowchart of at least one example of step S110 shown in Figure 3. In the example shown in Figure 5, step S110 includes step S111.
[0051] Step S111: In the process of training the weight parameters of the neural network, directly obtain the quantized weight parameters of the neural network according to the constraints of the conductance states of the memristor array, and write the quantized weight parameters into the memristor array.
[0052] For example, a conductance state is usually represented by a corresponding read current under a fixed read voltage, which is the same in the following examples and will not be repeated here. For example, in some examples, assume that the range of conductance values of a memristor array, in which the weight parameters of a neural network are programmable, is (-3, -2, -1, 0, 1, 2, 3). Then, in the process of training the weight parameters of the neural network, according to the constraints of the conductance states of the memristor array, for example, quantized weight parameters in the range of (-3, -2, -1, 0, 1, 2, 3) can be directly obtained, and the quantized weight parameters can be directly written to the memristor array without scaling.
[0053] It should be noted that the constraints on the conductance states of the memristor array and the corresponding quantized weight parameter values are determined according to the actual situation and are not limited in the embodiments of the present disclosure. For example, FIG. 6 is a schematic diagram of the cumulative probabilities of the memristors in 32 conductance states provided by at least one embodiment of the present disclosure. As shown in FIG. 6, the cumulative probabilities of the memristors in the 32 conductance states do not overlap with each other, and the cumulative probabilities in each conductance state can reach 99.9% or more. The memristor array obtained by the training method shows good consistency in the 32 conductance states.
[0054] For example, in some other examples, the process of training the weight parameters of a neural network off-chip does not need to take into account system and device characteristics, i.e., constraints imposed by the range of conductance values of each memristor in a memristor array.
[0055] In this case, the trained weight parameters need to be scaled according to the range of conductance values of the memristor array, for example, by performing a quantization operation, i.e., scaling the trained weight parameters to be the same as the range of conductance values of the memristor array, and writing the trained weight parameters to the memristor array.
[0056] For example, Figure 7 is a flowchart of at least another example of step S110 shown in Figure 3. In the example shown in Figure 7, step S110 includes step S112.
[0057] Step S112: Based on the constraints of the conductance states of the memristor array, perform a quantization operation on the trained weight parameters to obtain quantized weight parameters, and write the quantized weight parameters into the memristor array.
[0058] For example, the conductance states are typically represented by corresponding read currents at a fixed read voltage. For instance, in this example, assume that the range of conductance values (i.e., the conductance state constraints) of the memristor array programmed with the neural network weight parameters is (-3, -2, -1, 0, 1, 2, 3).
[0059] For example, without taking into account the characteristics of the memristor, the trained weight parameters are continuous values, for example, from -1 to 1, expressed as floating-point numbers, and a quantization operation is performed to quantize the continuous weight parameters to weight parameters, for example, in the range of (-3, -2, -1, 0, 1, 2, 3), based on the constraints of the conductance state of the memristor array, and the quantized weight parameters are written to the memristor array.
[0060] It should be noted that the constraints on the conductance states of the memristor array and the corresponding values of the quantized weight parameters can be determined according to actual situations, and are not limited in the embodiments of the present disclosure.
[0061] For example, the quantization operation includes uniform quantization and non-uniform quantization.
[0062] For example, FIG. 8 shows an example of weight parameter distribution. In the example shown in FIG. 8, the trained weight parameters are continuous values from -1 to 1 expressed as floating point numbers. In the case of uniform quantization, the interval from -1 to 1 is evenly divided into seven intervals. For example, the quantized weight parameters are evenly divided into (-15, -10, -5, 0, 5, 10, 15), corresponding to the conductance state constraints (-3, -2, -1, 0, 1, 2, 3). For example, each quantized weight parameter is an integer multiple of the corresponding conductance state constraint, for example, 5 times, which is not limited in the embodiment of the present disclosure. In the case of non-uniform quantization, the interval (-a, a) is evenly divided into five intervals, corresponding to the quantized weight parameters of (-2, -1, 0, 1, 2), where a is greater than 0 and less than 1. For example, the interval (-1, -a) is scaled to correspond to the conductance state constraint of -3, and the interval (a, 1) corresponds to the conductance state constraint of 3. The interval division in the quantization operation and the corresponding relationship between the interval and the weight parameter can be set according to a specific situation, and are not limited in the embodiment of the present disclosure.
[0063] To more accurately write the quantized weight parameters (e.g., the quantized weight parameters obtained in steps S111 and S112) to the memristor array, for example, bidirectional write verification can be used.
[0064] 9 is a flowchart of writing weight parameters to a memristor array provided by at least one embodiment of the present disclosure. As shown in FIG. 9, the process of writing weight parameters to a memristor array includes the following steps:
[0065] Based on the quantized weighting parameters, a target interval of the conductance state of each memristor device in the memristor array is obtained, and a current corresponding to the conductance state of the memristor device is obtained, typically by applying a certain fixed voltage. The target interval of the conductance state is expressed as (It -ΔI, I t + ΔI), where I t is the current value of the conductance state under the particular read voltage, ΔI is the tolerance of the current corresponding to the conductance state, Determine whether the conductance state I of each memristor device in the memristor array is within a target interval, i.e., I t -ΔI≦I t Determine whether or not +ΔI is satisfied, If not within the target interval, determine whether the conductance state of each memristor device in the memristor array has exceeded the target interval, i.e., I>I t Determine whether or not +ΔI is satisfied, If the target section is exceeded, a reverse pulse (RESET pulse) is applied. If the target section has not been exceeded, a forward pulse (SET pulse) is applied. If it is within the target interval, the quantized weight parameters have been successfully written to the memristor array.
[0066] For example, in the two-way write verification process shown in Fig. 9, the maximum number of operations can be limited by setting a maximum number of operations N (N is an integer greater than 0). The following system describes the two-way write verification process.
[0067] For example, first, the initial operation count is set to r=0, the target interval for the conductance state is obtained, and the target interval for the conductance state is (I t -ΔI, I t+ΔI). Determine whether the number of operations reaches the maximum number of operations N, that is, determine whether r (r is 0 or more and N or less) is equal to N. If the number of operations reaches the maximum number of operations N and the conductance state of the memristor is not in the target interval, it indicates that programming has failed; if the number of operations does not reach the maximum number of operations N, determine whether the current conductance state is within the target interval, if it is within the target interval, it indicates that programming has been successful; if it is not within the target interval, determine whether the current memristor conductance value has exceeded the target interval, if it has exceeded the target interval, apply a reverse pulse (RESET pulse), and if it has not exceeded the target interval, apply a forward pulse (SET pulse) to adjust the current memristor conductance value. Then, repeat the above operations until the number of operations reaches the maximum number of operations N or programming is successful. Up to this point, the trained weight parameters can be written into the memristor array.
[0068] For example, an off-chip training unit can be provided, through which weight parameters of a neural network can be trained. For example, the off-chip training unit can be realized through a central processing unit (CPU), a field programmable gate array (FPGA), or other types of processing units with data processing and / or instruction execution capabilities and corresponding computer instructions. For example, the processing unit can be a general-purpose processor or a special-purpose processor, such as a processor based on an X86 or ARM architecture.
[0069] In step S120, for example, in-memory computing is performed on the memristor array in which the weight parameters are written, and based on the results of the in-memory computing, the conductance values of at least some of the memristors in the memristor array are adjusted to update the weight parameters of at least one layer of the neural network.
[0070] For example, in-memory computing may be forward and backward computation operations, although embodiments of the present disclosure are not limited thereto.
[0071] For example, the update operation may be realized by applying a forward voltage or a reverse voltage to the weight parameters of at least one layer, although the embodiments of the present disclosure are not limited thereto.
[0072] For example, Figure 10 is a flowchart of at least one example of step S120 shown in Figure 3. In the example shown in Figure 10, the training method includes steps S121 and S122.
[0073] Step S121: Train the memristor array based on the forward arithmetic operation and the backward arithmetic operation.
[0074] Step S122: Based on the results of the forward arithmetic operation and the backward arithmetic operation, a forward voltage or a reverse voltage is applied to some of the memristors in the memristor array to update the conductance of the some of the memristors in the memristor array.
[0075] For example, as shown in FIG. 10 , forward and backward arithmetic operations are performed on the memristor array in which the trained weight parameters are written, and based on the results of the forward and backward arithmetic operations, the conductance values of at least a portion of the memristors are updated to adjust the weight parameters corresponding to at least a portion of the memristors, and multiple cycles of training iterations are performed until finally converging, which is adaptively compatible with non-ideal characteristics such as device yield issues, non-uniformity, conductance drift, and random fluctuations, and can restore system performance such as improved recognition accuracy.
[0076] For example, a memristor has a threshold voltage, and when the magnitude of the input voltage is smaller than the threshold voltage of the memristor, the conductance of the memristor array is not changed. In this case, the forward arithmetic operation and the backward arithmetic operation are realized by inputting an input voltage smaller than the threshold voltage, and the update operation is realized by inputting an input voltage larger than the threshold voltage. Hereinafter, the processes of the forward arithmetic operation, the backward arithmetic operation and the update operation provided by at least one embodiment of the present disclosure will be described in detail with reference to the accompanying drawings.
[0077] 11A is a schematic diagram of a forward operation provided by at least one embodiment of the present disclosure. As shown in FIG. 11A, if the conductance weight parameter matrix equivalent to the memristor array is W, the input voltage less than the threshold voltage of the memristor array is V, and the corresponding output current is I, the forward operation of the corresponding neural network can be expressed as I=VW.
[0078] 11B is a schematic diagram of a backward operation provided by at least one embodiment of the present disclosure. As shown in FIG. 11B, the conductance weight parameter matrix equivalent to the memristor array is W, a voltage V smaller than the threshold voltage of the memristor array is input, and a current I is correspondingly output. In this case, the backward operation of the corresponding neural network is I=VW T It can be expressed as:
[0079] 11C is a schematic diagram of an update operation provided by at least one embodiment of the present disclosure. As shown in FIG. 11C, let W be the conductance weight parameter matrix equivalent to the memristor array, and V be the input voltage greater than the threshold voltage of the memristor array. 書き込み The corresponding update operation of the neural network is W = W 新 For example, V shown in FIG. 書き込み1 and V 書き込み2When the update operation is to increase the conductance of at least one memristor in the memristor array, a forward voltage is applied to the upper and lower electrodes of the at least one memristor, for example, V 書き込み1 and V 書き込み2 Thus, when the update operation is to decrease the conductance of at least one memristor in the memristor array, a reverse voltage is applied to the upper and lower electrodes of the at least one memristor.
[0080] For example, in step S121, forward calculation operations are performed on all the memristor arrays of the neural network, and backward calculation operations are performed on at least some of the memristors of the memristor arrays of the neural network. In the hybrid training method, it is only necessary to adjust the weight parameters of one key layer or multiple important layers in the neural network during the on-chip training process, and thus it is only necessary to perform backward calculation and update operations on the one key layer or multiple important layers in the neural network, thereby reducing the system overhead and the implementation cost of the system.
[0081] For example, in a training method provided by at least one embodiment of the present disclosure, forward and backward computation operations are performed on the memristor array in parallel, row by row, column by column, or as a whole.
[0082] 12A-12D are schematic diagrams of an example method of a forward arithmetic operation provided by at least one embodiment of the present disclosure. FIG. 12A illustrates an example method of performing a forward arithmetic operation row-by-row. In this example, the conductance weight parameter matrix equivalent to the memristor array is an n×m matrix, and voltages V1, V2, V3...V4 that are less than the threshold voltage of the memristor array are applied. m and the corresponding currents I1, I2, I3, …I n, V, ... V, which are all voltages V, V, V, ... V, which are all less than the threshold voltage of the memristor array. m and the corresponding currents I1, I2, I3, …I n , V ... m Enter the currents I1, I2, I3, …I n 12D shows an example method for performing the forward computation operations in parallel as a whole. In this example, the conductance weight parameter matrix equivalent to the memristor array is an m×n matrix, and the voltages V1, V2, V3...V are all less than the threshold voltage of the memristor array. m Input the currents I1, I2, I3, …I n Suppose we want to output
[0083] 13A-13D are schematic diagrams of an example method of a backward arithmetic operation provided by at least one embodiment of the present disclosure. FIG. 13A illustrates an example method of performing a backward arithmetic operation column-by-column. In this example, the conductance weight parameter matrix equivalent to the memristor array is an n×m matrix, and voltages V1, V2, V3...V4 at the output of the memristor array that are less than the threshold voltage of the memristor array are applied. n and the corresponding currents I1, I2, I3, …I m , V ... nand the corresponding currents I1, I2, I3, …I m , V ... n Input the current I1, I2, I3, …I m 13D shows an example method for performing the backward arithmetic operations in parallel as a whole. In this example, the conductance weight parameter matrix equivalent to the memristor array is an m×n matrix, and the voltages V1, V2, V3...V are all less than the threshold voltage of the memristor array. n Enter the currents I1, I2, I3, …I m are output in parallel.
[0084] For example, in the training method provided by at least one embodiment of the present disclosure, weight parameters corresponding to at least a portion of the memristors of the memristor array are updated row by row or column by column.
[0085] 14A-14D are schematic diagrams of an example method of an update operation provided by at least one embodiment of the present disclosure. FIG. 14A illustrates an example method of performing an update operation row-by-row. In this example, assuming that a conductance weight parameter matrix equivalent to a memristor array is an n×m matrix, the n×m weight parameter matrix is updated row-by-row. When updating a particular row of the n×m weight parameter matrix, for example, when updating the conductance of any two discontinuous memristors in a particular row, a memristor in the row that needs to have its conductance increased is applied with V SET1 and V SET2 (For example, V SET1 and V SET2is a forward voltage) is applied to the upper and lower electrodes of the memristor in the row that needs to reduce its conductance. RESET1 and V RESET2 (For example, V RESET1 and V RESET2 FIG. 14B shows an exemplary method for performing the update operation row by row. In this example, assuming that the conductance weight parameter matrix equivalent to the memristor array is an m×n matrix, the m×n weight parameter matrix is updated row by row. When updating a particular row of the m×n weight parameter matrix, for example, when updating the conductance of any two consecutive memristors in a particular row, a voltage V is applied to the top and bottom electrodes of the memristors in the row that need to have their conductance increased, respectively. SET1 and V SET2 (For example, V SET1 and V SET2 is a forward voltage) is applied to the upper and lower electrodes of the memristor in the row that needs to reduce its conductance. RESET1 and V RESET2 (For example, V RESET1 and V RESET2 FIG. 14C illustrates an exemplary method for performing the update operation column-by-column. In this example, assuming that the conductance weight parameter matrix equivalent to the memristor array is an n×m matrix, the n×m weight parameter matrix is updated column-by-column. When updating a particular column of the n×m weight parameter matrix, for example, when updating the conductance of any two memristors in a particular column or one memristor located at an end point of the column, a voltage V is applied to the top and bottom electrodes of the memristor in the column that needs to have its conductance increased, respectively. SET1 and V SET2 (For example, V SET1 and V SET2 is a forward voltage) is applied to the upper and lower electrodes of the memristors in the column that need to reduce their conductance, respectively. RESET1 and V RESET2 (For example, V RESET1 and V RESET2FIG. 14D illustrates an exemplary method for performing the update operation column-by-column. In this example, assuming that the conductance weight parameter matrix equivalent to the memristor array is an m×n matrix, the m×n weight parameter matrix is updated column-by-column. When updating a particular column of the m×n weight parameter matrix, for example, when updating the conductance of any two discontinuous memristors in a particular column or one memristor located at the center position of the column, a voltage V is applied to the top and bottom electrodes of the memristor in the column that needs to have its conductance increased. SET1 and V SET2 (For example, V SET1 and V SET2 is a forward voltage) is applied to the upper and lower electrodes of the memristor in the row that needs to reduce its conductance. RESET1 and V RESET2 (For example, V RESET1 and V RESET2 A reverse voltage is applied.
[0086] For example, in the training method provided by at least one embodiment of the present disclosure, only a portion of the training set data is used in the on-chip training process, for example, when training off-chip, data set A is used, and when training on-chip, data set B is used, where B is a subset of A.
[0087] For example, when training the memristor array through forward and backward computational operations, only a portion of the training set data is used, e.g., when training off-chip, data set A is used, and when performing forward and backward computational operations, data B is used, where B is a subset of A.
[0088] Using only a portion of the training set in the on-chip training process (e.g., forward and backward calculation operations) can reduce the computational workload of the on-chip training process (e.g., forward and backward calculation operations), simplifying the system complexity and reducing the system overhead.
[0089] For example, in the training method provided by at least one embodiment of the present disclosure, weight parameters of the last layer or the last layers of the neural network are updated. For example, in step S120, at least a part of the conductance values of the memristor array are adjusted to update the weight parameters of the last layer or the last layers of the neural network. For example, in step S122, a forward voltage or a reverse voltage is applied to at least some of the memristors of the memristor array of the last layer or the last layers of the neural network based on the results of the forward arithmetic operation and the backward arithmetic operation to update the weight parameters corresponding to at least some of the memristors of the memristor array of the last layer or the last layers of the neural network.
[0090] For example, the training method provided by at least one embodiment of the present disclosure further includes a step of the memristor array calculating and outputting an output result of the neural network based on the updated weight parameters. For example, data is inputted at an input layer of the hybrid trained neural network, and an output result of the neural network is outputted at an output layer of the hybrid trained neural network. For example, in the process of outputting the data, a discretization processing operation is performed on the output data of the hybrid trained neural network, i.e., it is converted into a digital signal.
[0091] For example, an on-chip training unit can be provided that adjusts at least a portion of the conductance values of the memristor array to update weight parameters of at least one layer of the neural network, for example, the on-chip training unit can be implemented as a memristor array.
[0092] It should be noted that in the embodiments of the present disclosure, the flow of the training method may include more or less operations that can be performed sequentially or in parallel. Although the flow of the above training method includes multiple operations that are performed in a specific order, it should be clearly understood that the order of the multiple operations is not limited. The above training method can be performed once or multiple times according to a predetermined condition.
[0093] The training method provided by the embodiments of the present disclosure makes up for the shortcomings of the on-chip training method and the off-chip training method used in deploying a neural network system on a hardware system based on a memristor array. From the perspective of a neural network system, the training method solves the problem of performance degradation of the neural network system caused by various non-ideal characteristics such as device variations, and enables various neural networks to be deployed on a hardware system based on a memristor array efficiently and at low cost.
[0094] 15 is a schematic block diagram of a neural network training apparatus provided by at least one embodiment of the present disclosure. For example, as shown in FIG 15, the training apparatus 200 includes an off-chip training unit 210 and an on-chip training unit 220. For example, these units can be realized in the form of hardware (e.g., circuits), software, or firmware, and any combination thereof.
[0095] The off-chip training unit 210 is configured to train weight parameters of a neural network, program a memristor array based on the trained weight parameters, and write the trained weight parameters into the memristor array. For example, the off-chip training unit can perform step S110, and a specific implementation method thereof can refer to the relevant description of step S110, which will not be repeated here.
[0096] The on-chip training unit 220 is configured to adjust at least a part of the conductance values of the memristor array to update weight parameters of at least one layer of the neural network. For example, the on-chip training unit can perform step S120, and the specific implementation method thereof can refer to the relevant description of step S120, which will not be repeated here.
[0097] Fig. 16 is a schematic block diagram of an example of a training apparatus for the neural network shown in Fig. 15. For example, as shown in Fig. 16, the off-chip training unit 210 includes an input unit 211 and a read / write unit 212, and the on-chip training unit 220 includes an arithmetic unit 221, an update unit 222, and an output unit 223. For example, these units can be realized in the form of hardware (e.g., a circuit), software or firmware, and any combination thereof.
[0098] The input unit 211 is configured to input the trained weight parameters. For example, the input unit 211 is connected to the input layer 11 of the neural network 10, and processes the data signal into the input data required for the neural network 10. For example, the input unit 211 can be realized by, for example, hardware, software, firmware, or any combination thereof.
[0099] The read / write unit 212 is configured to write the trained weight parameters to the memristor array. For example, the read / write unit writes the weight parameters to the memristor array by applying a voltage (for example, a forward voltage or a reverse voltage) to the memristor array. For example, the read / write unit can perform the bidirectional write verification shown in FIG. 9, and the specific implementation method thereof can refer to the relevant description of the bidirectional write verification shown in FIG. 9, and will not be repeated here.
[0100] The arithmetic unit 221 is configured to train the memristor array based on forward arithmetic operations and backward arithmetic operations. For example, the arithmetic unit can perform step S121, and the specific implementation method thereof can refer to the relevant description of step S121, which will not be repeated here.
[0101] The update unit 222 is configured to apply a forward voltage or a reverse voltage to at least a part of the memristor array according to the results of the forward arithmetic operation and the backward arithmetic operation, and update the weight parameters corresponding to at least a part of the memristor array. For example, the arithmetic unit can perform step S122, and the specific implementation method thereof can refer to the relevant description of step S122, which will not be repeated here.
[0102] The output unit 223 is configured to calculate an output result of the neural network based on the updated weight parameters. For example, the output unit 223 is connected to the output layer 13 of the neural network 10, and outputs the output data of the hybrid trained neural network 10. For example, the output unit 223 can be realized by, for example, hardware, software, firmware, or any combination thereof. For example, the output unit 223 can perform a discretization processing operation on the output data of the hybrid trained neural network 10 through an ADC (analog-to-digital converter), i.e., convert it into a digital signal.
[0103] Fig. 17 is a schematic block diagram of an example of a training apparatus for the neural network shown in Fig. 16. For example, as shown in Fig. 17, the off-chip training unit 210 further includes a quantization unit 213.
[0104] In the process of training the weight parameters of the neural network, the quantization unit 213 is configured to directly obtain the quantized weight parameters of the neural network according to the constraints of the conductance state of the memristor array, and write the quantized weight parameters into the memristor array, or to perform a quantization operation on the trained weight parameters based on the constraints of the conductance state of the memristor array to obtain the quantized weight parameters. For example, the quantization unit can perform step S111, the specific implementation method of which may refer to the relevant description of step S111 and will not be repeated here, or the quantization unit can also perform step S112, the specific implementation method of which may refer to the relevant description of step S112 and will not be repeated here.
[0105] For example, in a training device provided by at least one embodiment of the present disclosure, the arithmetic unit 221 performs backward arithmetic operations only on at least some of the memristors in the memristor array, the specific implementation of which is as described above and will not be repeated here.
[0106] For example, in a training device provided by at least one embodiment of the present disclosure, the calculation unit 221 performs forward calculation operations, backward calculation operations in parallel row by row, column by column, or as a whole, and for specific implementation methods thereof, reference may be made to the relevant descriptions in Figures 12A to 12D and Figures 13A to 13D, which will not be repeated here.
[0107] For example, in the training apparatus provided by at least one embodiment of the present disclosure, the update unit performs an update operation row by row or column by column, and for the specific implementation method thereof, reference may be made to the relevant descriptions in Figures 14A to 14D, which will not be repeated here.
[0108] For example, in the training device provided by at least one embodiment of the present disclosure, the on-chip training device is configured to update weight parameters of the last layer or the last layers of the neural network, the specific implementation method of which is as described above and will not be repeated here.
[0109] It should be noted that, for the sake of clarity and conciseness, the embodiment of the present disclosure does not provide all the constituent units of the neural network training apparatus 200. To achieve the required functions of the training apparatus 200, a person skilled in the art can provide or configure other unillustrated constituent units according to specific needs, and the embodiment of the present disclosure is not limited thereto.
[0110] Regarding the technical effects of the training apparatus 200 in different embodiments, reference may be made to the technical effects of the neural network training method provided in the embodiments of the present disclosure, which will not be repeated here.
[0111] The following points should be noted: (1) The drawings of the embodiments of the present disclosure relate only to the structures related to the embodiments of the present disclosure, and other structures may refer to the general design. (2) Unless inconsistent, the embodiments and features of the embodiments of the present disclosure may be combined with each other to obtain new embodiments.
[0112] The above description is merely an exemplary implementation method of the present disclosure, and is not intended to limit the protection scope of the present disclosure, which is determined by the appended claims.
Claims
1. A method for training a memristor-based neural network, the neural network including a plurality of neuron layers connected in series and weight parameters between the neuron layers, the training method comprising: training weight parameters of the neural network by an off-chip training unit, and programming a memristor array based on the trained weight parameters to write the trained weight parameters to the memristor array; and updating weight parameters of one or more key layers of the neural network by adjusting the conductance values of at least a portion of the memristors of the memristor array by an on-chip training unit.
2. training weight parameters of the neural network, and programming a memristor array based on the trained weight parameters to write the trained weight parameters to the memristor array; 2. The training method of claim 1, wherein in the process of training weight parameters of the neural network, the training method comprises: directly obtaining quantized weight parameters of the neural network according to constraints of conductance states of the memristor array, and writing the quantized weight parameters to the memristor array.
3. training weight parameters of the neural network, and programming a memristor array based on the trained weight parameters to write the trained weight parameters to the memristor array; performing a quantization operation on the trained weight parameters based on a constraint on the conductance state of the memristor array to obtain quantized weight parameters; and writing the quantized weight parameters to the memristor array.
4. The method of claim 3 , wherein the quantization operation includes uniform quantization and non-uniform quantization.
5. The step of writing the quantized weight parameters to the memristor array includes: obtaining a target interval of conductance states of the memristor array based on the quantized weighting parameters; determining whether a conductance state of each memristor in the memristor array is within the target interval; if not within the target interval, determining whether the conductance state of each memristor of the memristor array has exceeded the target interval; When the target section is exceeded, a reverse pulse is applied; If the target interval has not been exceeded, a forward pulse is applied; If the quantized weight parameters are within the target interval, writing the quantized weight parameters to the memristor array.
6. The step of updating weight parameters of one or more key layers of the neural network by adjusting the conductance values of at least some of the memristors in the memristor array includes: training the memristor array based on forward and backward computation operations; and applying a forward voltage or a reverse voltage to at least some of the memristors of the memristor array based on results of the forward arithmetic operation and the backward arithmetic operation to update conductance values of at least some of the memristors of the memristor array.
7. The training method according to claim 6 , further comprising performing the backward calculation operation only on at least a portion of the memristors in the memristor array.
8. The memristor array includes memristors arranged in an array of multiple rows and multiple columns, and training the memristor array based on forward and backward arithmetic operations includes:
8. The method of claim 6 or 7, comprising performing the forward and backward arithmetic operations on multiple rows and multiple columns of memristors of the memristor array in parallel, row by row, column by column, or as a whole.
9. The training method of claim 6 , further comprising updating weight parameters corresponding to at least a portion of the memristors of the memristor array row by row or column by column.
10. The method of claim 6 or 7, wherein the forward and backward calculation operations use only a portion of training set data to train the memristor array.
11. The step of updating weight parameters of one or more key layers of the neural network by adjusting the conductance values of at least a portion of the memristors of the memristor array includes: A training method according to any one of claims 1 to 10, comprising the step of updating weight parameters of the last layer or last layers of the neural network.
12. The training method according to any one of claims 1 to 11, further comprising the step of: the memristor array outputting an output result of the neural network based on the updated weight parameters.
13. 1. An apparatus for training a memristor-based neural network, comprising: an off-chip training unit configured to train weight parameters of the neural network, and program a memristor array based on the trained weight parameters to write the trained weight parameters to the memristor array; and an on-chip training unit configured to adjust the conductance values of at least a portion of the memristors in the memristor array to update weight parameters of one or more key layers of the neural network.
14. The off-chip training unit includes an input unit and a read / write unit, and the on-chip training unit includes a calculation unit, an update unit and an output unit; The input unit is configured to input trained weight parameters; the read / write unit is configured to write the trained weight parameters to the memristor array; the computation unit is configured to train the memristor array based on a forward computation operation and a backward computation operation; the update unit is configured to apply a forward voltage or a reverse voltage to at least some of the memristors of the memristor array according to results of the forward arithmetic operation and the backward arithmetic operation, and update weight parameters corresponding to at least some of the memristors of the memristor array; The training device according to claim 13, wherein the output unit is configured to calculate an output result of the neural network based on the updated weight parameters.
15. 15. The training apparatus of claim 14, wherein the off-chip training unit further includes a quantization unit, which is configured to, in a process of training weight parameters of the neural network, directly obtain quantized weight parameters of the neural network according to constraints of a conductance state of the memristor array and write the quantized weight parameters to the memristor array, or to perform a quantization operation on the trained weight parameters to obtain quantized weight parameters based on constraints of a conductance state of the memristor array.
16. The training device according to claim 14 or 15, wherein the arithmetic unit is configured to perform the backward arithmetic operation only on at least a portion of the memristors of the memristor array.
17. the memristor array includes memristors arranged in an array of multiple rows and multiple columns; 17. The training apparatus of claim 14, wherein the arithmetic unit is configured to perform the forward arithmetic operations and the backward arithmetic operations on multiple rows and multiple columns of memristors of the memristor array in parallel, row by row, column by column, or as a whole.
18. The training apparatus according to any one of claims 14 to 17, wherein the updating unit is configured to update weight parameters corresponding to at least a portion of the memristors of the memristor array row by row or column by column.
19. The training apparatus according to any one of claims 13 to 18, wherein the on-chip training unit is further configured to update weight parameters of a last layer or last layers of the neural network.
Citation Information
Patent Citations
OCT image quality evaluation method based on improved Resnet and SVR hybrid model
CN109308692A
A convolution neural network-on-chip learning system based on nonvolatile memory
CN109460817A
Neural network online learning system based on a memristor
CN109800870A
Memristor Neuromorphic Circuit and Method for Training a Memristor Neuromorphic Circuit
JP2018521400A
Method for training artificial neural network circuit, training program, and training device
JP2019003547A
