Multi-noise adding training method and device based on memristor neural network

CN118504640BActive Publication Date: 2026-09-22TSINGHUA UNIVERSITY
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410584277.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-11
Publication Date
2026-09-22
Estimated Expiration
2044-05-11

AI Technical Summary

Technical Problem

[0007]本申请提供一种基于忆阻器神经网络的多重加噪训练方法及装置,以解决现有技术中的网络模型与实际权重噪声网络模型并未达成较高的相似度,难以进一步提升神经网络的鲁棒性等问题

Benefits of technology

[0019]本申请的实施例可通过获取目标忆阻器神经网络的多重加噪初始训练模型和训练迭代参数,并判断训练迭代参数是否满足预设的迭代要求;如果训练迭代参数满足迭代要求,则在多重加噪初始训练模型的当前批次索引参数满足预设批次要求时,建立当前批次索引参数对应的模型列表和损失列表,同时获取多重加噪初始训练模型对应的当前加噪重数索引;基于当前加噪重数索引和预设重数索引分析策略,对当前加噪重数索引进行加噪重数分析,并得到加噪重数分析结果,以通过模型列表、损失列表和加噪重数分析结果执行权重加噪或模型优化操作,以生成目标忆阻器神经网络对应的多重加噪模型。本申请通过多重加噪得到的网络模型与实际推理模型具有较高的相似度,从而对多重加噪模型进行优化可极大提升网络模型性能。由此,解决了现有技术中的网络模型与实际权重噪声网络模型并未达成较高的相似度,难以进一步提升神经网络的鲁棒性等问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118504640B_ABST
    Figure CN118504640B_ABST
Patent Text Reader

Abstract

The application relates to a multiple noise adding training method and device based on a memristor neural network, wherein the method comprises the following steps: obtaining a multiple noise adding initial training model of a target memristor neural network and a training iteration parameter, and judging whether the training iteration parameter meets iteration requirements; if yes, a current batch index parameter is obtained, and when the batch index parameter meets batch requirements, a model list and a loss list are established, and a current noise adding number index is obtained; based on the current noise adding number index and a preset noise adding number index analysis strategy, noise adding number analysis is performed on the current noise adding number index, noise adding number analysis results are obtained, weight noise adding or model optimization operations are performed through the noise adding number analysis results, and a multiple noise adding model corresponding to the target memristor neural network is generated. Therefore, the problem that a network model and an actual weight noise network model in the prior art do not reach high similarity and it is difficult to further improve the robustness of a neural network is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of multiple noise-adding training technology, and in particular to a multiple noise-adding training method and apparatus based on memristor neural networks. Background Technology

[0002] In recent years, the application of memristor-based in-memory computing technology in neural networks has enabled the storage of neural network weights in the form of device conductance in a memristor array, and the use of Ohm's law and Kirchhoff's laws to perform matrix-vector multiplication operations, such as... Figure 1 As shown, it can significantly improve important indicators such as computational efficiency and system energy efficiency. However, the current development of memristor technology is still immature. The existence of non-ideal characteristics of the device means that when the neural network is actually deployed on the memristor array, weight noise will inevitably be introduced, which will lead to a decrease in the inference accuracy of the network model and affect its practical application effect.

[0003] Currently, existing techniques (i.e., conventional noise-adding training methods) add random noise to the weight parameter matrix once during the neural network training process, before the actual training (forward propagation) for each batch of inputs, and then train based on the noisy weight network model—that is, a single random weight noise addition. Furthermore, existing techniques (i.e., adversarial weight perturbation training methods) ensure that the added weight noise is always along the direction that maximizes the network loss function. The commonality between these two existing techniques is that, within the same training round, weight noise is added only once for each batch of inputs.

[0004] The main drawback of the common noise-adding training method is that it only obtains the state by adding noise to the weights once randomly during the training process of each batch of inputs. The single and completely random addition of noise to the weights of the network model means that the model's own characteristics are not considered and there is no emphasis in the training and corresponding noise-adding process. In other words, the network model obtained by the common noise-adding training method cannot reflect the actual inference model well in most cases.

[0005] The main drawback of the adversarial weight perturbation training method is that it considers the worst-case scenario of weights with noise in each batch of inputs during training. This may cause the network model to over-adapt to extreme cases and ignore other more common non-ideal noise cases, thus affecting the model's performance under normal conditions rather than special adversarial inputs, because it focuses too much on extreme cases.

[0006] In summary, the existing network models do not achieve a high degree of similarity with the actual weighted noisy network models, making it difficult to further improve the robustness of neural networks, which urgently needs to be addressed. Summary of the Invention

[0007] This application provides a multi-noise training method and apparatus based on memristor neural networks to solve the problems in the prior art where the network model and the actual weighted noise network model do not achieve a high degree of similarity, making it difficult to further improve the robustness of the neural network.

