An on-chip learning neuromorphic chip and training method

By controlling the training window of the on-chip learning neuromorphic chip on-chip learning, the number of intermediate pulses saved and weight updates is reduced, and the problem of high energy consumption for training on-chip learning neuromorphic chips is solved, achieving the reduction of energy consumption.

CN113672552BActive Publication Date: 2025-08-19TSINGHUA UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110953844.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-19
Publication Date
2025-08-19
Estimated Expiration
2041-08-19

AI Technical Summary

Technical Problem

On-chip learning neuromorphic chips consume higher energy during training, which requires reducing training energy consumption.

Method used

Through the training state machine, the training window of the learning neuromorphic chip on the chip is controlled, and the control pulse buffer saves the intermediate pulse in the training window and stops saving after leaving the window. The weight update module only updates the weight based on the intermediate pulse and error calculation results in the window.

Benefits of technology

It effectively reduces the number of times the neural network updates the weights during training, thereby significantly reducing the training energy consumption of on-chip learning neuromorphic chips.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113672552B_ABST
    Figure CN113672552B_ABST
Patent Text Reader

Abstract

The present invention provides an on-chip learning neuromorphic chip and training method. The technical solution is as follows: a data buffer outputs training samples to a neural network; the neural network trains the input training samples and inputs intermediate pulses generated during the training process into a pulse buffer. The pulse buffer stores the intermediate pulses input by the neural network after a training state machine controls the on-chip learning neuromorphic chip to enter and exit a training window, stops storing the intermediate pulses input by the neural network upon leaving the training window, and inputs the stored intermediate pulses into a weight update module. Simultaneously, the neural network also outputs the training result pulses to an error calculation module, so that the error calculation module calculates errors based on the result pulses and outputs the error calculation results to the weight update module. The weight update module then calculates weight changes based on the intermediate pulses and the error calculation results, and updates the weights of the neural network accordingly. The present invention can reduce training energy consumption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of integrated circuit design, and in particular to an on-chip learning neuromorphic chip and a training method. Background Art

[0002] With the development of neural networks, more and more neuromorphic chips are being used in daily life. Compared with neuromorphic chips that only perform recognition, neuromorphic chips with on-chip learning capabilities (i.e., on-chip learning neuromorphic chips) have the following significant characteristics:

[0003] High precision: On-chip learning neuromorphic chips can adjust the neural network weights according to the actual usage environment, thereby achieving higher accuracy;

[0004] High flexibility: Users can customize the on-chip learning neuromorphic chip to create new recognition categories, thus having significant features such as and.

[0005] However, since on-chip learning neuromorphic chips require additional energy consumption for training, their energy consumption is high. Summary of the Invention

[0006] In view of this, an object of the present invention is to provide an on-chip learning neuromorphic chip and a training method that can reduce training energy consumption.

[0007] In order to achieve the above object, the present invention provides the following technical solutions:

[0008] An on-chip learning neuromorphic chip includes: a data buffer, a training state machine, a neural network, a pulse buffer, an error calculation module, and a weight update module;

[0009] The data buffer is used to cache training samples and output the cached training samples to the neural network;

[0010] The neural network is used to train the training samples input from the data buffer, output the intermediate pulses generated during the training process to the pulse buffer, and output the result pulses obtained from the training to the error calculation module;

[0011] The training state machine is used to control the on-chip learning neuromorphic chip to enter and leave the training window;

[0012] The pulse buffer is used to save the intermediate pulses input by the neural network after the on-chip learning neuromorphic chip enters the training window; when the on-chip learning neuromorphic chip leaves the training window, stop saving the intermediate pulses input by the neural network and output the saved intermediate pulses to the weight update module;

[0013] The error calculation module is used to calculate the error according to the result pulse input by the neural network, and output the error calculation result to the weight update module;

[0014] The weight updating module is used to calculate the weight change according to the intermediate pulse output by the pulse buffer and the error calculation result input by the error calculation module, and update the weight of the neural network according to the weight change.

[0015] A training method for an on-chip learning neuromorphic chip, the on-chip learning neuromorphic chip comprising: a data buffer, a training state machine, a neural network, a pulse buffer, an error calculation module, and a weight update module; the method comprising:

[0016] The data buffer inputs the cached training samples into the neural network;

[0017] The neural network trains the input training samples and outputs intermediate pulses generated during the training process to a pulse buffer, so that the pulse buffer saves the intermediate pulses input by the neural network after the training state machine control chip-based learning neuromorphic chip enters the training window, and stops saving the intermediate pulses input by the neural network when the training state machine control chip-based learning neuromorphic chip leaves the training window, and outputs the saved intermediate pulses to the weight update module; at the same time, the neural network also outputs the result pulses obtained from the training to the error calculation module, so that the error calculation module calculates the error based on the result pulses input by the neural network, and outputs the error calculation result to the weight update module;

[0018] The weight updating module calculates a weight change according to the intermediate pulse output by the pulse buffer and the error calculation result input by the error calculation module, and updates the weight of the neural network according to the weight change.

[0019] It can be seen from the above technical solution that in the present invention, the training window of the on-chip learning neuromorphic chip is controlled by the training state machine, and then the pulse buffer is controlled to save the intermediate pulses output by the neural network within the training window of the on-chip learning neuromorphic chip. After the on-chip learning neuromorphic chip leaves the training window, the intermediate pulses output by the neural network are no longer saved, but the saved intermediate pulses are output to the weight update module, so that the weight update module only updates the weights of the neural network according to the intermediate pulses saved by the pulse buffer in the training window of the on-chip learning neuromorphic chip and the error calculation results of the error calculation module, thereby greatly reducing the number of times the neural network updates the weights during the training process, and therefore can effectively reduce the training energy consumption of the on-chip learning neuromorphic chip. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0021] Figure 1 2 is a schematic diagram of the structure of a learning-on-a-chip neuromorphic chip according to an embodiment of the present invention;

[0022] Figure 2 2 is a schematic diagram of the state transition of the training state machine according to an embodiment of the present invention;

[0023] Figure 3 Schematic diagram of the architecture of a neural network according to an embodiment of the present invention;

[0024] Figure 4 This is a schematic diagram of the structure of an on-chip learning neuromorphic chip according to a second embodiment of the present invention;

[0025] Figure 5 2 is a schematic diagram of the structure of a weight updating module according to an embodiment of the present invention;

[0026] Figure 6 This is a flow chart of a training method for an on-chip learning neuromorphic chip according to an embodiment of the present invention. DETAILED DESCRIPTION

[0027] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0028] The terms "first", "second", "third", "fourth", etc. (if any) in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way are interchangeable where appropriate, so that the embodiments of the invention described herein can, for example, be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or that are inherent to these processes, methods, products or apparatus.

