Large-scale deployment method and device of memristor Bayesian convolutional neural network
By utilizing the non-volatile and randomness of memristors in Bayesian convolutional neural networks, Bayesian convolutional layer training and kernel replication are solved, and the problem that traditional computing platforms cannot meet the high speed and efficiency requirements of BCNNs is realized, and efficient deployment of large-scale BCNNs is achieved.
Patent Information
- Application Number
- CN202411871439.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-05-23
AI Technical Summary
Traditional deterministic computing platforms cannot meet the high speed and efficiency requirements of Bayesian convolutional neural networks.
By utilizing the non-volatile and randomness of the memristor, the relevant data of read noise and write noise are determined based on the conductance of the memristor, the convolution characteristics and complexity cost are calculated, and Bayesian convolution layer training is performed to obtain the write target conductance that meets the preset conditions, and kernel replication is performed, and the BCNN weight is deployed to the memristor array.
It realizes efficient deployment on large-scale BCNNs, adapts to application needs of various scales, and solves the problem that the deterministic computing platform cannot meet the high speed and efficiency requirements of Bayesian convolutional neural networks.
Smart Images

Figure CN120031086A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electrical digital data processing, and in particular to a large-scale deployment method and device of a memristive Bayesian convolutional neural network. Background Art
[0002] BCNNs (Bayesian convolutional neural networks) represent an important class of probabilistic brain computing algorithms. The main advantage of BCNNs over traditional convolutional neural networks with deterministic weights is that they are able to estimate the confidence (or uncertainty) of predictions, thereby providing reliable prediction results. When processing data with significant spatial correlations (such as images and videos), BCNNs are generally more effective and efficient than Bayesian fully-connected neural networks (BFCNN). This has led to the widespread use of BCNNs in safety-critical AI systems, including self-driving cars, medical diagnostic systems, and automatic trading.
[0003] However, conventional complementary metal oxide semiconductor (CMOS) based deterministic computing platforms have been unable to meet the high speed and efficiency requirements of BCNNs. The unique ability of BCNNs to estimate uncertainty is provided by its core convolutional component - the probabilistic convolution kernel. Therefore, the two core computing tasks of BCNNs, GRNG (Gaussian random number generation) and MVM (matrix-vector multiplication), both require a large number of GRNG and high-bandwidth data transmission. Due to the von Neumann bottleneck (derived from the separation of storage and computation) and the limitations of further miniaturized CMOS technology, deterministic platforms based on CMOS circuits, such as CPUs and GPUs, have been unable to meet these performance requirements.
[0004] In summary, the deterministic computing platform in the relevant technology has technical limitations and cannot meet the high speed and efficiency requirements of Bayesian convolutional neural networks, and needs to be improved. Summary of the invention
[0005] The present application provides a large-scale deployment method and device for a memristive Bayesian convolutional neural network to solve the technical problem in the related art that the deterministic computing platform has technical limitations and cannot meet the high speed and efficiency requirements of the Bayesian convolutional neural network.
[0006] The first aspect of the present application provides a large-scale deployment method of a memristor Bayesian convolutional neural network, comprising the following steps: obtaining the current conductance state of the memristor to determine the relevant data of read noise and write noise corresponding to the memristor device model based on the current conductance state; calculating the corresponding convolution features and complexity costs using different conductance states and the relevant data corresponding to each conductance state, and using the convolution features and complexity costs to train the Bayesian convolution layer of the memristor device model to obtain a write target conductance that meets preset conditions; using the write target conductance to perform kernel replication to deploy BCNN weights of a preset scale to the memristor array.
[0007] Optionally, in one embodiment of the present application, the related data of the read noise and write noise include at least one of the mean of the read noise, the variance of the read noise, the mean of the write noise, the variance of the write noise, the conductance error range in the write-verification process, and the conductance window of the device.
[0008] Optionally, in one embodiment of the present application, the method of calculating corresponding convolution features and complexity costs using different conductance states and related data corresponding to each conductance state includes: obtaining corresponding replica conductance based on the write noise and the target conductance; calculating corresponding read conductance based on the replica conductance and the read noise, and calculating conductance weight based on the read conductance; obtaining input data of the memristor device; converting the input data into an input voltage of a memristor cross array, and obtaining a corresponding current by combining the input voltage and the conductance weight; and calculating the convolution features according to the current and the activation function.
[0009] Optionally, in one embodiment of the present application, the calculation of corresponding convolution features and complexity costs using different conductance states and related data corresponding to each conductance state includes: calculating the prior distribution and the posterior distribution of the conductance weights; and obtaining the complexity cost based on the prior distribution and the posterior distribution.
[0010] Optionally, in one embodiment of the present application, the kernel replication using the write target conductance includes: flattening the input data to obtain a vector of a target size; applying the vector to a corresponding cross array, and obtaining a probabilistic convolution kernel based on the data of the input channel to replicate the probabilistic convolution kernel to obtain a replication result; and outputting the convolution features of the output channel that meet a preset quantity condition based on the replication result.
[0011] The second aspect of the present application provides a large-scale deployment device of a memristor Bayesian convolutional neural network, including: an acquisition module, used to acquire the current conductance state of the memristor, so as to determine the relevant data of the read noise and write noise corresponding to the memristor device model based on the current conductance state; a training module, used to calculate the corresponding convolution features and complexity costs using different conductance states and the relevant data corresponding to each conductance state, and use the convolution features and complexity costs to perform Bayesian convolution layer training of the memristor device model to obtain a write target conductance that meets preset conditions; a replication module, used to perform kernel replication using the write target conductance to deploy BCNN weights of a preset scale to the memristor array.
[0012] Optionally, in one embodiment of the present application, the related data of the read noise and write noise include at least one of the mean of the read noise, the variance of the read noise, the mean of the write noise, the variance of the write noise, the conductance error range in the write-verification process, and the conductance window of the device.
[0013] Optionally, in one embodiment of the present application, the training module includes: a first calculation unit, used to obtain a corresponding replica conductance based on the write noise and the target conductance; a second calculation unit, used to calculate a corresponding read conductance based on the replica conductance and the read noise, and calculate a conductance weight based on the read conductance; an acquisition unit, used to obtain input data of the memristor device; a conversion unit, used to convert the input data into an input voltage of a memristor cross array, and obtain a corresponding current in combination with the input voltage and the conductance weight; and a third calculation unit, used to calculate the convolution feature based on the current and the activation function.
[0014] Optionally, in one embodiment of the present application, the training module includes: a fourth calculation unit, used to calculate the prior distribution and the posterior distribution of the conductance weight; and a fifth calculation unit, used to obtain the complexity cost based on the prior distribution and the posterior distribution.
[0015] Optionally, in one embodiment of the present application, the replication module includes: a processing unit, used to flatten the input data to obtain a vector of a target size; a replication unit, used to apply the vector to a corresponding cross array, and obtain a probability convolution kernel based on the data of the input channel to replicate the probability convolution kernel to obtain a replication result; and an output unit, used to output the convolution features of the output channel that meet a preset quantity condition based on the replication result.
[0016] The third aspect of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the large-scale deployment method of the memristive Bayesian convolutional neural network as described in the above embodiment.
[0017] The fourth aspect of the present application provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the large-scale deployment method of the memristive Bayesian convolutional neural network as described in the above embodiment.
[0018] The fifth aspect of the present application provides a computer program product, including a computer program, which, when executed, is used to implement the large-scale deployment method of the above-mentioned memristive Bayesian convolutional neural network.
[0019] The embodiment of the present application can use the memristor as a computing platform, utilize the non-volatility and randomness of the memristor, effectively accelerate the calculation of the Bayesian neural network, determine the relevant data of the read noise and write noise corresponding to the memristor device model according to the current conductance state of the memristor, and use the relevant data corresponding to different conductance states and each conductance state to calculate the corresponding convolution characteristics and complexity costs, so as to train the Bayesian convolution layer of the memristor device model, thereby obtaining the write target conductance that meets the preset conditions, and perform kernel replication based on the write target conductance, so as to deploy the BCNN weights of the preset scale to the memristor array, so as to be effectively deployed on large-scale BCNNs, so as to adapt to application requirements of various scales. Thus, the technical problem that the deterministic computing platform has technical limitations in the related art and cannot meet the high speed and efficiency requirements of the Bayesian convolutional neural network is solved.
[0020] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0022] Figure 1 A flowchart of a large-scale deployment method of a memristive Bayesian convolutional neural network provided according to an embodiment of the present application;
[0023] Figure 2 A schematic diagram of the principle of a large-scale deployment method of a memristive Bayesian convolutional neural network according to an embodiment of the present application;
[0024] Figure 3A schematic diagram of the principle of probabilistic convolution kernel replication according to an embodiment of the present application;
[0025] Figure 4 A schematic diagram of the principle of offline training according to an embodiment of the present application;
[0026] Figure 5 A schematic diagram of the structure of a large-scale deployment device of a memristive Bayesian convolutional neural network provided according to an embodiment of the present application;
[0027] Figure 6 It is a schematic diagram of the structure of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION
[0028] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0029] The following describes the large-scale deployment method and device of the memristor Bayesian convolutional neural network of the embodiment of the present application with reference to the accompanying drawings. In view of the technical problem that the deterministic computing platform has technical limitations in the related technologies mentioned in the above background technology and cannot meet the high speed and efficiency requirements of the Bayesian convolutional neural network, the present application provides a large-scale deployment method of the memristor Bayesian convolutional neural network, in which the memristor can be used as a computing platform, and the non-volatility and randomness of the memristor are used to effectively accelerate the calculation of the Bayesian neural network, and the relevant data of the read noise and write noise corresponding to the memristor device model are determined according to the current conductance state of the memristor, so as to calculate the corresponding convolution characteristics and complexity costs using the relevant data corresponding to different conductance states and each conductance state, so as to train the Bayesian convolution layer of the memristor device model, so as to obtain the write target conductance that meets the preset conditions, and perform kernel replication based on the write target conductance, so as to deploy the BCNN weights of the preset scale to the memristor array, so as to be effectively deployed on large-scale BCNNs, so as to adapt to application requirements of various scales. This solves the technical problem in related technologies that the deterministic computing platform has technical limitations and cannot meet the high speed and efficiency requirements of the Bayesian convolutional neural network.
[0030] It is understandable that memristors provide a promising approach to implementing Bayesian neural networks (BNNs) based on intelligent hardware. First, the conductance of the memristor can store the weights of the network, thereby significantly improving computing performance and energy efficiency. Secondly, memristors can be integrated into high-density crossbar arrays, allowing the fusion of storage and computing, thereby eliminating the von Neumann bottleneck. In addition, the efficiency of MVM can be further improved by performing large-scale parallel computing operations in the crossbar array. These advantages provide a potential solution for the efficient implementation of BCNNs. The embodiments of the present application can be based on a memristor platform to achieve efficient computing of BCNNs.
[0031] Specifically, Figure 1 A flow chart of a large-scale deployment method of a memristive Bayesian convolutional neural network provided in an embodiment of the present application.
[0032] like Figure 1 As shown, the large-scale deployment method of the memristive Bayesian convolutional neural network includes the following steps:
[0033] In step S101, the current conductance state of the memristor is acquired to determine relevant data of read noise and write noise corresponding to the memristor device model based on the current conductance state.
[0034] In actual implementation, the embodiments of the present application can obtain corresponding read noise, write noise, and noise data related to the read noise and the write noise in the memristor device model according to the current conductance state of the memristor.
[0035] Optionally, in one embodiment of the present application, the relevant data of the read noise and the write noise include at least one of the mean of the read noise, the variance of the read noise, the mean of the write noise, the variance of the write noise, the conductance error range in the write-verification process, and the conductance window of the device.
[0036] For example, in the embodiment of the present application, the read noise in the memristor device model follows the Laplace distribution or other types of probability distribution. The write noise of the device follows the normal distribution with a mean of 0 and a variance of Standard deviation of write noise σ w Equal to G ErrorMargin Divide by 3, where G ErrorMargin is the conductance error range of the write-verify process. The conductance window of the device is min and G max between.
[0037] In step S102, the corresponding convolution features and complexity costs are calculated using different conductance states and related data corresponding to each conductance state, and the convolution features and complexity costs are used to train the Bayesian convolution layer of the memristor device model to obtain a write target conductance that meets preset conditions.
[0038] It is understandable that the target conductance and conductance error range cannot be directly determined during the write-verify process because the randomness of the convolution feature comes from the superposition of the device read and write noise. In addition, the read noise may be related to the device's conductance state, further complicating the determination of the target conductance value.
[0039] Therefore, the embodiment of the present application can establish a random characteristic model for the memristor, and combine the proposed replication kernel method to implement the probabilistic convolution kernel, so that the target conductance can be directly determined. Adaptive off-site training becomes possible.
[0040] Furthermore, the embodiments of the present application can use different conductance states and related data corresponding to each conductance state to calculate corresponding convolution features and complexity costs, thereby performing Bayesian convolution layer training of the memristor device model based on the calculated results to obtain a write target conductance that meets preset conditions, so as to complete probabilistic convolution kernel replication through the write target conductance.
[0041] Optionally, in one embodiment of the present application, corresponding convolution features and complexity costs are calculated using different conductance states and related data corresponding to each conductance state, including: obtaining corresponding replica conductance based on write noise and target conductance; calculating corresponding read conductance based on replica conductance and read noise, and calculating conductance weight based on read conductance; obtaining input data of a memristor device; converting the input data into an input voltage of a memristor cross array, and obtaining a corresponding current by combining the input voltage and conductance weight; and calculating convolution features based on the current and activation function.
[0042] Among them, the embodiment of the present application can process the input data x based on the Bayesian convolution layer of the memristor in , get the convolution feature F and complexity cost L KL The convolutional layer has several trainable parameters, including Scale and Bias. And, the given prior p(G) of the conductivity weight G follows a mean of 0 and a variance of During the forward propagation process, the target conductance Replication in a memristor crossbar array. Replication of conductance Can be The conductivity weight G is calculated by adding the write noise δ. The difference of the differential pair is obtained, where yes Add read noise α×ε. The default value of the normalization factor α is set to 1. Then, by first converting the input data x inIt is converted into the input voltage V of the memristor cross array, and then the current I is accumulated as the sum of the product of the voltage V and the conductance weight G. Finally, the activation function is applied to Scale×I+Bias to obtain the convolution feature F.
[0043] Optionally, in one embodiment of the present application, different conductance states and related data corresponding to each conductance state are used to calculate corresponding convolution features and complexity costs, including: calculating the prior distribution and posterior distribution of conductance weights; and obtaining the complexity cost based on the prior distribution and posterior distribution.
[0044] Physically, the memristor crossbar array efficiently implements parallel memory MVM operations according to Ohm's law and Kirchhoff's law. The complexity cost of the convolutional layer is L KL It is obtained by calculating the KL divergence between the posterior distribution q(H) and the prior distribution p(G) of the conductivity weight G, assuming that q(G) is a mean μ G , the variance is The normal distribution of .
[0045] In step S103, kernel replication is performed using write target conductance to deploy BCNN weights of a preset size to the memristor array.
[0046] Furthermore, the embodiment of the present application can be based on the obtained write target conductivity Deploy large-scale BCNN weights to memristor arrays via a replicated core implementation approach.
[0047] Optionally, in one embodiment of the present application, kernel replication is performed using write target conductance, including: flattening the input data to obtain a vector of a target size; applying the vector to a corresponding cross array, and obtaining a probabilistic convolution kernel based on the data of the input channel to replicate the probabilistic convolution kernel to obtain a replication result; and outputting convolution features of output channels that meet a preset quantity condition based on the replication result.
[0048] The embodiment of the present application can form multiple similar convolution kernels by copying and expanding the convolution kernel of low input dimension, thereby improving the feature extraction performance. In the specific implementation, the differential pair conductance is used to represent a weight:
[0049]
[0050] Here, G represents a synaptic weight in the probabilistic convolution kernel. is the read conductance value of the memristor device. Through the write-verify method, the target conductance Can be replicated in multiple memristor arrays. Due to write noise, the conductance value between each replicated core is different, which can be regarded as the conductance following the target conductance is a Gaussian distribution with a mean and a standard deviation associated with the verification error range. At the same time, the read noise of the memristor is accumulated in the convolution features generated by the crossbar array of memristors, helping to smooth the discrete sample values obtained from the replicated kernel. Therefore, the convolution features obtained from the replicated convolution kernels exhibit randomness. By exploiting the read and write noise, an efficient implementation of the memristor-based probabilistic convolution kernel is achieved.
[0051] Combination Figures 2 to 4 As shown, the working principle of the large-scale deployment method of the memristive Bayesian convolutional neural network of the embodiment of the present application is described in detail by taking an embodiment as an example.
[0052] like Figure 2 As shown, the left side is a schematic diagram of the network structure of BCNNs, and the right side is a schematic diagram of the principle of an embodiment of the present application based on a memristor platform, wherein a is the structure and calculation process of the probability convolution kernel, and b is the process of implementing the probability convolution kernel using a memristor array.
[0053] First of all, the embodiment of the present application can illustrate the main technical principles involved in the embodiment of the present application: a method for realizing a probabilistic convolution kernel by using memristor read and write noise.
[0054] Unlike traditional convolution kernels with fixed value weights, probabilistic convolution kernels have Gaussian weights. Related art has shown that using the read noise of memristors to implement Gaussian weights in Bayesian fully connected convolutional neural networks (BFCNNs) requires large input dimensions and a large number of devices. However, the unique properties of BCNNs' local weight connections lead to the low dimensionality of probabilistic convolution kernels. For example, the dimension of a convolution kernel (3×3) is only 9, which is less than the requirements outlined in the related art. Therefore, an embodiment of the present application proposes a technical solution that can use the read and write noise of a memristor to implement a probabilistic convolution kernel.
[0055] In order to implement the probabilistic convolution kernel, the embodiment of the present application can form multiple similar convolution kernels by copying and expanding the convolution kernel of low input dimension, thereby improving the feature extraction performance. In the specific implementation, the differential pair conductance is used to represent a weight:
[0056]
[0057] Here, G represents a synaptic weight in the probabilistic convolution kernel. is the read conductance value of the memristor device. Through the write-verify method, the target conductance Can be replicated in multiple memristor arrays. Due to write noise, the conductance value between each replicated core is different, which can be regarded as the conductance following the target conductance is a Gaussian distribution with a mean and a standard deviation associated with the verification error range. At the same time, the read noise of the memristor is accumulated in the convolution features generated by the crossbar array of memristors, helping to smooth the discrete sample values obtained from the replicated kernel. Therefore, the convolution features obtained from the replicated convolution kernels exhibit randomness. By exploiting the read and write noise, an efficient implementation of the memristor-based probabilistic convolution kernel is achieved.
[0058] like Figure 3 As shown, the present application embodiment can use a simple BCNN as an example to illustrate the operation implementation of the probability convolution layer. Each convolution filter has four dimensions: C in ×C out ×K W ×K H , where C in is the number of input channels, C out t is the number of output channels (also called the number of kernels), K W is the width, K H is the height (usually equal to the width). Assuming that the image input to the BCNN has one channel, the dimensions of the probabilistic convolution kernels of the input layer and the second layer are 1×3×3×3 and 3 (three channel input)×4 (four 3X3 convolution kernels)×3×3 respectively. At the hardware level, the kernels are flattened and mapped to a cross array, with columns corresponding to the output channels. At the same time, three replicated kernels are obtained by replication. For the input convolution layer, such as Figure 3 As shown in (a), the 1-channel input data x that needs convolution in is flattened into a vector of size 9 and then applied to the corresponding crossbar arrays via voltage encoding. The output currents, corresponding to the convolutional features, can be obtained in parallel. In the case of a probabilistic convolutional layer with multiple input channels, such as the second convolutional layer with 3 input channels, Figure 3 As shown in (b), the output currents from the three cross arrays are summed and the convolution features with 4 output channels are obtained in parallel.
[0059] Based on the above technical solution, the embodiment of the present application can realize Bayesian-based BCNNs offline training.
[0060] It is understandable that when deploying large-scale BCNN weights to memristor arrays via the replica core implementation approach, it is necessary to obtain appropriate write target conductance However, since the randomness of the convolution feature comes from the superposition of the device read and write noise, the target conductance and conductance error range cannot be directly determined during the write-verify process. In addition, the read noise may be related to the device's conductance state, further complicating the determination of the target conductance value.
[0061] The off-site training method of the embodiment of the present application can establish a random characteristic model for the memristor and combine it with the proposed replication kernel method to realize the probabilistic convolution kernel. This method makes it possible to directly determine the target conductance Adaptive off-site training is possible. Figure 4 As shown, the method covers the device level, network level and algorithm level.
[0062] First, in the memristor device model, the read noise follows a Laplace distribution, or other types of probability distributions. The write noise of the device follows a normal distribution with a mean of 0 and a variance of Standard deviation of write noise σ w Equal to G ErrorMargin Divide by 3, where G ErrorMargin is the conductance error range of the write-verify process. The conductance window of the device is min and G max between.
[0063] Subsequently, the memristor-based Bayesian convolutional layer processes the input data x in , get the convolution feature F and complexity cost L KL The convolutional layer has several trainable parameters, including Scale and Bias. And, the given prior p(G) of the conductivity weight G follows a mean of 0 and a variance of During the forward propagation process, the target conductance Replication in a memristor crossbar array. Replication of conductance Can be The conductivity weight G is calculated by adding the write noise δ. The difference of the differential pair is obtained, where yes Add read noise α×ε. The default value of the normalization factor α is set to 1. Then, by first converting the input data x in Converted into the input voltage V of the memristor crossbar array, then accumulate the current I as the sum of the product of the voltage V and the conductance weight G, and finally apply the activation function to Scale×I+Bias to get the convolution feature F. Physically, the memristor crossbar array efficiently implements parallel memory MVM operations according to Ohm's law and Kirchhoff's law. The complexity cost of the convolution layer is L KL It is obtained by calculating the KL divergence between the posterior distribution q(G) and the prior distribution p(G) of the conductivity weight G, assuming that q(G) is a mean μ G , the variance is The normal distribution of .
[0064] Based on the memristor storage and computing integrated hardware of the embodiment of the present application, a process of deep Bayesian active learning is implemented to utilize the read and write noise of the memristor to realize the probabilistic convolution kernel; the probabilistic convolution kernel can be realized by establishing a random characteristic model of the memristor and integrating the replication kernel method to realize the deployment of large-scale memristor-based BCNNs; the memristor-based Bayesian convolutional neural network implemented based on the above technical solution can be effectively deployed on large-scale BCNNs, and has high classification accuracy and excellent anomaly detection capabilities.
[0065] In summary, the embodiments of the present application can utilize the non-volatility and randomness of memristors to effectively accelerate the calculation of Bayesian neural networks; can be effectively deployed on large-scale BCNNs to adapt to application requirements of various scales to achieve deployment flexibility; and by systematically studying the impact of various influencing factors at the device and array levels on classification and uncertainty estimation capabilities, highly robust BCNNs are achieved.
[0066] According to the large-scale deployment method of the memristor Bayesian convolutional neural network proposed in the embodiment of the present application, the memristor can be used as a computing platform, and the non-volatility and randomness of the memristor can be used to effectively accelerate the calculation of the Bayesian neural network. The relevant data of the read noise and write noise corresponding to the memristor device model are determined according to the current conductance state of the memristor, so as to calculate the corresponding convolution characteristics and complexity costs using different conductance states and the relevant data corresponding to each conductance state, so as to perform Bayesian convolution layer training of the memristor device model, thereby obtaining the write target conductance that meets the preset conditions, and kernel replication is performed based on the write target conductance, so as to deploy the BCNN weights of the preset scale to the memristor array, so as to be effectively deployed on large-scale BCNNs, so as to adapt to application requirements of various scales. Thus, the technical problem that the deterministic computing platform has technical limitations in the related art and cannot meet the high speed and efficiency requirements of the Bayesian convolutional neural network is solved.
[0067] Next, a large-scale deployment device of a memristive Bayesian convolutional neural network proposed in accordance with an embodiment of the present application is described with reference to the accompanying drawings.
[0068] Figure 5 It is a block diagram of a large-scale deployment device of a memristive Bayesian convolutional neural network according to an embodiment of the present application.
[0069] like Figure 5 As shown, the large-scale deployment device 10 of the memristive Bayesian convolutional neural network includes: an acquisition module 100, a training module 200 and a replication module 300.
[0070] Specifically, the acquisition module 100 is used to acquire the current conductance state of the memristor, so as to determine the relevant data of the read noise and the write noise corresponding to the memristor device model based on the current conductance state.
[0071] The training module 200 is used to calculate the corresponding convolution features and complexity costs using different conductance states and related data corresponding to each conductance state, and to perform Bayesian convolution layer training of the memristor device model using the convolution features and complexity costs to obtain a write target conductance that meets preset conditions.
[0072] The replication module 300 is used to perform kernel replication using write target conductance to deploy BCNN weights of a preset scale to the memristor array.
[0073] Optionally, in one embodiment of the present application, the relevant data of the read noise and the write noise include at least one of the mean of the read noise, the variance of the read noise, the mean of the write noise, the variance of the write noise, the conductance error range in the write-verification process, and the conductance window of the device.
[0074] Optionally, in one embodiment of the present application, the training module 200 includes: a first computing unit, a second computing unit, an acquisition unit, a conversion unit and a third computing unit.
[0075] The first calculation unit is used to obtain the corresponding replica conductance based on the write noise and the target conductance.
[0076] The second calculation unit is used to calculate the corresponding read conductance based on the replica conductance and the read noise, and calculate the conductance weight based on the read conductance.
[0077] The acquisition unit is used to acquire input data of the memristor device.
[0078] The conversion unit is used to convert the input data into the input voltage of the memristor cross array, and obtain the corresponding current by combining the input voltage and the conductivity weight.
[0079] The third computing unit is used to calculate the convolution feature according to the current and the activation function.
[0080] Optionally, in one embodiment of the present application, the training module 200 includes: a fourth computing unit and a fifth computing unit.
[0081] The fourth calculation unit is used to calculate the prior distribution and the posterior distribution of the conductivity weight.
[0082] The fifth computing unit is used to obtain the complexity cost based on the prior distribution and the posterior distribution.
[0083] Optionally, in one embodiment of the present application, the copy module 300 includes: a processing unit, a copy unit and an output unit.
[0084] The processing unit is used to flatten the input data to obtain a vector of a target size.
[0085] The replication unit is used to apply the vector to the corresponding cross array and obtain the probability convolution kernel based on the data of the input channel to replicate the probability convolution kernel to obtain a replication result.
[0086] The output unit is used to output the convolution features of the output channels that meet the preset quantity conditions based on the replication result.
[0087] It should be noted that the aforementioned explanation of the embodiment of the large-scale deployment method of the memristive Bayesian convolutional neural network is also applicable to the large-scale deployment device of the memristive Bayesian convolutional neural network of this embodiment, and will not be repeated here.
[0088] According to the large-scale deployment device of the memristor Bayesian convolutional neural network proposed in the embodiment of the present application, the memristor can be used as a computing platform, and the non-volatility and randomness of the memristor can be used to effectively accelerate the calculation of the Bayesian neural network. The relevant data of the read noise and write noise corresponding to the memristor device model are determined according to the current conductance state of the memristor, so as to calculate the corresponding convolution characteristics and complexity costs using the relevant data corresponding to different conductance states and each conductance state, so as to perform Bayesian convolution layer training of the memristor device model, thereby obtaining the write target conductance that meets the preset conditions, and kernel replication is performed based on the write target conductance, so as to deploy the BCNN weights of the preset scale to the memristor array, so as to be effectively deployed on large-scale BCNNs, so as to adapt to application requirements of various scales. Thus, the technical problem that the deterministic computing platform has technical limitations in the related art and cannot meet the high speed and efficiency requirements of the Bayesian convolutional neural network is solved.
[0089] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include:
[0090] A memory 601 , a processor 602 , and a computer program stored in the memory 601 and executable on the processor 602 .
[0091] When the processor 602 executes the program, the large-scale deployment method of the memristive Bayesian convolutional neural network provided in the above embodiment is implemented.
[0092] Furthermore, the electronic device also includes:
[0093] The communication interface 603 is used for communication between the memory 601 and the processor 602 .
[0094] The memory 601 is used to store computer programs that can be executed on the processor 602 .
[0095] The memory 601 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0096] If the memory 601, the processor 602 and the communication interface 603 are implemented independently, the communication interface 603, the memory 601 and the processor 602 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0097] Optionally, in a specific implementation, if the memory 601, the processor 602 and the communication interface 603 are integrated on a chip, the memory 601, the processor 602 and the communication interface 603 can communicate with each other through an internal interface.
[0098] The processor 602 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
[0099] This embodiment also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the large-scale deployment method of the above-mentioned memristive Bayesian convolutional neural network.
[0100] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the large-scale deployment method of the memristive Bayesian convolutional neural network provided by an embodiment of the present invention.
[0101] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0102] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0103] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or N executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0104] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or N wirings (electronic devices), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways as necessary and then storing it in a computer memory.
[0105] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiment, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0106] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0107] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0108] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A large-scale deployment method of a memristive Bayesian convolutional neural network, characterized in that: The following steps are involved: Acquire a current conductance state of the memristor to determine relevant data of read noise and write noise corresponding to the memristor device model based on the current conductance state; Calculating corresponding convolution features and complexity costs using different conductance states and related data corresponding to each conductance state, and using the convolution features and complexity costs to perform Bayesian convolution layer training of the memristor device model to obtain a write target conductance that meets preset conditions; The write target conductance is used to perform kernel replication to deploy BCNN weights of a preset size to the memristor array.
2. The method according to claim 1, characterized in that The related data of the read noise and write noise include at least one of the mean of the read noise, the variance of the read noise, the mean of the write noise, the variance of the write noise, the conductance error range in the write-verification process, and the conductance window of the device.
3. The method according to claim 1, characterized in that The method of calculating corresponding convolution features and complexity costs using different conductance states and related data corresponding to each conductance state includes: Obtaining a corresponding replica conductance based on the write noise and the target conductance; calculating a corresponding read conductance based on the replica conductance and the read noise, and calculating a conductance weight based on the read conductance; Obtaining input data of the memristor device; Converting the input data into an input voltage of a memristor crossbar array, and combining the input voltage with the conductance weight to obtain a corresponding current; The convolution feature is calculated based on the current and the activation function.
4. The method according to claim 3, characterized in that The method of calculating corresponding convolution features and complexity costs using different conductance states and related data corresponding to each conductance state includes: calculating a prior distribution and a posterior distribution of the conductance weight; The complexity cost is obtained based on the prior distribution and the posterior distribution.
5. The method according to claim 3, characterized in that: The method of using the write target conductance to perform core copying includes: Flatten the input data to obtain a vector of target size; Applying the vector to the corresponding cross array, and obtaining a probability convolution kernel based on the data of the input channel, so as to copy the probability convolution kernel and obtain a copy result; Based on the copy result, the convolution features of the output channels that meet the preset quantity condition are output.
6. A large-scale deployment device for a memristive Bayesian convolutional neural network, characterized in that: include: An acquisition module, used for acquiring a current conductance state of the memristor, so as to determine relevant data of read noise and write noise corresponding to the memristor device model based on the current conductance state; A training module, used to calculate corresponding convolution features and complexity costs using different conductance states and relevant data corresponding to each conductance state, and to perform Bayesian convolution layer training of the memristor device model using the convolution features and complexity costs to obtain a write target conductance that meets preset conditions; A replication module is used to utilize the write target conductance to perform kernel replication to deploy BCNN weights of a preset scale to the memristor array.
7. The device according to claim 6, characterized in that The training module includes: a first calculation unit, configured to obtain a corresponding replica conductance based on the write noise and the target conductance; a second calculation unit, configured to calculate a corresponding read conductance based on the replica conductance and the read noise, and calculate a conductance weight based on the read conductance; An acquisition unit, used for acquiring input data of the memristor device; A conversion unit, used to convert the input data into an input voltage of a memristor crossbar array, and obtain a corresponding current by combining the input voltage and the conductance weight; The third computing unit is used to calculate the convolution feature according to the current and the activation function.
8. The device according to claim 7, characterized in that The replication module comprises: A processing unit, configured to flatten the input data to obtain a vector of a target size; A copying unit, used for applying the vector to a corresponding cross array, and obtaining a probability convolution kernel based on the data of the input channel, so as to copy the probability convolution kernel and obtain a copy result; An output unit is used to output the convolution features of the output channels that meet a preset quantity condition based on the copy result.
9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the large-scale deployment method of the memristive Bayesian convolutional neural network as described in any one of claims 1 to 5.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the large-scale deployment method of the memristive Bayesian convolutional neural network as described in any one of claims 1 to 5.