[0008] The first aspect of this application provides a multi-noise training method based on a memristor neural network, comprising the following steps: obtaining a multi-noise initial training model and training iteration parameters of a target memristor neural network, and determining whether the training iteration parameters meet preset iteration requirements; if the training iteration parameters meet the iteration requirements, then when the current batch index parameter of the multi-noise initial training model meets the preset batch requirements, establishing a model list and a loss list corresponding to the current batch index parameter, and simultaneously obtaining the current noise multiplicity index corresponding to the multi-noise initial training model; performing noise multiplicity analysis on the current noise multiplicity index based on the current noise multiplicity index and a preset multiplicity index analysis strategy, and obtaining the noise multiplicity analysis result, so as to perform weight noise addition or model optimization operations through the model list, the loss list and the noise multiplicity analysis result, so as to generate a multi-noise model corresponding to the target memristor neural network.

[0009] Optionally, in one embodiment of this application, obtaining the initial training model with multiple noise and the training iteration parameters of the target memristor neural network, and determining whether the training iteration parameters meet the preset iteration requirements, includes: performing an initialization operation on the target memristor neural network to generate the initial training model with multiple noise and the training iteration parameters corresponding to the target memristor neural network, and determining whether the training iteration parameters meet the iteration requirements; if the training iteration parameters do not meet the iteration requirements, then terminating the training of the target memristor neural network.

[0010] Optionally, in one embodiment of this application, the step of establishing a model list and a loss list corresponding to the current batch index parameter when the current batch index parameter of the multi-noise initial training model meets the preset batch requirement, and simultaneously obtaining the current noise multiplicity index corresponding to the multi-noise initial training model, includes: determining whether the current batch index parameter meets the preset batch requirement when the training iteration parameter meets the iteration requirement; if the current batch index parameter meets the preset batch requirement, establishing the model list and the loss list, and obtaining the current noise multiplicity index; otherwise, terminating the training of the target memristor neural network.

[0011] Optionally, in one embodiment of this application, the step of performing noise multiplication analysis on the current noise multiplication index based on the current noise multiplication index and a preset multiplication index analysis strategy, and obtaining the noise multiplication analysis result, so as to perform weight noise addition or model optimization operations through the model list, the loss list and the noise multiplication analysis result to generate a multi-noise model corresponding to the target memristor neural network, includes: determining whether the current noise multiplication index satisfies the preset multiplication index condition; if the current noise multiplication index satisfies the preset multiplication index condition, then performing a single random weight noise addition process on the initial multi-noise training model to obtain a noise generation model, and simultaneously adding the noise multiplication index to the model. A noise generation model is added to the model list, and the loss value of the noise generation model is calculated and added to the loss list. If the current noise multiplicity index does not meet the preset multiplicity index condition, all loss values ​​in the loss list are compared to obtain the maximum loss value. The noise generation model corresponding to the maximum loss value in the model list is obtained, and the weight parameters of the noise generation model corresponding to the maximum loss value are updated to generate a new noise generation model. The weight noise addition or model optimization operation is iteratively executed according to the new noise generation model and the preset model iteration strategy to generate the multi-noise model corresponding to the target memristor neural network.

[0012] A second aspect of this application provides a multi-noise training device based on a memristor neural network, comprising: a determination module, configured to acquire a multi-noise initial training model and training iteration parameters of a target memristor neural network, and determine whether the training iteration parameters meet preset iteration requirements; an establishment module, configured to, if the training iteration parameters meet the iteration requirements, establish a model list and a loss list corresponding to the current batch index parameters when the current batch index parameters of the multi-noise initial training model meet preset batch requirements, and simultaneously acquire the current noise multiplicity index corresponding to the multi-noise initial training model; and an analysis module, configured to perform noise multiplicity analysis on the current noise multiplicity index based on the current noise multiplicity index and a preset multiplicity index analysis strategy, and obtain noise multiplicity analysis results, so as to perform weight noise addition or model optimization operations through the model list, the loss list and the noise multiplicity analysis results to generate a multi-noise model corresponding to the target memristor neural network.

[0013] Optionally, in one embodiment of this application, the determining module includes: an initialization unit, configured to perform an initialization operation on the target memristor neural network to generate the multiple noise initial training model and the training iteration parameters corresponding to the target memristor neural network, and determine whether the training iteration parameters meet the iteration requirements; and a termination unit, configured to terminate the training of the target memristor neural network if the training iteration parameters do not meet the iteration requirements.

[0014] Optionally, in one embodiment of this application, the establishment module includes: a first judgment unit, configured to determine whether the current batch index parameter meets the preset batch requirement if the training iteration parameters meet the iteration requirement; and an acquisition unit, configured to establish the model list and the loss list and acquire the current noisy multiplicity index if the current batch index parameter meets the preset batch requirement, otherwise terminate the training of the target memristor neural network.