[0029] The following specific embodiments are used to describe the technical solution of the present invention in detail. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0030] See also Figure 1 , Figure 1 Schematic diagram of the structure of a learning-on-a-chip neuromorphic chip according to an embodiment of the present invention. Figure 1 As shown, the on-chip learning neuromorphic chip includes: a data buffer 101, a training state machine 102, a neural network 103, a pulse buffer 104, an error calculation module 105, and a weight update module 106;

[0031] In this embodiment, the data buffer 101 is used to buffer training samples and output the buffered training samples to the neural network 103.

[0032] In this embodiment, the neural network 103 is used to train the training samples input from the data buffer 101, output the intermediate pulses generated during the training process to the pulse buffer 104, and output the result pulses obtained from the training to the error calculation module 105.

[0033] In actual applications, when neural network 103 trains training samples, the input layer neurons and hidden layer neurons in the hidden layer of neural network 103 will both emit pulses. These pulses are called intermediate pulses. Furthermore, when neural network 103 trains training samples, the output layer neurons in the output layer of neural network 103 will also emit pulses. The pulses output by the output layer neurons are called result pulses.

[0034] In this embodiment, the training state machine 102 is used to control the on-chip learning neuromorphic chip to enter and leave the training window.

[0035] The training state machine 102 controls the on-chip learning neuromorphic chip to enter and leave the training window in the following two ways:

[0036] The first is to control the on-chip learning neuromorphic chip to enter and leave the training window through external signals.

[0037] In this way, the user's actual training needs manually control the on-chip learning neuromorphic chip to enter and leave the training window.

[0038] When the user determines that it is necessary to enter the training window based on actual training needs, an external signal indicating entry into the training window can be input into the training state machine 102. Accordingly, when the training state machine 102 receives the external signal indicating entry into the training window, it controls the on-chip learning neuromorphic chip to enter the training window.

[0039] When the user determines that it is necessary to leave the training window based on actual training needs, an external signal instructing to leave the training window can be input into the training state machine 102. Accordingly, when the training state machine 102 receives the external signal instructing to leave the training window, it controls the on-chip learning neuromorphic chip to leave the training window.

[0040] The second method is to set an entry or exit flag for the training sample, thereby controlling the on-chip learning neuromorphic chip to enter or exit the training window by checking whether the training sample carries the entry or exit flag.

[0041] Specifically, before outputting the cached training sample to the neural network 103, the data buffer 101 can detect whether the training sample carries an identifier of entering or leaving the training window. If it is detected that the training sample carries an identifier of entering the training window, an indication of entering the training window is output to the training state machine 102; if it is detected that the training sample carries an identifier of leaving the training window, an indication of leaving the training window is output to the training state machine 102.

[0042] Accordingly, when the training state machine 102 receives an instruction to enter the training window from the data buffer 101, it controls the on-chip learning neuromorphic chip to enter the training window. When the training state machine 102 receives an instruction to leave the training window from the data buffer 101, it controls the on-chip learning neuromorphic chip to leave the training window.

[0043] In this embodiment, the training state machine 102 controls the training window of the on-chip learning neuromorphic chip by switching between three training states, such as Figure 2 As shown, the three training states of the training state machine 102 are respectively a skip state (denoted by S0), a training state (denoted by S1), and an update state (denoted by S2).

[0044] in,

[0045] The training state machine 102 is initially in the S0 state;

[0046] When the training state machine 102 receives an external signal indicating entry into the training window or an instruction from the data buffer 101 to enter the training window, it changes from the S0 state to the S1 state, and the on-chip learning neuromorphic chip enters the training window;

[0047] When the training state machine 102 receives an external signal indicating to leave the training window or an instruction to leave the training window input by the data buffer 101, it changes from the S1 state to the S2 state. At this time, the on-chip learning neuromorphic chip leaves the training window.

[0048] In addition, when the training state machine 102 is in the S2 state, the weight update module 106 will calculate the weight change and update the weight of the neural network accordingly. After the weight update module 106 completes the weight update of the neural network, the training state machine 102 changes from the S2 state to the S0 state. This part will be explained in detail later.

[0049] It can be seen that the period during which the S1 state of the training state machine 102 exists is the training window of the on-chip learning neuromorphic chip. The training state machine 102 controls the on-chip learning neuromorphic chip to enter the training window, that is, the training state machine 102 controls itself to change from the S0 state to the S1 state; the training state machine 102 controls the on-chip learning neuromorphic chip to leave the training window, that is, the training state machine 102 controls itself to change from the S1 state to the S2 state.

[0050] In this embodiment, the pulse buffer 104 is used to store the intermediate pulses input by the neural network 103 after the on-chip learning neuromorphic chip enters the training window; when the on-chip learning neuromorphic chip leaves the training window, it stops storing the intermediate pulses input by the neural network 103 and outputs the stored intermediate pulses to the weight update module 106;

[0051] In this embodiment, the error calculation module 105 is used to calculate the error based on the result pulse input of the neural network 103, and output the error calculation result to the weight update module.

[0052] like Figure 3 As shown, the neural network 103 includes an input layer, multiple hidden layers ( Figure 3 Only two hidden layers are drawn: L0 layer, L1 layer) and output layer. Figure 3 As can be seen, the output layer includes multiple output neurons, each of which may output a result pulse. In this embodiment, the result pulse includes the result pulse output by each output neuron of the neural network 103 within the training window of the on-chip learning neuromorphic chip.

[0053] In addition, there may be errors between the result pulses output by the neural network 103 (i.e., the recognition results obtained through training) and the actual content. For example, after the neural network 103 is trained on a kitten video, different output neurons of the neural network 103 output result pulses corresponding to different recognition results. These result pulses may have errors with the actual video content (kitten). The error calculation module 105 is used to calculate the errors generated by these output neurons.

[0054] In this embodiment, the error calculation module 105 calculates the error based on the result pulse input by the neural network 103, including:

[0055] For each output neuron of the neural network 103, the following operations are performed:

[0056] When it is determined that the output neuron is the target neuron, if the number of result pulses output by the output neuron within the training window of the on-chip learning neuromorphic chip is 0, then the error generated by the output neuron is determined to be 1; otherwise, the error generated by the output neuron is determined to be 0;

[0057] When it is determined that the output neuron is not the target neuron, if the number of result pulses output by the output neuron within the training window of the on-chip learning neuromorphic chip is 0, then the error generated by the output neuron is determined to be 0; otherwise, the error generated by the output neuron is determined to be -1.

[0058] Here, the target neuron refers to the output neuron that outputs the correct recognition result. For example, in the above training on the kitten video, the neuron that outputs the result pulse corresponding to the correct recognition result "kitten" is the target neuron. In actual applications, for a specific training sample, the output neuron that outputs the correct recognition result for that training sample (i.e., the target neuron) is known.