[0015] Optionally, in one embodiment of this application, the analysis module includes: a second judgment unit, configured to judge whether the current denoising multiplicity index satisfies a preset multiplicity index condition; a weight denoising unit, configured to, if the current denoising multiplicity index satisfies the preset multiplicity index condition, perform a single random weight denoising process on the initial training model with multiple denoising to obtain a denoised generation model, add the denoised generation model to the model list, calculate the loss value of the denoised generation model, and add the loss value to the loss list; and a model optimization unit, configured to, if the current denoising multiplicity index does not satisfy the preset multiplicity index condition, compare all loss values ​​in the loss list to obtain the maximum loss value, obtain the denoised generation model corresponding to the maximum loss value in the model list, perform a weight parameter update operation on the denoised generation model corresponding to the maximum loss value to generate a new denoised generation model, and iteratively execute the weight denoising or model optimization operation according to the new denoised generation model and a preset model iteration strategy to generate the multiple denoised model corresponding to the target memristor neural network.

[0016] A third aspect of this application provides an electronic device, including: 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 multiple noise-adding training method based on memristor neural networks as described in the above embodiments.

[0017] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described multi-noise training method based on a memristor neural network.

[0018] Therefore, the embodiments of this application have the following beneficial effects:

[0019] The embodiments of this application can obtain the initial training model and training iteration parameters of the target memristor neural network with multiple noise, and determine whether the training iteration parameters meet the preset iteration requirements. If the training iteration parameters meet the iteration requirements, when the current batch index parameters of the initial training model with multiple noise meet the preset batch requirements, a model list and a loss list corresponding to the current batch index parameters are established, and the current noise multiplicity index corresponding to the initial training model with multiple noise is obtained. Based on the current noise multiplicity index and the preset multiplicity index analysis strategy, noise multiplicity analysis is performed on the current noise multiplicity index, and the noise multiplicity analysis results are obtained. Weight noise addition or model optimization operations are then performed using the model list, loss list, and noise multiplicity analysis results to generate the multiple noise model corresponding to the target memristor neural network. The network model obtained by multiple noise addition in this application has a high similarity to the actual inference model, so optimizing the multiple noise model can greatly improve the network model performance. Thus, it solves the problem in the prior art that the network model and the actual weighted noise network model do not achieve a high similarity, making it difficult to further improve the robustness of the neural network.

[0020] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0021] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:

[0022] Figure 1 A schematic diagram illustrating matrix-vector multiplication using a memristor array;

[0023] Figure 2 This is a flowchart illustrating a multi-noise training method based on a memristor neural network according to an embodiment of this application;

[0024] Figure 3 A schematic diagram illustrating the analysis of the current training round during a multi-noise training process, as provided in one embodiment of this application;

[0025] Figure 4 A flowchart illustrating specific rounds of training in a multi-noise training process is provided as an embodiment of this application;

[0026] Figure 5 A schematic diagram of the execution flow of a weighted noise-adding correlation operation is provided for one embodiment of this application;

[0027] Figure 6A schematic diagram of the execution flow of model optimization-related operations is provided for one embodiment of this application;

[0028] Figure 7 A schematic diagram illustrating the basic principle of a multi-noise training method based on a memristor neural network, provided for one embodiment of this application;

[0029] Figure 8 This is an example diagram of a multi-noise training device based on a memristor neural network according to an embodiment of this application;

[0030] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0031] Among them, 10-multiple noise-adding training device based on memristor neural network; 100-determination module, 200-establishment module, 300-analysis module; 901-memory, 902-processor, 903-communication interface. Detailed Implementation

[0032] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.

[0033] The following describes a multi-noise training method and apparatus based on a memristor neural network according to embodiments of this application, with reference to the accompanying drawings. Addressing the problems mentioned in the background section, this application provides a multi-noise training method based on a memristor neural network. In this method, an initial multi-noise training model and training iteration parameters of the target memristor neural network are obtained, and it is determined whether the training iteration parameters meet preset iteration requirements. If the training iteration parameters meet the iteration requirements, when the current batch index parameters of the initial multi-noise training model meet the preset batch requirements, a model list and a loss list corresponding to the current batch index parameters are established, and the current noise multiplicity index corresponding to the initial multi-noise training model is obtained. Based on the current noise multiplicity index and the preset multiplicity index analysis strategy, noise multiplicity analysis is performed on the current noise multiplicity index, and the noise multiplicity analysis results are obtained. Weight noise addition or model optimization operations are then performed using the model list, loss list, and noise multiplicity analysis results to generate a multi-noise model corresponding to the target memristor neural network. The network model obtained through multi-noise in this application has a high similarity to the actual inference model, thus optimizing the multi-noise model can greatly improve the network model performance. This solves the problem that existing technologies do not achieve a high degree of similarity between the network model and the actual weighted noisy network model, making it difficult to further improve the robustness of neural networks.

[0034] Specifically, Figure 2 This is a flowchart illustrating a multi-noise training method based on a memristor neural network, provided in an embodiment of this application.

[0035] like Figure 2 As shown, this multi-noise training method based on memristor neural networks includes the following steps:

[0036] In step S201, the initial training model and training iteration parameters of the target memristor neural network with multiple noise are obtained, and it is determined whether the training iteration parameters meet the preset iteration requirements.

[0037] The embodiments of this application first determine the initial training model and training iteration parameters (i.e., training round index) corresponding to the memristor neural network, and then judge the training round index to analyze whether it meets the iteration requirements and obtain the corresponding analysis results, thereby providing a reliable basis and guidance for the complete training of the model.

[0038] Optionally, in one embodiment of this application, obtaining the initial training model and training iteration parameters of the target memristor neural network with multiple noise, and determining whether the training iteration parameters meet the preset iteration requirements, includes: performing an initialization operation on the target memristor neural network to generate the initial training model and training iteration parameters of the target memristor neural network with multiple noise, and determining whether the training iteration parameters meet the iteration requirements; if the training iteration parameters do not meet the iteration requirements, then terminating the training of the target memristor neural network.

[0039] It should be noted that the embodiments of this application first perform network model and training epoch initialization operations to initialize the network model weight parameters and set the model to the initial model_out (i.e., the initial training model with multiple noise addition), while initializing the training epoch index to 0; secondly, the embodiments of this application can determine whether the current training epoch index is within the hyperparameter setting range. If the current training epoch index is within the hyperparameter setting range, the corresponding epoch training is executed, and then the epoch is incremented and re-evaluated, such as... Figure 3 As shown, otherwise the entire training process will end here, thus terminating the training of the target memristor neural network.

[0040] In step S202, if the training iteration parameters meet the iteration requirements, then when the current batch index parameters of the initial training model with multiple noise meet the preset batch requirements, a model list and a loss list corresponding to the current batch index parameters are established, and the current noise multiplicity index corresponding to the initial training model with multiple noise is obtained.

[0041] Furthermore, if the training iteration parameters meet the iteration requirements, the current batch index parameters of the initial training model with multiple noise are obtained, and the current batch index parameters are analyzed. When they meet the preset batch requirements, the corresponding model list and loss list are constructed, and the current noise multiplicity index corresponding to the initial training model with multiple noise is obtained, thereby realizing the subsequent determination of noise multiplicity.

[0042] Optionally, in one embodiment of this application, if the training iteration parameters meet the iteration requirements, then when the current batch index parameters of the initial multi-noise training model meet the preset batch requirements, a model list and a loss list corresponding to the current batch index parameters are established, and the current noise multiplicity index corresponding to the initial multi-noise training model is obtained. This includes: when the training iteration parameters meet the iteration requirements, determining whether the current batch index parameters meet the preset batch requirements; if the current batch index parameters meet the preset batch requirements, then a model list and a loss list are established, and the current noise multiplicity index is obtained; otherwise, the training of the target memristor neural network is terminated.

[0043] In actual implementation, when the training iteration parameters meet the iteration requirements, embodiments of this application can initialize the input batch to initialize the input batch index batch_idx of the network model to 0, such as... Figure 4 As shown; and determine whether the current input batch index batch_idx is within the range obtained through the relevant hyperparameter settings. If not, the current training round ends; if the current input batch index batch_idx is within the range obtained through the relevant hyperparameter settings, the embodiments of this application can create two empty lists, the model list and the loss list, corresponding to the current training round, and initialize the noisy multiplicity index iters of the model weights in the current training round to 0.

[0044] Therefore, the embodiments of this application construct a model and a loss list, and initialize the noise multiplication number, thereby accommodating multiple network models obtained by multiple noise additions and their respective training losses.

[0045] In step S203, based on the current noise multiplicity index and the preset multiplicity index analysis strategy, noise multiplicity analysis is performed on the current noise multiplicity index, and the noise multiplicity analysis result is obtained. Then, weight noise addition or model optimization operations are performed through the model list, loss list and noise multiplicity analysis result to generate the multi-noise model corresponding to the target memristor neural network.

[0046] Therefore, embodiments of this application can analyze and judge the current noisy multiplicity index based on the multiplicity index analysis strategy to obtain the noisy multiplicity analysis result, and combine the weighted noisy operation or model optimization operation to generate the multiplicity model corresponding to the target memristor neural network.