[0059] In this embodiment, the weight updating module 106 is used to calculate the weight change according to the intermediate pulse output by the pulse buffer 104 and the error calculation result input by the error calculation module 105, and update the weight of the neural network according to the weight change.

[0060] like Figure 3 As shown, each hidden layer of the neural network 103 includes multiple hidden layer neurons; the intermediate pulses include pulses emitted by each hidden layer neuron in each hidden layer; in addition, the error calculation result calculated by the error calculation module 105 includes the error generated by each output neuron of the neural network 103.

[0061] In this embodiment, the weight updating module 106 calculates the weight change according to the intermediate pulse output by the pulse buffer 104 and the error calculation result input by the error calculation module 105, which may specifically include:

[0062] For each output layer neuron n, the following formula is used to determine the hidden layer adjacent to the output layer (in Figure 3 The change in the synaptic weight of each hidden layer neuron m in the hidden layer adjacent to the output layer (i.e., layer L1) connected to the output layer neuron n

[0063] Among them, l r are pre-set training parameters; is the number of pulses emitted by hidden layer neuron m and reaching output neuron n within the training window of the on-chip learning neuromorphic chip; T n is the error generated by the output neuron n, and its value range is {-1, 0, 1};

[0064] For each hidden layer neuron a, the following formula is used to determine the previous hidden layer adjacent to the hidden layer to which the hidden layer neuron a belongs (in Figure 3 The change in the synaptic weight of each hidden layer neuron b in the previous hidden layer adjacent to the L1 layer (i.e., the L0 layer) connected to the hidden layer neuron a is

[0065] in, It is used to identify whether the hidden layer neuron a emits a pulse within the training window of the on-chip learning neuromorphic chip. If a pulse is emitted, The value is 1, if no pulse is sent The value of is 0; is the number of pulses emitted by hidden layer neuron b within the training window of the on-chip learning neuromorphic chip; is a preset fixed random weight connecting the output layer neuron to the hidden layer neuron a; T o is the error produced by the output neuron; represents the accumulation of the product of the fixed random weight connecting each output layer neuron to the hidden layer neuron a and the error generated by the output neuron, Figure 3 For example, That is and The cumulative result of .

[0066] In this embodiment, the weight updating module 106 updates the weights of the neural network based on the weight change. Specifically, the weight change corresponding to each synaptic weight is calculated and added to the original weight of the synaptic weight to obtain a new weight value. Furthermore, when the next weight update is performed, the new weight value is used as the original weight of the synaptic weight and is accumulated with the next calculated weight change corresponding to the synaptic weight.

[0067] According to the above Figure 1As can be seen from the introduction, in this embodiment, the training window of the on-chip learning neuromorphic chip is controlled by the training state machine 102, and then the pulse buffer 104 is controlled to save the intermediate pulses output by the neural network 103 within the training window of the on-chip learning neuromorphic chip. After the on-chip learning neuromorphic chip leaves the training window, the intermediate pulses output by the neural network 103 are no longer saved, but the saved intermediate pulses are output to the weight update module 106, so that the weight update module 106 only updates the weights of the neural network 103 according to the intermediate pulses saved by the pulse buffer 104 in the training window of the on-chip learning neuromorphic chip and the error calculation result of the error calculation module 105, thereby greatly reducing the number of times the neural network 103 updates the weights during the training process, and thus can effectively reduce the training energy consumption of the on-chip learning neuromorphic chip.

[0068] See also Figure 4 , Figure 4 Schematic diagram of the structure of the on-chip learning neuromorphic chip according to the second embodiment of the present invention. Figure 4 As shown, the on-chip learning neuromorphic chip is still Figure 1 The on-chip learning neuromorphic chip shown in FIG1 includes the following modules: a data buffer 101, a training state machine 102, a neural network 103, a pulse buffer 104, an error calculation module 105, and a weight update module 106. In addition to the above modules, the on-chip learning neuromorphic chip also includes a skip training module 107.

[0069] In this embodiment, the data buffer 101 is used to buffer training samples and output the buffered training samples to the neural network 103.

[0070] In this embodiment, the neural network 103 is used to train the training samples input from the data buffer 101, output the intermediate pulses generated during the training process to the pulse buffer 104, and output the result pulses obtained from the training to the error calculation module 105.

[0071] In actual applications, when neural network 103 trains training samples, the input layer neurons and hidden layer neurons in the hidden layer of neural network 103 will both emit pulses. These pulses are called intermediate pulses. Furthermore, when neural network 103 trains training samples, the output layer neurons in the output layer of neural network 103 will also emit pulses. The pulses output by the output layer neurons are called result pulses.

[0072] In this embodiment, the training state machine 102 is used to control the on-chip learning neuromorphic chip to enter and leave the training window.

[0073] The training state machine 102 controls the on-chip learning neuromorphic chip to enter and leave the training window in the following two ways:

[0074] The first is to control the on-chip learning neuromorphic chip to enter and leave the training window through external signals.

[0075] In this way, the user's actual training needs manually control the on-chip learning neuromorphic chip to enter and leave the training window.

[0076] When the user determines that it is necessary to enter the training window based on actual training needs, an external signal indicating entry into the training window can be input into the training state machine 102. Accordingly, when the training state machine 102 receives the external signal indicating entry into the training window, it controls the on-chip learning neuromorphic chip to enter the training window.

[0077] When the user determines that it is necessary to leave the training window based on actual training needs, an external signal instructing to leave the training window can be input into the training state machine 102. Accordingly, when the training state machine 102 receives the external signal instructing to leave the training window, it controls the on-chip learning neuromorphic chip to leave the training window.

[0078] The second method is to set an entry or exit flag for the training sample, thereby controlling the on-chip learning neuromorphic chip to enter or exit the training window by checking whether the training sample carries the entry or exit flag.

[0079] Specifically, before outputting the cached training sample to the neural network 103, the data buffer 101 can detect whether the training sample carries an identifier of entering or leaving the training window. If it is detected that the training sample carries an identifier of entering the training window, an indication of entering the training window is output to the training state machine 102; if it is detected that the training sample carries an identifier of leaving the training window, an indication of leaving the training window is output to the training state machine 102.

[0080] Accordingly, when the training state machine 102 receives an instruction to enter the training window from the data buffer 101, it controls the on-chip learning neuromorphic chip to enter the training window. When the training state machine 102 receives an instruction to leave the training window from the data buffer 101, it controls the on-chip learning neuromorphic chip to leave the training window.

[0081] In this embodiment, the training state machine 102 controls the training window of the on-chip learning neuromorphic chip by switching between three training states, such as Figure 2 As shown, the three training states of the training state machine 102 are respectively a skip state (denoted by S0), a training state (denoted by S1), and an update state (denoted by S2).

[0082] in,

[0083] The training state machine 102 is initially in the S0 state;

[0084] When the training state machine 102 receives an external signal indicating entry into the training window or an instruction from the data buffer 101 to enter the training window, it changes from the S0 state to the S1 state, and the on-chip learning neuromorphic chip enters the training window;

[0085] When the training state machine 102 receives an external signal indicating to leave the training window or an instruction to leave the training window input by the data buffer 101, it changes from the S1 state to the S2 state. At this time, the on-chip learning neuromorphic chip leaves the training window.

[0086] In addition, when the training state machine 102 is in the S2 state, the weight update module 106 will calculate the weight change and update the weight of the neural network accordingly. After the weight update module 106 completes the weight update of the neural network, the training state machine 102 changes from the S2 state to the S0 state. This part will be explained in detail later.

[0087] It can be seen that the period during which the S1 state of the training state machine 102 exists is the training window of the on-chip learning neuromorphic chip. The training state machine 102 controls the on-chip learning neuromorphic chip to enter the training window, that is, the training state machine 102 controls itself to change from the S0 state to the S1 state; the training state machine 102 controls the on-chip learning neuromorphic chip to leave the training window, that is, the training state machine 102 controls itself to change from the S1 state to the S2 state.

[0088] In this embodiment, the pulse buffer 104 is used to save the intermediate pulses input by the neural network 103 after the on-chip learning neuromorphic chip enters the training window; when the on-chip learning neuromorphic chip leaves the training window, the pulse buffer 104 stops saving the intermediate pulses input by the neural network 103 and outputs the saved intermediate pulses to the weight update module 106, and also outputs the saved intermediate pulses to the skip training module 107;

[0089] In this embodiment, the error calculation module 105 is used to calculate the error based on the result pulse input by the neural network 103, output the error calculation result to the weight update module, and also output the error calculation result to the skip training module 107.

[0090] like Figure 3 As shown, the neural network 103 includes an input layer, multiple hidden layers ( Figure 3 Only two hidden layers are drawn in the figure), and the output layer. Figure 3 As can be seen, the output layer includes multiple output neurons, each of which may output a result pulse. In this embodiment, the result pulse includes the result pulse output by each output neuron of the neural network 103 within the training window of the on-chip learning neuromorphic chip.

[0091] In addition, there may be errors between the result pulses output by the neural network 103 (i.e., the recognition results obtained through training) and the actual content. For example, after the neural network 103 is trained on a kitten video, different output neurons of the neural network 103 output result pulses corresponding to different recognition results. These result pulses may have errors with the actual video content (kitten). The error calculation module 105 is used to calculate the errors generated by these output neurons.

[0092] In this embodiment, the error calculation module 105 calculates the error based on the result pulse input by the neural network 103, including:

[0093] For each output neuron of the neural network 103, the following operations are performed:

[0094] When it is determined that the output neuron is the target neuron, if the number of result pulses output by the output neuron within the training window of the on-chip learning neuromorphic chip is 0, then the error generated by the output neuron is determined to be 1; otherwise, the error generated by the output neuron is determined to be 0;

[0095] When it is determined that the output neuron is not the target neuron, if the number of result pulses output by the output neuron within the training window of the on-chip learning neuromorphic chip is 0, then the error generated by the output neuron is determined to be 0; otherwise, the error generated by the output neuron is determined to be -1.

[0096] Here, the target neuron refers to the output neuron that outputs the correct recognition result. For example, in the above training on the kitten video, the neuron that outputs the result pulse corresponding to the correct recognition result "kitten" is the target neuron. In actual applications, for a specific training sample, the output neuron that outputs the correct recognition result for that training sample (i.e., the target neuron) is known.

[0097] In this embodiment, the skip training module 107 is used to determine whether to skip the current weight update based on the intermediate pulse output by the pulse buffer 104 and the error calculation result input by the error calculation module 105. If yes, it outputs a skip instruction to the weight update module; otherwise, it outputs an update instruction to the weight update module.

[0098] like Figure 3 As shown, each hidden layer of the neural network 103 includes multiple hidden layer neurons; the intermediate pulses include pulses emitted by each hidden layer neuron in each hidden layer; in addition, the error calculation result calculated by the error calculation module 105 includes the error generated by each output neuron of the neural network 103.

[0099] In this embodiment, the skip training module 107 is used to determine whether to skip the current weight update based on the intermediate pulse output by the pulse buffer 104 and the error calculation result input by the error calculation module 105, specifically including:

[0100] For each output layer neuron n, if each hidden layer neuron m in the hidden layer adjacent to the output layer emits the same number of pulses that reach the output neuron n within the training window of the on-chip learning neuromorphic chip is 0, or the error T generated by the input layer neuron n n If it is 0, it is determined that the current weight update of the synaptic weight connecting the hidden layer neuron m to the output neuron n is skipped; otherwise, it is determined not to skip the current weight update of the synaptic weight connecting the hidden layer neuron m to the output neuron n;

[0101] For each hidden layer neuron a, if the hidden layer neuron a does not emit a pulse within the training window of the on-chip learning neuromorphic chip, the number of pulses emitted by each hidden layer neuron b in the previous hidden layer adjacent to the hidden layer to which the hidden layer neuron a belongs within the training window of the on-chip learning neuromorphic chip is is 0, or the cumulative result of the product of the fixed random weights of each output layer neuron connected to the hidden layer neuron a and the error generated by the output neuron If it is 0, it is determined that the current weight update of the synaptic weight connecting the hidden layer neuron b to the hidden layer neuron a is skipped; otherwise, it is determined not to skip the current weight update of the synaptic weight connecting the hidden layer neuron b to the hidden layer neuron a.

[0102] In this embodiment, the training module 107 is skipped, a low-level signal is output to the weight updating module 106 as a skipping instruction, and a high-level signal is output to the weight updating module 106 as an updating instruction.

[0103] In this embodiment, the weight update module 106 is used to calculate the weight change according to the intermediate pulse output by the pulse buffer 104 and the error calculation result input by the error calculation module 105 when receiving an update instruction from the skip training module 107, and update the weight of the neural network 103 according to the weight change; when receiving the skip instruction from the skip training module 107, the operation of calculating the weight change according to the intermediate pulse output by the pulse buffer 104 and the error calculation result input by the error calculation module 105 and updating the weight of the neural network 103 according to the weight change is not performed.

[0104] In this embodiment, the weight updating module 106 calculates the weight change according to the intermediate pulse output by the pulse buffer 104 and the error calculation result input by the error calculation module 105, which may specifically include:

[0105] For each output layer neuron n, the following formula is used to determine the change in the synaptic weight of each hidden layer neuron m in the hidden layer adjacent to the output layer connected to the output layer neuron n:

[0106] Among them, l r are pre-set training parameters; is the number of pulses emitted by hidden layer neuron m and reaching output neuron n within the training window of the on-chip learning neuromorphic chip; T n is the error generated by the output neuron n;

[0107] For each hidden layer neuron a, the following formula is used to determine the change in synaptic weight of each hidden layer neuron b in the previous hidden layer adjacent to the hidden layer to which the hidden layer neuron a belongs connected to the hidden layer neuron a

[0108] in, It is used to identify whether the hidden layer neuron a emits a pulse within the training window of the on-chip learning neuromorphic chip. If a pulse is emitted, The value is 1, if no pulse is sent The value of is 0; is the number of pulses emitted by hidden layer neuron b within the training window of the on-chip learning neuromorphic chip; is a preset fixed random weight connecting the output layer neuron to the hidden layer neuron a; T o is the error produced by the output neuron; represents the accumulation of the product of the fixed random weight connecting each output layer neuron to the hidden layer neuron a and the error generated by the output neuron, Figure 3 For example, That is and The cumulative result of .

[0109] In this embodiment, the weight updating module 106 updates the weights of the neural network based on the weight change. Specifically, the weight change corresponding to each synaptic weight is calculated and added to the original weight of the synaptic weight to obtain an updated weight. Furthermore, when the next weight update is performed, the new weight value is used as the original weight of the synaptic weight and is accumulated with the next calculated weight change corresponding to the synaptic weight.

[0110] like Figure 5As shown, the weight update module 106 includes a weight change calculation module and an adder, wherein, if the input of the skip training module 107 is a low level, the weight change calculation module calculates the weight change based on the intermediate pulse output by the pulse buffer 104 and the error calculation result input by the error calculation module 105, and the adder adds the weight change and the original weight to obtain the updated weight; if the input of the skip training module 107 is a high level, the weight change calculation module and the adder do not work.

[0111] According to the above Figure 4 As can be seen from the introduction, in this embodiment, the training window of the on-chip learning neuromorphic chip is controlled by the training state machine 102, and the pulse buffer 104 is further controlled to save the intermediate pulses output by the neural network 103 within the training window of the on-chip learning neuromorphic chip. After the on-chip learning neuromorphic chip leaves the training window, the intermediate pulses output by the neural network 103 are no longer saved, but the saved intermediate pulses are output to the weight update module 106, so that the weight update module 106 only updates the weights of the neural network 103 based on the intermediate pulses saved by the pulse buffer 104 within the training window of the on-chip learning neuromorphic chip and the error calculation result of the error calculation module 105, thereby greatly reducing the number of weight updates of the neural network 103 during the training process; in addition, the skip training module is further used within the training window to determine the synaptic weights that do not need to be updated, thereby skipping the current weight update of these synaptic weights, thereby further reducing the number of weight updates of the neural network 103 during the training process. Therefore, this embodiment can more effectively reduce the training energy consumption of the on-chip learning neuromorphic chip.

[0112] The above embodiment of the present invention describes in detail the on-chip learning neuromorphic chip. The present invention also provides a training method for the on-chip learning neuromorphic chip. Figure 6 Provide detailed explanation.

[0113] See also Figure 6 , Figure 6 is a flow chart of a training method for an on-chip learning neuromorphic chip according to an embodiment of the present invention, wherein the on-chip learning neuromorphic chip comprises: a data buffer, a training state machine, a neural network, a pulse buffer, an error calculation module, and a weight update module; Figure 6 As shown, the method mainly includes the following steps:

[0114] Step 601: The data buffer inputs the buffered training samples into the neural network;

[0115] Step 602: The neural network trains the input training samples and outputs intermediate pulses generated during the training process to a pulse buffer, so that the pulse buffer saves the intermediate pulses input by the neural network after the on-chip learning neuromorphic chip on the training state machine control chip enters the training window, and stops saving the intermediate pulses input by the neural network when the on-chip learning neuromorphic chip on the training state machine control chip leaves the training window, and outputs the saved intermediate pulses to the weight update module; at the same time, the neural network also outputs the result pulses obtained from the training to the error calculation module, so that the error calculation module calculates the error based on the result pulses input by the neural network, and outputs the error calculation result to the weight update module;

[0116] Step 603: The weight updating module calculates the weight change according to the intermediate pulse output by the pulse buffer and the error calculation result input by the error calculation module, and updates the weight of the neural network according to the weight change.

[0117] Figure 6 In the method shown,

[0118] The on-chip learning neuromorphic chip also includes a skip training module;

[0119] When the pulse buffer outputs the stored intermediate pulse to the weight update module, the pulse buffer further outputs the stored intermediate pulse to the skip training module;

[0120] When the error calculation module outputs the error calculation result to the weight update module, the error calculation result is further output to the skip training module;

[0121] The method further includes: a skip training module determines whether to skip the current weight update based on the intermediate pulse output by the pulse buffer and the error calculation result input by the error calculation module; if so, a skip instruction is output to the weight update module, so that when the weight update module receives the skip instruction, it is prohibited to perform the operation of calculating the weight change according to the intermediate pulse output by the pulse buffer and the error calculation result input by the error calculation module, and updating the weight of the neural network according to the weight change; otherwise, an update instruction is output to the weight update module, so that when the weight update module receives the update instruction, it calculates the weight change according to the intermediate pulse output by the pulse buffer and the error calculation result input by the error calculation module, and updates the weight of the neural network according to the weight change.

[0122] Figure 6 In the method shown,

[0123] The training state machine controls the on-chip learning neuromorphic chip to enter and leave the training window, including:

[0124] Upon receiving an external signal indicating entering a training window, controlling the on-chip learning neuromorphic chip to enter the training window;

[0125] When receiving an external signal indicating to leave the training window, controlling the on-chip learning neuromorphic chip to leave the training window;

[0126] or,

[0127] Before the data buffer inputs the buffered training sample into the neural network, the method further includes: if it is detected that the training sample carries an identifier of entering the training window, outputting an indication of entering the training window to the training state machine; if it is detected that the training sample carries an identifier of leaving the training window, outputting an indication of leaving the training window to the training state machine;

[0128] The training state machine controls the on-chip learning neuromorphic chip to enter and leave the training window, including:

[0129] Upon receiving an instruction of entering a training window inputted by the data buffer, controlling the on-chip learning neuromorphic chip to enter the training window;

[0130] When receiving the instruction of leaving the training window inputted by the data buffer, the on-chip learning neuromorphic chip is controlled to leave the training window.

[0131] Figure 6 In the method shown,

[0132] The neural network includes an output layer, the output layer includes a plurality of output neurons; the result pulse includes a result pulse output by each output neuron of the neural network within a training window of the on-chip learning neuromorphic chip;

[0133] The error calculation module calculates the error based on the result pulse input of the neural network, including:

[0134] For each output neuron of the neural network, perform the following operations:

[0135] When it is determined that the output neuron is the target neuron, if the number of result pulses output by the output neuron within the training window of the on-chip learning neuromorphic chip is 0, then the error generated by the output neuron is determined to be 1; otherwise, the error generated by the output neuron is determined to be 0;

[0136] When it is determined that the output neuron is not the target neuron, if the number of result pulses output by the output neuron within the training window of the on-chip learning neuromorphic chip is 0, then the error generated by the output neuron is determined to be 0; otherwise, the error generated by the output neuron is determined to be -1.

[0137] Figure 6 In the method shown,

[0138] The neural network includes an output layer and multiple hidden layers; the output layer includes multiple output neurons, and each hidden layer includes multiple hidden layer neurons; the error calculation result includes the error generated by each output neuron of the neural network; the intermediate pulse includes the pulse emitted by each hidden layer neuron in each hidden layer;

[0139] The weight updating module calculates the weight change according to the intermediate pulse output by the pulse buffer and the error calculation result input by the error calculation module, including:

[0140] For each output layer neuron n, the following formula is used to determine the change in the synaptic weight of each hidden layer neuron m in the hidden layer adjacent to the output layer connected to the output layer neuron n:

[0141] Among them, l r are pre-set training parameters; is the number of pulses emitted by hidden layer neuron m and reaching output neuron n within the training window of the on-chip learning neuromorphic chip; T n is the error generated by the output neuron n;

[0142] For each hidden layer neuron a, the following formula is used to determine the change in synaptic weight of each hidden layer neuron b in the previous hidden layer adjacent to the hidden layer to which the hidden layer neuron a belongs connected to the hidden layer neuron a

[0143] in, It is used to identify whether the hidden layer neuron a emits a pulse within the training window of the on-chip learning neuromorphic chip. If a pulse is emitted, The value is 1, if no pulse is sent The value of is 0; is the number of pulses emitted by hidden layer neuron b within the training window of the on-chip learning neuromorphic chip; is a preset fixed random weight connecting the output layer neuron to the hidden layer neuron a; T o is the error produced by the output neuron; represents the accumulation of the product of the fixed random weight connecting each output layer neuron to the hidden layer neuron a and the error produced by that output neuron.

[0144] Figure 6 In the method shown,

[0145] The neural network includes an output layer and multiple hidden layers; the output layer includes multiple output neurons, and each hidden layer includes multiple hidden layer neurons; the error calculation result includes the error generated by each output neuron of the neural network; the intermediate pulse includes the pulse emitted by each hidden layer neuron in each hidden layer;

[0146] The skip training module determines whether to skip the current weight update according to the intermediate pulse output by the pulse buffer and the error calculation result input by the error calculation module, including:

[0147] For each output layer neuron n, if each hidden layer neuron m in the hidden layer adjacent to the output layer emits the same number of pulses that reach the output neuron n within the training window of the on-chip learning neuromorphic chip is 0, or the error T generated by the input layer neuron n n If it is 0, it is determined that the current weight update of the synaptic weight connecting the hidden layer neuron m to the output neuron n is skipped; otherwise, it is determined not to skip the current weight update of the synaptic weight connecting the hidden layer neuron m to the output neuron n;

[0148] For each hidden layer neuron a, if the hidden layer neuron a does not emit a pulse within the training window of the on-chip learning neuromorphic chip, the number of pulses emitted by each hidden layer neuron b in the previous hidden layer adjacent to the hidden layer to which the hidden layer neuron a belongs within the training window of the on-chip learning neuromorphic chip is is 0, or the cumulative result of the product of the fixed random weights of each output layer neuron connected to the hidden layer neuron a and the error generated by the output neuron If it is 0, it is determined that the current weight update of the synaptic weight connecting the hidden layer neuron b to the hidden layer neuron a is skipped; otherwise, it is determined not to skip the current weight update of the synaptic weight connecting the hidden layer neuron b to the hidden layer neuron a.

[0149] Figure 6 In the method shown,

[0150] The skip training module outputs a low-level signal as a skip indication to the weight update module and outputs a high-level signal as an update indication to the weight update module.

[0151] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A neuromorphic chip for on-chip learning, characterized in that The on-chip learning neuromorphic chip includes: a data buffer, a training state machine, a neural network, a pulse buffer, an error calculation module, and a weight update module; The data buffer is used to cache training samples and output the cached training samples to the neural network; The neural network is used to train the training samples input from the data buffer, output the intermediate pulses generated during the training process to the pulse buffer, and output the result pulses obtained from the training to the error calculation module; The training state machine is used to control the on-chip learning neuromorphic chip to enter and leave the training window; The pulse buffer is used to save the intermediate pulses input by the neural network after the on-chip learning neuromorphic chip enters the training window; when the on-chip learning neuromorphic chip leaves the training window, stop saving the intermediate pulses input by the neural network and output the saved intermediate pulses to the weight update module; The error calculation module is used to calculate the error according to the result pulse input by the neural network, and output the error calculation result to the weight update module; The weight updating module is used to calculate the weight change according to the intermediate pulse output by the pulse buffer and the error calculation result input by the error calculation module, and update the weight of the neural network according to the weight change; The neural network includes an output layer and multiple hidden layers; the output layer includes multiple output neurons, and each hidden layer includes multiple hidden layer neurons; the error calculation result includes the error generated by each output neuron of the neural network; the intermediate pulse includes the pulse emitted by each hidden layer neuron in each hidden layer; The weight updating module calculates a weight change according to the intermediate pulse output by the pulse buffer and the error calculation result input by the error calculation module, and updates the weight of the neural network according to the weight change, including: For each output neuron n, determine the change in the synaptic weight of each hidden layer neuron m in the hidden layer adjacent to the output layer connected to the output neuron n; For each hidden layer neuron a, determine the change in the synaptic weight of each hidden layer neuron b in the previous hidden layer adjacent to the hidden layer to which the hidden layer neuron a belongs, connected to the hidden layer neuron a; The calculated weight change corresponding to each synaptic weight is added to the original weight of the synaptic weight to obtain a new weight value.

2. The on-chip learning neuromorphic chip according to claim 1, characterized in that The on-chip learning neuromorphic chip also includes a skip training module; The pulse buffer outputs the stored intermediate pulse to the weight update module and further outputs the stored intermediate pulse to the skip training module; The error calculation module outputs the error calculation result to the weight update module, and further outputs the error calculation result to the skip training module; The skip training module is used to determine whether to skip the current weight update based on the intermediate pulse output by the pulse buffer and the error calculation result input by the error calculation module, and if so, output a skip instruction to the weight update module; otherwise, output an update instruction to the weight update module; The weight update module is used to calculate the weight change according to the intermediate pulse output by the pulse buffer and the error calculation result input by the error calculation module when receiving the update instruction of the skip training module, and update the weight of the neural network according to the weight change; when receiving the skip instruction of the skip training module, prohibit the execution of the operation of calculating the weight change according to the intermediate pulse output by the pulse buffer and the error calculation result input by the error calculation module, and updating the weight of the neural network according to the weight change.

3. The on-chip learning neuromorphic chip according to claim 1 or 2, characterized in that The training state machine controls the on-chip learning neuromorphic chip to enter and leave the training window, including: Upon receiving an external signal indicating entering a training window, controlling the on-chip learning neuromorphic chip to enter the training window; When receiving an external signal indicating to leave the training window, controlling the on-chip learning neuromorphic chip to leave the training window; or, The data buffer, before outputting the buffered training sample to the neural network, further comprises: if it is detected that the training sample carries an identifier of entering the training window, outputting an indication of entering the training window to the training state machine; if it is detected that the training sample carries an identifier of leaving the training window, outputting an indication of leaving the training window to the training state machine; The training state machine controls the on-chip learning neuromorphic chip to enter and leave the training window, including: Upon receiving an instruction from the data buffer to enter a training window, controlling the on-chip learning neuromorphic chip to enter the training window; When receiving the instruction to leave the training window input by the data buffer, the on-chip learning neuromorphic chip is controlled to leave the training window.

4. The on-chip learning neuromorphic chip according to claim 1 or 2, characterized in that The neural network includes an output layer, the output layer includes a plurality of output neurons; the result pulse includes a result pulse output by each output neuron of the neural network within a training window of the on-chip learning neuromorphic chip; The error calculation module calculates the error based on the result pulse input by the neural network, including: For each output neuron of the neural network, perform the following operations: When it is determined that the output neuron is the target neuron, if the number of result pulses output by the output neuron within the training window of the on-chip learning neuromorphic chip is 0, then the error generated by the output neuron is determined to be 1; otherwise, the error generated by the output neuron is determined to be 0; When it is determined that the output neuron is not the target neuron, if the number of result pulses output by the output neuron within the training window of the on-chip learning neuromorphic chip is 0, then the error generated by the output neuron is determined to be 0; otherwise, the error generated by the output neuron is determined to be -1.

5. The on-chip learning neuromorphic chip according to claim 1 or 2, characterized in that The weight update module, for each output neuron n, uses the following formula to determine the change in the synaptic weight of each hidden layer neuron m in the hidden layer adjacent to the output layer connected to the output neuron n: Among them, l r are pre-set training parameters; is the number of pulses emitted by hidden layer neuron m and reaching output neuron n within the training window of the on-chip learning neuromorphic chip; T n is the error generated by the output neuron n; The weight update module, for each hidden layer neuron a, uses the following formula to determine the change in synaptic weight of each hidden layer neuron b in the previous hidden layer adjacent to the hidden layer to which the hidden layer neuron a belongs connected to the hidden layer neuron a in, It is used to identify whether the hidden layer neuron a emits a pulse within the training window of the on-chip learning neuromorphic chip. If a pulse is emitted, The value is 1, if no pulse is sent The value of is 0; is the number of pulses emitted by hidden layer neuron b within the training window of the on-chip learning neuromorphic chip; is a preset fixed random weight connected from the output neuron to the hidden layer neuron a; T o is the error produced by the output neuron; represents the accumulation of the product of the fixed random weight connecting each output neuron to the hidden layer neuron a and the error produced by that output neuron.

6. The on-chip learning neuromorphic chip according to claim 2, characterized in that The skip training module determines whether to skip the current weight update according to the intermediate pulse output by the pulse buffer and the error calculation result input by the error calculation module, including: For each output neuron n, if the number of pulses emitted by each hidden layer neuron m in the hidden layer adjacent to the output layer and reaching the output neuron n within the training window of the on-chip learning neuromorphic chip is is 0, or the error T produced by the output neuron n n If it is 0, it is determined that the current weight update of the synaptic weight connecting the hidden layer neuron m to the output neuron n is skipped; otherwise, it is determined not to skip the current weight update of the synaptic weight connecting the hidden layer neuron m to the output neuron n; For each hidden layer neuron a, if the hidden layer neuron a does not emit a pulse within the training window of the on-chip learning neuromorphic chip, the number of pulses emitted by each hidden layer neuron b in the previous hidden layer adjacent to the hidden layer to which the hidden layer neuron a belongs within the training window of the on-chip learning neuromorphic chip is is 0, or the cumulative product of the fixed random weight of each output neuron connected to the hidden layer neuron a and the error generated by the output neuron If it is 0, it is determined that the current weight update of the synaptic weight connecting the hidden layer neuron b to the hidden layer neuron a is skipped; otherwise, it is determined not to skip the current weight update of the synaptic weight connecting the hidden layer neuron b to the hidden layer neuron a.

7. The on-chip learning neuromorphic chip according to claim 2, characterized in that The skip training module outputs a low-level signal as a skip instruction to the weight updating module, and outputs a high-level signal as an update instruction to the weight updating module.

8. A training method for an on-chip learning neuromorphic chip, characterized in that: The on-chip learning neuromorphic chip includes: a data buffer, a training state machine, a neural network, a pulse buffer, an error calculation module, and a weight update module; the method includes: The data buffer inputs the cached training samples into the neural network; The neural network trains the input training samples and outputs intermediate pulses generated during the training process to a pulse buffer, so that the pulse buffer saves the intermediate pulses input by the neural network after the training state machine control chip-based learning neuromorphic chip enters the training window, and stops saving the intermediate pulses input by the neural network when the training state machine control chip-based learning neuromorphic chip leaves the training window, and outputs the saved intermediate pulses to the weight update module; at the same time, the neural network also outputs the result pulses obtained from the training to the error calculation module, so that the error calculation module calculates the error based on the result pulses input by the neural network, and outputs the error calculation result to the weight update module; The weight updating module calculates a weight change according to the intermediate pulse output by the pulse buffer and the error calculation result input by the error calculation module, and updates the weight of the neural network according to the weight change; The neural network includes an output layer and multiple hidden layers; the output layer includes multiple output neurons, and each hidden layer includes multiple hidden layer neurons; the error calculation result includes the error generated by each output neuron of the neural network; the intermediate pulse includes the pulse emitted by each hidden layer neuron in each hidden layer; The step of calculating a weight change according to the intermediate pulse output by the pulse buffer and the error calculation result input by the error calculation module, and updating the weight of the neural network according to the weight change comprises: For each output neuron n, the following formula is used to determine the change in the synaptic weight of each hidden layer neuron m in the hidden layer adjacent to the output layer connected to the output neuron n; For each hidden layer neuron a, the following formula is used to determine the change in the synaptic weight of each hidden layer neuron b in the previous hidden layer adjacent to the hidden layer to which the hidden layer neuron a belongs, connected to the hidden layer neuron a; The calculated weight change corresponding to each synaptic weight is added to the original weight of the synaptic weight to obtain a new weight value.

9. The method according to claim 8, characterized in that The on-chip learning neuromorphic chip also includes a skip training module; When the pulse buffer outputs the stored intermediate pulse to the weight update module, the pulse buffer further outputs the stored intermediate pulse to the skip training module; When the error calculation module outputs the error calculation result to the weight update module, the error calculation result is further output to the skip training module; The method further includes: a skip training module determines whether to skip the current weight update based on the intermediate pulse output by the pulse buffer and the error calculation result input by the error calculation module; if so, a skip instruction is output to the weight update module, so that when the weight update module receives the skip instruction, it is prohibited to perform the operation of calculating the weight change according to the intermediate pulse output by the pulse buffer and the error calculation result input by the error calculation module, and updating the weight of the neural network according to the weight change; otherwise, an update instruction is output to the weight update module, so that when the weight update module receives the update instruction, it calculates the weight change according to the intermediate pulse output by the pulse buffer and the error calculation result input by the error calculation module, and updates the weight of the neural network according to the weight change.

10. The method according to claim 8 or 9, characterized in that The training state machine controls the on-chip learning neuromorphic chip to enter and leave the training window, including: Upon receiving an external signal indicating entering a training window, controlling the on-chip learning neuromorphic chip to enter the training window; When receiving an external signal indicating to leave the training window, controlling the on-chip learning neuromorphic chip to leave the training window; or, Before the data buffer inputs the buffered training sample into the neural network, the method further includes: if it is detected that the training sample carries an identifier of entering the training window, outputting an indication of entering the training window to the training state machine; if it is detected that the training sample carries an identifier of leaving the training window, outputting an indication of leaving the training window to the training state machine; The training state machine controls the on-chip learning neuromorphic chip to enter and leave the training window, including: Upon receiving an instruction of entering a training window inputted by the data buffer, controlling the on-chip learning neuromorphic chip to enter the training window; When receiving the instruction of leaving the training window inputted by the data buffer, the on-chip learning neuromorphic chip is controlled to leave the training window.

11. The method according to claim 8 or 9, characterized in that The neural network includes an output layer, the output layer includes a plurality of output neurons; the result pulse includes a result pulse output by each output neuron of the neural network within a training window of the on-chip learning neuromorphic chip; The error calculation module calculates the error based on the result pulse input of the neural network, including: For each output neuron of the neural network, perform the following operations: When it is determined that the output neuron is the target neuron, if the number of result pulses output by the output neuron within the training window of the on-chip learning neuromorphic chip is 0, then the error generated by the output neuron is determined to be 1; otherwise, the error generated by the output neuron is determined to be 0; When it is determined that the output neuron is not the target neuron, if the number of result pulses output by the output neuron within the training window of the on-chip learning neuromorphic chip is 0, then the error generated by the output neuron is determined to be 0; otherwise, the error generated by the output neuron is determined to be -1.

12. The method according to claim 8 or 9, characterized in that For each output neuron n, the following formula is used to determine the change in the synaptic weight of each hidden layer neuron m in the hidden layer adjacent to the output layer connected to the output neuron n: Among them, l r are pre-set training parameters; is the number of pulses emitted by hidden layer neuron m and reaching output neuron n within the training window of the on-chip learning neuromorphic chip; T n is the error generated by the output neuron n; For each hidden layer neuron a, the following formula is used to determine the change in synaptic weight of each hidden layer neuron b in the previous hidden layer adjacent to the hidden layer to which the hidden layer neuron a belongs connected to the hidden layer neuron a in, It is used to identify whether the hidden layer neuron a emits a pulse within the training window of the on-chip learning neuromorphic chip. If a pulse is emitted, The value is 1, if no pulse is sent The value of is 0; is the number of pulses emitted by hidden layer neuron b within the training window of the on-chip learning neuromorphic chip; is a preset fixed random weight connected from the output neuron to the hidden layer neuron a; T o is the error produced by the output neuron; represents the accumulation of the product of the fixed random weight connecting each output neuron to the hidden layer neuron a and the error produced by that output neuron.

13. The method according to claim 9, characterized in that The neural network includes an output layer and multiple hidden layers; the output layer includes multiple output neurons, and each hidden layer includes multiple hidden layer neurons; the error calculation result includes the error generated by each output neuron of the neural network; the intermediate pulse includes the pulse emitted by each hidden layer neuron in each hidden layer; The skip training module determines whether to skip the current weight update according to the intermediate pulse output by the pulse buffer and the error calculation result input by the error calculation module, including: For each output neuron n, if the number of pulses emitted by each hidden layer neuron m in the hidden layer adjacent to the output layer and reaching the output neuron n within the training window of the on-chip learning neuromorphic chip is is 0, or the error T produced by the output neuron n n If it is 0, it is determined that the current weight update of the synaptic weight connecting the hidden layer neuron m to the output neuron n is skipped; otherwise, it is determined not to skip the current weight update of the synaptic weight connecting the hidden layer neuron m to the output neuron n; For each hidden layer neuron a, if the hidden layer neuron a does not emit a pulse within the training window of the on-chip learning neuromorphic chip, the number of pulses emitted by each hidden layer neuron b in the previous hidden layer adjacent to the hidden layer to which the hidden layer neuron a belongs within the training window of the on-chip learning neuromorphic chip is is 0, or the cumulative product of the fixed random weight of each output neuron connected to the hidden layer neuron a and the error generated by the output neuron If it is 0, it is determined that the current weight update of the synaptic weight connecting the hidden layer neuron b to the hidden layer neuron a is skipped; otherwise, it is determined not to skip the current weight update of the synaptic weight connecting the hidden layer neuron b to the hidden layer neuron a.

14. The method according to claim 8, characterized in that The skip training module outputs a low-level signal as a skip indication to the weight update module and outputs a high-level signal as an update indication to the weight update module.

Citation Information

Patent Citations

  • Configurable neural network reasoning and online learning fusion computing circuit

    CN111832720A

  • Accelerated pulse neural network training method, terminal and storage medium

    CN112529176A