[0047] Those skilled in the art will understand that ordinary weighted noise does not consider the model's own characteristics and therefore does not emphasize any aspect during training and the corresponding noise addition process. In contrast, adversarial weight perturbation only focuses on the worst-case scenario of weighted noise. Therefore, the network models corresponding to the two existing methods do not achieve a high degree of similarity with the actual weighted noise network model. This application compares the similarity between the network models corresponding to the ordinary weighted noise and adversarial weight perturbation methods, as well as the multiple noise method, and the actual weighted noise network model. The comparison is based on the Euclidean distance between the weight vectors converted from the weight parameter matrices of different network models. On this basis, the three training methods are analyzed and compared using contour plots of the neural network objective function in the solution space, thereby theoretically explaining the effectiveness of the multiple noise training method.

[0048] Furthermore, the embodiments of this application introduce multiple noises during the training process and select the worst-case noise-added state from multiple random states for optimization, thereby achieving a compromise between the two existing methods. That is, it can not only cope with general noise conditions, but also resist the influence of extreme noise to a certain extent, thereby achieving a more effective improvement in the robustness of the network model.

[0049] Optionally, in one embodiment of this application, based on the current noisy multiplicity index and a preset multiplicity index analysis strategy, noisy multiplicity analysis is performed on the current noisy multiplicity index, and the noisy multiplicity analysis result is obtained. Weight noisening or model optimization operations are then performed using the model list, loss list, and noisy multiplicity analysis result to generate a multi-noisy model corresponding to the target memristor neural network. This includes: determining whether the current noisy multiplicity index satisfies the preset multiplicity index condition; if the current noisy multiplicity index satisfies the preset multiplicity index condition, then a single random weight noisening process is performed on the initial multi-noisy training model to obtain a noisy generation model, while simultaneously... The noisy generation model is added to the model list, and its loss value is calculated and added to the loss list. If the current noisy multiplicity index does not meet the preset multiplicity index condition, all loss values ​​in the loss list are compared to obtain the maximum loss value. The noisy generation model corresponding to the maximum loss value in the model list is obtained, and the weight parameters of the noisy generation model corresponding to the maximum loss value are updated to generate a new noisy generation model. The weight noisy generation model or model optimization operation is iteratively executed according to the new noisy generation model and the preset model iteration strategy to generate the multi-noisy model corresponding to the target memristor neural network.

[0050] As one possible approach, embodiments of this application can analyze the current noisy multiplicity index to determine whether the current noisy multiplicity index iters is within the range of hyperparameter settings. If so, weighted noisy operations are performed, such as... Figure 5As shown, iters is then incremented and re-evaluated; if not, model optimization operations are performed, such as... Figure 6 As shown, the batch index batch_idx is then incremented by one and re-evaluated.

[0051] Specifically, the execution flow of the above-mentioned weighting and noise-adding operations and model optimization operations is as follows:

[0052] I. Weighted Noise Addition Related Operation Procedures:

[0053] 1. Since the network model updates the weight parameters in each iteration of training corresponding to each input batch index batch_idx, in the process of weight noise addition, the embodiments of this application first perform a single random weight noise addition for the initial model_out corresponding to the current batch_idx (different noise addition multiplicity index iters correspond to the same initial model_out);

[0054] 2. Add the noise-generated model to the model list;

[0055] 3. Calculate the output and loss of the noisy model, and finally add the loss value to the loss list.

[0056] II. Model optimization related operation procedures:

[0057] 1. Since starting model optimization means that the current iteration of training corresponding to the current input batch index batch_idx is about to end, during the model optimization process, the embodiments of this application first need to compare the loss values ​​in the loss list obtained from the current iteration of training and determine that the noisy generator model corresponding to the maximum loss value in the model list obtained from the current iteration of training is the network model model_out to be optimized for the current batch_idx.

[0058] 2. Update the weight parameters for this mode_out;

[0059] 3. Use the optimized model as the initial model_out for the next batch_idx.

[0060] It is important to note that in actual implementation, for each batch of input training, those skilled in the art can choose the criterion for determining the final noise state after multiple noise additions based on the actual situation. For example, choosing the criterion based on the lowest inference accuracy of the multiple weighted noise network models generated after multiple noise additions can still achieve the corresponding purpose to a certain extent, namely, improving the robustness of the network model to weighted noise. Strictly speaking, there is no essential difference between choosing the maximum loss value and choosing the lowest inference accuracy, but choosing the maximum loss value will theoretically achieve better results.

[0061] Therefore, multiple noise addition, as a novel training method for memristor neural networks, is proposed in this application. By introducing multiple noises during the training process and selecting a specific state with the worst noise addition condition from multiple random states for optimization, the robustness of the neural network to weight noise can be effectively improved. This not only enables it to cope with general noise conditions but also to resist the influence of extreme noise to a certain extent, making the neural network more stable and reliable in practical applications.

[0062] In summary, the embodiments of this application combine two existing neural network weight noise-adding training methods to propose a novel multi-noise-adding training method. The core idea of ​​this method is to find the optimal solution during the process of multiple random weight noise additions. Specifically, in this method, multiple random noise additions are performed during the training process of each batch of inputs to generate multiple different noise states. The optimal weight adjustment direction is selected by comparing the similarity between these states and the actual inference model. Therefore, the model can not only consider various possible noise situations, but also avoid over-adapting to a specific noise situation.

[0063] From another perspective, this application can use the contour plot of the neural network objective function in the solution space as a reference, such as... Figure 7 As shown in the diagram, blue stars represent the network state under ideal conditions with no noise, which is the ideal working state of the neural network under the influence of no interference or noise; yellow stars represent the network state generated due to noise in real-world situations, i.e., the actual inference model, which is the real working state of the neural network in the real world when facing various uncertainties and noise; green stars represent the network under normal noise conditions, which is the state generated by adding noise to weights in a single completely random manner under ideal working conditions, simulating the performance of the neural network when facing general noise; black stars represent the network under adversarial weight perturbation conditions, which is the state generated under very specific and single conditions, simulating the performance of the neural network when facing the worst case; red stars represent the network under multiple noise conditions, which is a specific state determined by further determining multiple randomly generated states.

[0064] In each iteration, this application first randomly generates multiple noisy states (green stars) and observes the network's performance under these states, i.e., the magnitude of the corresponding objective function value. Second, this application selects a specific state (red star) representing the worst-case scenario from these states. Probabilistically, the red star is more likely to be closest to the yellow star (corresponding to the actual inference model state). Therefore, by optimizing this specific state, this application can improve the neural network's performance when facing real-world noise. In other words, the network model obtained through multiple noise additions is more likely to have the highest similarity to the actual inference model, thus optimizing the multi-noise model can better improve network performance.

[0065] According to the multi-noise training method based on memristor neural networks proposed in this application, the initial multi-noise training model and training iteration parameters of the target memristor neural network are obtained, and it is determined whether the training iteration parameters meet the preset iteration requirements. If the training iteration parameters meet the iteration requirements, when the current batch index parameters of the initial multi-noise training model meet the preset batch requirements, a model list and a loss list corresponding to the current batch index parameters are established, and the current noise multiplicity index corresponding to the initial multi-noise training model is obtained. Based on the current noise multiplicity index and the preset multiplicity index analysis strategy, noise multiplicity analysis is performed on the current noise multiplicity index, and the noise multiplicity analysis results are obtained. Weight noise addition or model optimization operations are performed through the model list, loss list, and noise multiplicity analysis results to generate the multi-noise model corresponding to the target memristor neural network. The network model obtained by multi-noise in this application has a high similarity to the actual inference model, so optimizing the multi-noise model can greatly improve the network model performance.

[0066] Secondly, with reference to the accompanying drawings, a multi-noise training device based on a memristor neural network according to an embodiment of this application is described.

[0067] Figure 8 This is a block diagram of a multi-noise training device based on a memristor neural network according to an embodiment of this application.

[0068] like Figure 8 As shown, the multi-noise training device 10 based on memristor neural network includes: a determination module 100, an establishment module 200, and an analysis module 300.

[0069] The determining module 100 is used to obtain the initial training model and training iteration parameters of the target memristor neural network with multiple noise, and to determine whether the training iteration parameters meet the preset iteration requirements.

[0070] Module 200 is established to create a model list and a loss list corresponding to the current batch index parameters when the current batch index parameters of the initial multi-noise training model meet the preset batch requirements, if the training iteration parameters meet the iteration requirements. At the same time, it obtains the current noise multiplicity index corresponding to the initial multi-noise training model.

[0071] The analysis module 300 is used to perform noise multiplication analysis on the current noise multiplication index based on the current noise multiplication index and the preset multiplication index analysis strategy, and obtain the noise multiplication analysis results. Then, it performs weight noise addition or model optimization operations through the model list, loss list and noise multiplication analysis results to generate a multi-noise model corresponding to the target memristor neural network.

[0072] Optionally, in one embodiment of this application, the determining module 100 includes an initialization unit and a termination unit.

[0073] The initialization unit is used to perform initialization operations on the target memristor neural network to generate the multi-noise initial training model and training iteration parameters corresponding to the target memristor neural network, and to determine whether the training iteration parameters meet the iteration requirements.

[0074] Termination unit, used to terminate the training of the target memristor neural network if the training iteration parameters do not meet the iteration requirements.

[0075] Optionally, in one embodiment of this application, the establishment module 200 includes: a first judgment unit and an acquisition unit.

[0076] The first judgment unit is used to determine whether the index parameters of the current batch meet the preset batch requirements, provided that the training iteration parameters meet the iteration requirements.

[0077] The acquisition unit is used to build a model list and a loss list and acquire the current noisy multiplicity index if the index parameters of the current batch meet the preset batch requirements; otherwise, it terminates the training of the target memristor neural network.

[0078] Optionally, in one embodiment of this application, the analysis module 300 includes: a second judgment unit, a weighted noise-adding unit, and a model optimization unit.

[0079] The second judgment unit is used to determine whether the current noisy multiplicity index meets the preset multiplicity index condition.

[0080] The weighted noise unit is used to perform a single random weighted noise processing on the initial multi-noise training model if the current noise multiplicity index meets the preset multiplicity index condition, so as to obtain a noise-generated model. At the same time, the noise-generated model is added to the model list, and the loss value of the noise-generated model is calculated and added to the loss list.

[0081] The model optimization unit is used to compare all loss values ​​in the loss list to obtain the maximum loss value if the current denoising multiplicity index does not meet the preset multiplicity index condition. It then obtains the denoising generation model corresponding to the maximum loss value in the model list, updates the weight parameters of the denoising generation model corresponding to the maximum loss value to generate a new denoising generation model, and iteratively executes weight denoising or model optimization operations according to the new denoising generation model and the preset model iteration strategy to generate the multi-noise model corresponding to the target memristor neural network.

[0082] It should be noted that the foregoing explanation of the embodiment of the multiple noise-adding training method based on memristor neural network also applies to the multiple noise-adding training device based on memristor neural network in this embodiment, and will not be repeated here.

[0083] The multi-noise training device based on a memristor neural network proposed in this application includes a determination module for obtaining the initial multi-noise training model and training iteration parameters of the target memristor neural network, and determining whether the training iteration parameters meet preset iteration requirements; an establishment module for establishing a model list and a loss list corresponding to the current batch index parameters when the current batch index parameters of the initial multi-noise training model meet preset batch requirements, and simultaneously obtaining the current noise multiplicity index corresponding to the initial multi-noise training model; and an analysis module for performing noise multiplicity analysis on the current noise multiplicity index based on the current noise multiplicity index and a preset multiplicity index analysis strategy, and obtaining the noise multiplicity analysis results, so as to perform weight noise addition or model optimization operations through the model list, loss list, and noise multiplicity analysis results to generate a multi-noise model corresponding to the target memristor neural network. The network model obtained by multi-noise in this application has a high similarity to the actual inference model, so optimizing the multi-noise model can greatly improve the network model performance.

[0084] Figure 9 A schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device may include:

[0085] The memory 901, the processor 902, and the computer program stored on the memory 901 and capable of running on the processor 902.

[0086] When the processor 902 executes the program, it implements the multi-noise training method based on memristor neural network provided in the above embodiments.

[0087] Furthermore, electronic devices also include:

[0088] Communication interface 903 is used for communication between memory 901 and processor 902.

[0089] The memory 901 is used to store computer programs that can run on the processor 902.

[0090] The memory 901 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.

[0091] If the memory 901, processor 902, and communication interface 903 are implemented independently, then the communication interface 903, memory 901, and processor 902 can be interconnected via a bus to complete communication between them. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 9 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0092] Optionally, in a specific implementation, if the memory 901, processor 902, and communication interface 903 are integrated on a single chip, then the memory 901, processor 902, and communication interface 903 can communicate with each other through an internal interface.

[0093] The processor 902 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.

[0094] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the above-described multi-noise training method based on a memristor neural network.

[0095] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0096] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0097] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or N executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.

[0098] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.

[0099] It should be understood that the various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, the N steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0100] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.

[0101] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0102] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.

Claims

1. A multi-noise training method based on memristor neural networks, characterized in that, Includes the following steps: Obtain the initial training model and training iteration parameters of the target memristor neural network with multiple noise, and determine whether the training iteration parameters meet the preset iteration requirements; If the training iteration parameters meet the iteration requirements, then when the current batch index parameter of the initial training model with multiple noise meets the preset batch requirements, a model list and a loss list corresponding to the current batch index parameter are established, and the current noise multiplicity index corresponding to the initial training model with multiple noise is obtained. Based on the current noise multiplicity index and the preset multiplicity index analysis strategy, noise multiplicity analysis is performed on the current noise multiplicity index, and noise multiplicity analysis results are obtained. Weight noise addition or model optimization operations are then performed through the model list, the loss list, and the noise multiplicity analysis results to generate the multi-noise model corresponding to the target memristor neural network. The step of performing noise multiplication analysis on the current noise multiplication index based on the current noise multiplication index and a preset multiplication index analysis strategy, and obtaining the noise multiplication analysis result, to perform weight noise addition or model optimization operations through the model list, the loss list, and the noise multiplication analysis result, in order to generate a multi-noise model corresponding to the target memristor neural network, includes: Determine whether the current noisy multiplicity index meets the preset multiplicity index condition; If the current noise multiplicity index satisfies the preset multiplicity index condition, then the initial training model with multiple noise is subjected to a single random weight noise processing to obtain a noise generation model. At the same time, the noise generation model is added to the model list, and the loss value of the noise generation model is calculated and added to the loss list. If the current noise multiplicity index does not meet the preset multiplicity index condition, then all loss values ​​in the loss list are compared to obtain the maximum loss value, and the noise generation model corresponding to the maximum loss value in the model list is obtained. The weight parameters of the noise generation model corresponding to the maximum loss value are updated to generate a new noise generation model. The weight noise addition or model optimization operation is iteratively executed according to the new noise generation model and the preset model iteration strategy to generate the multi-noise model corresponding to the target memristor neural network.

2. The method according to claim 1, characterized in that, The step of obtaining the initial training model and training iteration parameters of the target memristor neural network with multiple noise, and determining whether the training iteration parameters meet the preset iteration requirements, includes: The target memristor neural network is initialized to generate the multiple noise-added initial training model and the training iteration parameters corresponding to the target memristor neural network, and it is determined whether the training iteration parameters meet the iteration requirements. If the training iteration parameters do not meet the iteration requirements, then the training of the target memristor neural network is terminated.

3. The method according to claim 2, characterized in that, If the training iteration parameters meet the iteration requirements, then when the current batch index parameter of the initial multi-noise training model meets the preset batch requirements, a model list and a loss list corresponding to the current batch index parameter are established, and the current noise multiplicity index corresponding to the initial multi-noise training model is obtained, including: If the training iteration parameters meet the iteration requirements, determine whether the current batch index parameters meet the preset batch requirements. If the current batch index parameter meets the preset batch requirements, then the model list and the loss list are established, and the current noisy multiplicity index is obtained; otherwise, the training of the target memristor neural network is terminated.

4. A multi-noise training device based on a memristor neural network, characterized in that, include: The determination module is used to obtain the initial training model and training iteration parameters of the target memristor neural network with multiple noise, and to determine whether the training iteration parameters meet the preset iteration requirements. A module is established to create a model list and a loss list corresponding to the current batch index parameter when the current batch index parameter of the initial training model with multiple noise meets the preset batch requirement, if the training iteration parameters meet the iteration requirements, and at the same time obtain the current noise multiplicity index corresponding to the initial training model with multiple noise. The analysis module is used to perform noise multiplication analysis on the current noise multiplication index based on the current noise multiplication index and the preset multiplication index analysis strategy, and obtain the noise multiplication analysis result, so as to perform weight noise addition or model optimization operation through the model list, the loss list and the noise multiplication analysis result, so as to generate the multi-noise model corresponding to the target memristor neural network; The analysis module includes: The second judgment unit is used to determine whether the current noisy multiplicity index meets the preset multiplicity index condition; The weighted noise unit is used to perform a single random weighted noise processing on the initial training model with multiple noise if the current noise multiplicity index satisfies the preset multiplicity index condition, so as to obtain a noise-generated model, and add the noise-generated model to the model list, and calculate the loss value of the noise-generated model and add the loss value to the loss list. The model optimization unit is configured to, if the current noise multiplicity index does not satisfy the preset multiplicity index condition, compare all loss values ​​in the loss list to obtain the maximum loss value, obtain the noise generation model corresponding to the maximum loss value in the model list, perform a weight parameter update operation on the noise generation model corresponding to the maximum loss value to generate a new noise generation model, and iteratively execute the weight noise addition or model optimization operation according to the new noise generation model and the preset model iteration strategy to generate the multi-noise model corresponding to the target memristor neural network.

5. The apparatus according to claim 4, characterized in that, The determining module includes: An initialization unit is used to perform an initialization operation on the target memristor neural network to generate the multiple noise-added initial training model and the training iteration parameters corresponding to the target memristor neural network, and to determine whether the training iteration parameters meet the iteration requirements. A termination unit is used to terminate the training of the target memristor neural network if the training iteration parameters do not meet the iteration requirements.

6. The apparatus according to claim 5, characterized in that, The establishment module includes: The first judgment unit is used to determine whether the current batch index parameter meets the preset batch requirement when the training iteration parameters meet the iteration requirements. The acquisition unit is configured to, if the current batch index parameter meets the preset batch requirements, establish the model list and the loss list, and acquire the current noisy multiplicity index; otherwise, terminate the training of the target memristor neural network.

7. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, the processor executing the program to implement the multiple noise-adding training method based on a memristor neural network as described in any one of claims 1-3.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, The program is executed by the processor to implement the multi-noise training method based on memristor neural networks as described in any one of claims 1-3.

Citation Information

Patent Citations

  • Training of artificial neural networks

    US20200327406A1