CN113642719A - Method and device for processing data in impulse neural network - Google Patents

Method and device for processing data in impulse neural network Download PDF

Info

Publication number
CN113642719A
CN113642719A CN202010392960.2A CN202010392960A CN113642719A CN 113642719 A CN113642719 A CN 113642719A CN 202010392960 A CN202010392960 A CN 202010392960A CN 113642719 A CN113642719 A CN 113642719A
Authority
CN
China
Prior art keywords
neuron
time
membrane voltage
algorithm
current
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010392960.2A
Other languages
Chinese (zh)
Inventor
田中棋
周栋焯
程捷
郭青海
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Center for Excellence in Molecular Cell Science of CAS
Original Assignee
Huawei Technologies Co Ltd
Center for Excellence in Molecular Cell Science of CAS
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd, Center for Excellence in Molecular Cell Science of CAS filed Critical Huawei Technologies Co Ltd
Priority to CN202010392960.2A priority Critical patent/CN113642719A/en
Publication of CN113642719A publication Critical patent/CN113642719A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/06Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons
    • G06N3/061Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons using biological neurons, e.g. biological neurons connected to an integrated circuit
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/06Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons
    • G06N3/063Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons using electronic means
    • G06N3/065Analogue means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Theoretical Computer Science (AREA)
  • Molecular Biology (AREA)
  • Evolutionary Computation (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Neurology (AREA)
  • Microelectronics & Electronic Packaging (AREA)
  • Image Analysis (AREA)

Abstract

The application provides a method for data processing in a spiking neural network, comprising: acquiring a first membrane voltage of a first neuron at a time t-1 and a first input current of the first neuron at the time t-1; determining whether a rate of change of the first membrane voltage per unit time is greater than a first preset threshold; if the change rate of the first membrane voltage is larger than a first preset threshold value, calculating a second membrane voltage of the first neuron at the time t through a first algorithm according to the first membrane voltage and the first input current; or if the change rate of the first membrane voltage is not larger than a first preset threshold, calculating the second membrane voltage through a second algorithm according to the first membrane voltage and the first input current, wherein the calculation efficiency of the first algorithm is higher than that of the second algorithm, and the calculation accuracy of the second algorithm is higher than that of the first algorithm. The technical scheme provided by the application can realize higher membrane voltage calculation efficiency and can also improve the membrane voltage calculation precision.

Description

Method and device for processing data in impulse neural network
Technical Field
The present application relates to the field of neural networks, and more particularly, to a method and apparatus for data processing in a spiking neural network.
Background
Artificial Intelligence (AI) is a theory, method, technique and application system that uses a digital computer or a machine controlled by a digital computer to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use the knowledge to obtain the best results. In other words, artificial intelligence is a branch of computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a manner similar to human intelligence. Artificial intelligence is the research of the design principle and the realization method of various intelligent machines, so that the machines have the functions of perception, reasoning and decision making. Research in the field of artificial intelligence includes robotics, natural language processing, computer vision, decision and reasoning, human-computer interaction, recommendation and search, AI basic theory, and the like.
Spiking Neural Network (SNN), as an emerging artificial neural network, is closer to a real biological processing system in information processing manner and biological model than a conventional artificial neural network. In the calculation process of calculating the membrane voltage on the pulse neuron, how to improve the calculation accuracy of the membrane voltage while realizing higher calculation efficiency becomes an urgent problem to be solved.
Disclosure of Invention
The application provides a method and a device for processing data in a pulse neural network and the pulse neural network, which can realize higher calculation efficiency of membrane voltage and improve calculation precision of the membrane voltage.
In a first aspect, a method for data processing in a spiking neural network is provided, including: acquiring a first membrane voltage of a first neuron at a time t-1 and a first input current of the first neuron at the time t-1; determining whether a rate of change of the first membrane voltage per unit time is greater than a first preset threshold; if the change rate of the first membrane voltage is larger than a first preset threshold value, calculating a second membrane voltage of the first neuron at the time t through a first algorithm according to the first membrane voltage and the first input current; or if the change rate of the first membrane voltage is not larger than a first preset threshold, calculating the second membrane voltage through a second algorithm according to the first membrane voltage and the first input current, wherein the calculation efficiency of the first algorithm is higher than that of the second algorithm, and the calculation accuracy of the second algorithm is higher than that of the first algorithm.
In the above technical solution, when the change rate of the first membrane voltage is greater than a first preset threshold (i.e., in the rigid region), the second membrane voltage of the first neuron at the time t is calculated by using an algorithm with higher calculation efficiency, and when the change rate of the first membrane voltage is not greater than the first preset threshold (i.e., in the non-rigid region), the second membrane voltage of the first neuron at the time t is calculated by using an algorithm with higher calculation accuracy.
In one possible implementation manner, the method further includes: determining a first firing time T for the first neuron, the first firing time T being between the T-1 time and the T time; determining a current increment according to the first discharge time T and the time T; outputting the current increment to the second neuron, wherein the current increment is used for instructing the second neuron to adjust a second current received from the first neuron according to the current increment, the second current is a current output to the second neuron when the first neuron determines that the second membrane voltage is larger than a second preset threshold, and the second neuron is a next layer neuron of the first neuron.
In another possible implementation, the first firing time T of the first neuron is determined according to an interpolation algorithm.
In another possible implementation, the first firing time T of the first neuron is determined according to a linear interpolation algorithm.
In another possible implementation, the firing time T of the first neuron is determined according to the time T-1 and the first membrane voltage, the time T and the second membrane voltage.
In another possible implementation, the first algorithm is an exponential time difference, ETD, algorithm.
In another possible implementation manner, the determining, according to the first membrane voltage and the first input current, a second membrane voltage on the first neuron by an ETD algorithm specifically includes: determining an estimate of a secondary component of the first rate of change of membrane voltage from the first membrane voltage and the first input current; determining an estimate of a linear principal component of the first rate of change of membrane voltage from a gating variable of an ion channel of the first neuron at the time t-1; determining an estimate of a second membrane voltage across the first neuron based on the estimate of the secondary component of the first rate of membrane voltage change and the estimate of the linear primary component of the first rate of membrane voltage change; determining an estimated value of a secondary component of the second membrane voltage change rate from the estimated value of the second membrane voltage; determining the second membrane voltage based on the estimated value of the secondary component of the first membrane voltage change rate, the estimated value of the linear primary component of the first membrane voltage change rate, and the estimated value of the secondary component of the second membrane voltage change rate.
In another possible implementation manner, the second algorithm is a longge cottage tower RK algorithm.
In another possible implementation manner, the determining the second membrane voltage according to the first membrane voltage and the first input current by using an RK algorithm specifically includes: determining an estimate of a secondary component of the first rate of change of membrane voltage from the first membrane voltage and the first input current; determining an estimate of a second membrane voltage across the first neuron based on the estimate of the secondary component of the first rate of change of membrane voltage; determining an estimated value of a secondary component of the second membrane voltage change rate from the estimated value of the second membrane voltage; determining the second membrane voltage based on the estimated value of the secondary component of the first membrane voltage change rate and the estimated value of the secondary primary component of the second membrane voltage change rate.
In a second aspect, an apparatus for data processing in a spiking neural network is provided, including:
an obtaining module, configured to obtain a first membrane voltage and a first input current on a first neuron, where the first membrane voltage is a membrane voltage value of the first neuron at a time t-1, and the first input current is determined by the first neuron at the time t-1 according to a received input pulse;
a determination module for determining whether a rate of change of the first membrane voltage per unit time is greater than a first preset threshold;
a calculating module, configured to calculate a second membrane voltage on the first neuron according to the first membrane voltage and the first input current by using a first algorithm if a change rate of the first membrane voltage in the unit time is greater than the first preset threshold, where the second membrane voltage is a membrane voltage value of the first neuron at a time t, and the time t-1 is a time before the time t; or
And if the change rate of the first membrane voltage in the unit time is not larger than the first preset threshold, the method is used for calculating a second membrane voltage on the first neuron according to the first membrane voltage and the first input current through a second algorithm, wherein the calculation efficiency of the first algorithm is higher than that of the second algorithm, and the calculation precision of the second algorithm is higher than that of the first algorithm.
In one possible implementation, the determining module is further configured to: determining a first firing time T for the first neuron, the first firing time T being between the T-1 time and the T time; determining a current increment according to the first discharge time T and the time T;
the device further comprises:
an output module, configured to output the current increment to the second neuron, where the current increment is used to instruct the second neuron to adjust a second current received from the first neuron according to the current increment, the second current is a current output to the second neuron when the first neuron determines that the second membrane voltage is greater than a second preset threshold, and the second neuron is a next layer neuron of the first neuron.
In another possible implementation manner, the determining module is specifically configured to: determining a first firing time T for the first neuron according to an interpolation algorithm.
In another possible implementation manner, the determining module is specifically configured to: determining a first firing time T for the first neuron according to a linear interpolation algorithm.
In another possible implementation manner, the determining module is specifically configured to: and determining the discharge time T of the first neuron according to the T-1 time, the first membrane voltage, the T time and the second membrane voltage.
In another possible implementation, the first algorithm is an exponential time difference, ETD, algorithm.
In another possible implementation manner, when the first algorithm is an Exponential Time Difference (ETD) algorithm, the calculating module is specifically configured to: determining an estimate of a secondary component of the first rate of change of membrane voltage from the first membrane voltage and the first input current; determining an estimate of a linear principal component of the first rate of change of membrane voltage from a gating variable of an ion channel of the first neuron at the time t-1; determining an estimate of a second membrane voltage across the first neuron based on the estimate of the secondary component of the first rate of membrane voltage change and the estimate of the linear primary component of the first rate of membrane voltage change; determining an estimated value of a secondary component of the second membrane voltage change rate from the estimated value of the second membrane voltage; determining the second membrane voltage based on the estimated value of the secondary component of the first membrane voltage change rate, the estimated value of the linear primary component of the first membrane voltage change rate, and the estimated value of the secondary component of the second membrane voltage change rate.
In another possible implementation manner, the second algorithm is a longge cottage tower RK algorithm.
In another possible implementation manner, when the second algorithm is a longge kutta RK algorithm, the calculation module is specifically configured to: determining an estimate of a secondary component of the first rate of change of membrane voltage from the first membrane voltage and the first input current; determining an estimate of a second membrane voltage across the first neuron based on the estimate of the secondary component of the first rate of change of membrane voltage; determining an estimated value of a secondary component of the second membrane voltage change rate from the estimated value of the second membrane voltage; determining the second membrane voltage based on the estimated value of the secondary component of the first membrane voltage change rate and the estimated value of the secondary primary component of the second membrane voltage change rate.
In a third aspect, a spiking neural network is provided, which includes:
a first current register to store a first input current for a first neuron at a time t-1, the first input current determined by the first neuron at the time t-1 from a received input pulse;
a first voltage register to store a first membrane voltage for the first neuron at the time t-1;
the first comparator is connected with the first voltage register and used for determining whether the change rate of the first membrane voltage stored in the first voltage register in unit time is larger than a first preset threshold value or not;
a first algorithm circuit, connected to the first current register and the first voltage register, configured to calculate a second membrane voltage across the first neuron according to the first membrane voltage and the first input current when a rate of change of the first membrane voltage in the unit time is greater than the first preset threshold, where the second membrane voltage is a membrane voltage value of the first neuron at a time t, and the time t-1 is a time before the time t; or
And a second algorithm for calculating a second membrane voltage on the first neuron when the rate of change of the first membrane voltage per unit time is not greater than the first preset threshold, wherein the calculation efficiency of the first algorithm is higher than that of the second algorithm, and the calculation accuracy of the second algorithm is higher than that of the first algorithm.
In one possible implementation manner, the method further includes:
an estimation circuit storing a first discharge time T of the first neuron, the first discharge time T being between the T-1 time and the T time;
and the current increment register is connected with the estimation circuit and used for determining a current increment according to the first discharging time T and the time T and outputting the current increment to the second neuron, wherein the current increment is used for indicating the second neuron to adjust a second current received from the first neuron according to the current increment, the second current is a current which is output to the second neuron when the first neuron determines that the second membrane voltage is greater than a second preset threshold, and the second neuron is a next layer neuron of the first neuron.
In another possible implementation manner, the method further includes:
a second voltage register to store a second membrane voltage on the first neuron;
the estimation circuit is connected to the second voltage register and the first voltage register, and is specifically configured to: and determining the discharge time T of the first neuron according to the T-1 moment, the first membrane voltage, the T moment and the second membrane voltage, and storing the first discharge time T of the first neuron.
In another possible implementation, the first algorithm is an exponential time difference, ETD, algorithm.
In another possible implementation manner, when the first algorithm is an Exponential Time Difference (ETD) algorithm, the first algorithm circuit is specifically configured to: determining an estimate of a secondary component of the first rate of change of membrane voltage from the first membrane voltage and the first input current; determining an estimate of a linear principal component of the first rate of change of membrane voltage from a gating variable of an ion channel of the first neuron at the time t-1; determining an estimate of a second membrane voltage across the first neuron based on the estimate of the secondary component of the first rate of membrane voltage change and the estimate of the linear primary component of the first rate of membrane voltage change; determining an estimated value of a secondary component of the second membrane voltage change rate from the estimated value of the second membrane voltage; determining the second membrane voltage based on the estimated value of the secondary component of the first membrane voltage change rate, the estimated value of the linear primary component of the first membrane voltage change rate, and the estimated value of the secondary component of the second membrane voltage change rate.
In another possible implementation manner, the second algorithm is a longge cottage tower RK algorithm.
In another possible implementation manner, when the second algorithm is a longge cottage tower RK algorithm, the first algorithm circuit is specifically configured to: determining an estimate of a secondary component of the first rate of change of membrane voltage from the first membrane voltage and the first input current; determining an estimate of a second membrane voltage across the first neuron based on the estimate of the secondary component of the first rate of change of membrane voltage; determining an estimated value of a secondary component of the second membrane voltage change rate from the estimated value of the second membrane voltage; determining the second membrane voltage based on the estimated value of the secondary component of the first membrane voltage change rate and the estimated value of the secondary primary component of the second membrane voltage change rate.
In a fourth aspect, a computing device is provided that includes a communication interface and a processor. Wherein the processor is configured to control the communication interface to send and receive information, and the processor is connected to the communication interface and configured to execute the method of the first aspect or any one of the possible implementation manners of the first aspect.
Alternatively, the processor may be a general-purpose processor, and may be implemented by hardware or software. When implemented in hardware, the processor may be a logic circuit, an integrated circuit, or the like; when implemented in software, the processor may be a general-purpose processor implemented by reading software code stored in a memory, which may be integrated with the processor, located external to the processor, or stand-alone.
In a fifth aspect, a computer-readable medium is provided, which stores program code, which, when run on a computing device, causes the computing device to perform the method of the first aspect or possible implementation manner of the first aspect.
In a sixth aspect, there is provided a computer program product comprising: computer program code which, when run on a computing device, causes the computing device to perform the method of the first aspect or possible implementation of the first aspect.
Drawings
Fig. 1 is a possible neural network structure provided by an embodiment of the present application.
FIG. 2 is a graph of the change in membrane voltage over time on a pulsing neuron.
FIG. 3 is an architecture diagram of a computing device 100 provided herein.
Fig. 4 is a schematic flow chart of a method for data processing in a spiking neural network according to an embodiment of the present application.
Fig. 5 is a schematic flow chart of another method for data processing in a spiking neural network according to an embodiment of the present disclosure.
Fig. 6 is a schematic diagram of determining a firing time of a pulse neuron according to an embodiment of the present application.
Fig. 7 is a schematic block diagram of an apparatus 700 for data processing in a spiking neural network according to an embodiment of the present disclosure.
Fig. 8 is a schematic circuit block diagram of a spiking neural network provided in an embodiment of the present application.
Fig. 9 is a schematic block diagram of a unified evolutionary algorithm circuit 840 provided in an embodiment of the present application.
Detailed Description
The technical solution in the present application will be described below with reference to the accompanying drawings.
Artificial Intelligence (AI) is a theory, method, technique and application system that uses a digital computer or a machine controlled by a digital computer to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use the knowledge to obtain the best results. In other words, artificial intelligence is a branch of computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a manner similar to human intelligence. In the field of machine learning and cognitive science, Neural Networks (NN) are mathematical or computational models that mimic the structure and function of biological neural networks (the central nervous system of animals, in particular the brain) for estimating or approximating functions. The biological brain is formed by combining a large number of neurons through different connection modes, and the former neuron and the latter neuron are connected through a synapse structure to carry out information transmission.
Fig. 1 shows one possible neural network architecture. Referring to fig. 1, the neural network may include a plurality of nodes, each node simulating a neuron for performing a particular operation, such as an activation function. The connection between the preceding neuron and the following neuron mimics a neuronal synapse (synapse). It is understood that a synapse is a carrier of information between two neurons, and the weight value of a synapse represents the strength of a connection between two neurons.
Spiking Neural Networks (SNNs) are often referred to as third-generation artificial neural networks. The impulse neural network is an emerging artificial neural network, which is closer to a real biological processing system in an information processing mode and a biological model than the traditional artificial neural network. Therefore, the power consumption of the device is lower in the operation process, so that the device has wider application in the fields of future pattern recognition, natural language processing, complex control and optimization and the like.
The transfer of information between neurons in a spiking neural network, in the form of impulses, is based on discrete-valued activity occurring at certain points in time, rather than continuous values. The occurrence of a pulse is determined by differential equations representing various biological processes, the most important of which is the membrane voltage of the neuron. Each neuron changes its membrane voltage with an incoming pulse by accumulating a sequence of pulses from the preceding neuron. When the membrane voltage of a neuron reaches a predetermined voltage level, the neuron will be activated to generate a new signal (e.g., to fire a pulse) and transmit the signal to other neurons connected to the neuron. After the neuron fires a pulse, its membrane voltage continues to change through the sequence of pulses that accumulate preceding neurons, changing the membrane voltage of the neuron. The neurons in the impulse neural network realize the information transmission and processing through the mode, and have the information processing capabilities of nonlinearity, self-adaptation, fault tolerance and the like.
By way of example, an equation that characterizes the voltage of the neuron membrane in a spiking neural network is presented below.
Figure BDA0002486550260000061
Wherein subscript i denotes the ith impulse neuron in the impulse neural network;
Virepresents the membrane voltage on the ith pulse neuron;
c represents the membrane capacitance on the pulsing neuron;
mia gated variable parameter representing a sodium ion current channel on the ith pulse neuron;
ENarepresents the reversal potential of sodium ions on the pulsed neurons;
GNarepresents the maximum conductance of sodium ions on the spiked neurons;
hia gated variable parameter representing a potassium current channel on the ith pulse neuron;
EKrepresents the inversion potential of potassium ions on the ith pulse neuron;
GKrepresents the maximum conductance of potassium ions on the ith pulse neuron;
nito representA gated variable parameter of a leakage current channel on the ith pulse neuron;
ELan inverted potential representing a leakage current on the pulsed neuron;
GLrepresents the maximum conductance of the leakage current on the impulse neuron;
αmrepresenting m about V on a spiking neuroniThe function of (a), can be obtained by fitting experimental data;
αhindicating h about V on a spiking neuroniThe function of (a), can be obtained by fitting experimental data;
αnrepresenting n with respect to V on a spiking neuroniThe function of (a), can be obtained by fitting experimental data;
Figure BDA0002486550260000062
representing the input current received by the ith pulse neuron.
The above equation (1) may also be referred to as a Hodgkin-Huxley (HH) model, which may be used to describe the membrane voltage on the ith pulse neuron as a function of input current
Figure BDA0002486550260000063
But the process of the change.
It should be understood that the issued pulses of the preceding neurons form the input current of the following neurons through a certain conversion relationship
Figure BDA0002486550260000064
The subsequent neuron receives the input current
Figure BDA0002486550260000065
The membrane voltage of the neuron is raised, and when the membrane voltage reaches a certain threshold voltage, the neuron generates a new pulse to be transmitted to a subsequent neuron of the neuron.
It should be noted that one synaptic connection may be used between two neurons in the SNN, or multiple synaptic connections may also be used, which is not specifically limited in this application. Each synapse has a modifiable synapse weight, and multiple pulses transmitted by a pre-synaptic neuron may generate different post-synaptic membrane voltages depending on the magnitude of the synapse weight.
As an example, the input current generated after the pulse signal emitted by the preceding neuron is received by the following neuron
Figure BDA0002486550260000066
Can be characterized by the following formula (2).
Figure BDA0002486550260000067
Wherein the content of the first and second substances,
Figure BDA0002486550260000068
representing an input current of an ith pulse neuron in the pulse neural network;
Figure BDA0002486550260000069
represents the external input current;
Sija weight representing a connection from the jth impulse neuron to the ith impulse neuron;
Figure BDA0002486550260000071
a weight representing a connection between a jth spiking neuron and an ith spiking neuron is excitation or inhibition;
Tjkthe time point of the kth pulse emitted by the jth pulse neuron, namely the discharge time point of the jth pulse neuron, can be the starting point of action between the jth pulse neuron and the ith pulse neuron;
EQrepresents an inversion potential;
αQrepresents the conductance, which can be characterized by the following equation (3).
Figure BDA0002486550260000072
Wherein σdA time scale variable representing a slow decay;
σrrepresenting a rapidly rising time scale variable.
Referring now to FIG. 2, the input current is received to the pulse neuron
Figure BDA0002486550260000073
The change in the membrane voltage will be described later.
FIG. 2 is a graph showing the variation of membrane voltage readings across a spiking neuron. Wherein, the abscissa represents time t, and the ordinate represents the value of the membrane voltage V on the pulse neuron.
As shown in fig. 2, when a pulse neuron receives an external input, its membrane voltage increases with time. The pulse neuron may generate an action potential when its membrane voltage exceeds a fixed threshold (e.g., the horizontal line in fig. 2). In the following firing zone, the slope of the membrane voltage on the pulse neuron is larger. While in the non-firing region, the slope of the membrane voltage on the pulsed neuron is smaller.
It is understood that the slope of the membrane voltage may be the rate of change of the membrane voltage per unit time. The larger slope indicates that the change rate of the membrane voltage of the pulse neuron in unit time is larger. The smaller slope indicates that the change rate of the membrane voltage of the pulse neuron in unit time is smaller.
In the embodiment of the present application, a region in which the change rate of the membrane voltage per unit time is large may be referred to as a rigid region, and a region in which the change rate of the membrane voltage per unit time is small may be referred to as a non-rigid region. When the membrane voltage of a pulse neuron exceeds a fixed threshold, an action potential is generated and enters a rigid region.
In a related technique, the membrane voltage of the i-th pulse neuron may be calculated according to an HH model by a second-order rugge-kutta (RK 2) algorithm. Because the slope of the membrane voltage of the rigid region of the impulse neuron is larger, the RK2 algorithm can adopt larger time step in the non-rigid region of the ith impulse neuron, and in order to meet the requirement of stability, the RK2 algorithm needs to adopt smaller time step in the rigid region of the ith impulse neuron. Smaller time steps lead to less efficient calculation of the membrane voltage.
In another related technique, the membrane voltage of the ith pulse neuron can be calculated according to the HH model by a second-order exponential time difference (ETD 2) algorithm. Although the ETD2 algorithm can adopt larger time step in both rigid and non-rigid regions and has higher calculation efficiency, the ETD2 algorithm needs to decompose the HH model (for example, into a linear rigid part and a non-linear non-rigid part) each time the membrane voltage is calculated, and each decomposition accumulates the calculation error of the membrane voltage, thereby affecting the calculation accuracy of the membrane voltage.
The embodiment of the application provides a data processing method in a pulse neural network, which can realize higher calculation efficiency and improve the calculation precision of membrane voltage in the calculation process of calculating the membrane voltage on a pulse neuron.
Before introducing the method for processing data in the impulse neural network provided by the embodiment of the present application, an application scenario and a system architecture to which the embodiment of the present application is applied are introduced.
The method for processing data in the impulse neural network provided by the embodiment of the application can be applied to artificial intelligence general platforms, such as computers and chips. The method can also be applied to simulation, vehicle-mounted chips and mobile phone chips to realize artificial intelligence (such as picture recognition, scene recognition, automatic driving and the like).
The method for processing data in the spiking neural network provided by the embodiment of the present application may be executed by a data processing apparatus, where the data processing apparatus may be a hardware apparatus, for example: servers, terminal computing devices, etc. The data processing device may also be a software device, specifically a software system running on a hardware computing device. The position where the data processing device is deployed is not limited in the embodiments of the present application. Illustratively, the data processing apparatus may be deployed on a server.
The data processing apparatus may also be logically configured as a multi-part apparatus, e.g., the data processing apparatus may include an obtaining module, a determining module, and the like. The respective components in the data processing apparatus may be respectively disposed in different systems or servers. Each part of the data processing apparatus may operate in three environments, namely, a cloud computing device system, an edge computing device system, or a terminal computing device, or may operate in any two environments of the three environments. The cloud computing device system, the edge computing device system and the terminal computing device are connected through communication paths and can communicate with each other.
In the following, a data processing apparatus is described as an example of a computing device with reference to fig. 3.
FIG. 3 illustratively provides one possible architecture diagram for the computing device 100 of the present application. As shown in fig. 3, computing device 100 may include a processor 101, a memory 102, a communication interface 103, and a bus 104.
In the computing device 100, the number of processors 101 may be one or more, and fig. 3 illustrates only one of the processors 101.
Alternatively, the processor 101 may be a Central Processing Unit (CPU). If the computing device 100 has multiple processors 101, the types of the multiple processors 101 may be different, or may be the same. Optionally, multiple processors of computing device 100 may also be integrated into a multi-core processor. The processor 101 may be used to perform the steps of the method of object recognition. In practice, the processor 101 may be an ultra-large scale integrated circuit. An operating system and other software programs are installed in the processor 101 so that the processor 101 can access the memory 102 and the like.
It is understood that, in the embodiment of the present application, the processor 101 is described by taking a CPU as an example, and in practical applications, the processor may also be Another Specific Integrated Circuit (ASIC).
The memory 102 stores computer instructions and data, and the memory 102 may store computer instructions and data required to implement the methods of data processing in the spiking neural network provided herein. For example, the memory 102 stores instructions for implementing the steps performed by the acquisition module in the method for data processing in a spiking neural network provided by the present application. As another example, the memory 102 stores instructions for determining module execution steps in the method for data processing in a spiking neural network provided herein.
It will also be appreciated that the memory 102 in embodiments of the subject application may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The non-volatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an electrically Erasable EPROM (EEPROM), or a flash memory. Volatile memory can be Random Access Memory (RAM), which acts as external cache memory. By way of example, but not limitation, many forms of Random Access Memory (RAM) are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), synchlink DRAM (SLDRAM), and direct bus RAM (DR RAM).
The communication interface 103 may be any one or any combination of the following devices: network interface (such as Ethernet interface), wireless network card, etc. The communication interface 103 is used for the computing device 100 to perform data communication with other computing devices 100 or terminals. In the present case, a first characteristic pulse sequence of the object to be recognized can be received via the communication interface 103.
Fig. 3 shows the bus 104 by a thick line. The bus 104 may connect the processor 101 with the memory 102 and the communication interface 103. Thus, via bus 104, processor 101 may access memory 102 and may also interact with other computing devices 100 or terminals using communication interface 103.
In the present application, the computing device 100 executes computer instructions in the memory 102, and the method for data processing in the spiking neural network provided herein is implemented using the computing device 100. For example, the steps performed by the acquisition module in the method of data processing in a spiking neural network are caused to be performed by the computing device 100. As another example, instructions that cause the computing device 100 to perform steps performed by the determination module in a method of data processing in a spiking neural network.
A method for processing data in the spiking neural network according to an embodiment of the present application is described in detail below with reference to fig. 4.
Fig. 4 is a schematic flow chart of a method for data processing in a spiking neural network according to an embodiment of the present application. As shown in FIG. 4, the method may include steps 410 and 440, and the steps 410 and 440 are described in detail below.
Step 410: a first membrane voltage and a first input current on a first neuron are obtained.
Wherein the first membrane voltage is a membrane voltage value of the first neuron at a time t-1, and the first input current is determined by the first neuron at said time t-1 based on the received input pulse.
Step 420: determining whether a rate of change of the first membrane voltage per unit time is greater than a first preset threshold.
It is understood that the change in the first membrane voltage per unit time may also be referred to as the derivative or slope of the first membrane voltage. If the rate of change of the first membrane voltage per unit time is greater than the first preset threshold, step 430 is performed. If the rate of change of the first membrane voltage per unit time is not greater than the first preset threshold, step 440 is performed.
Step 430: a second membrane voltage of the first neuron at time t is calculated by a first algorithm based on the first membrane voltage and the first input current. Step 440: and calculating a second membrane voltage of the first neuron at the time t through a second algorithm according to the first membrane voltage and the first input current. The calculation efficiency of the first algorithm is higher than that of the second algorithm, and the calculation accuracy of the second algorithm is higher than that of the first algorithm.
In this embodiment, the time t-1 is a time before the time t.
In this embodiment, a region where the change rate of the membrane voltage per unit time is greater than a first preset threshold may be referred to as a rigid region, and a region where the change rate of the membrane voltage per unit time is not greater than the first preset threshold may be referred to as a non-rigid region. When the membrane voltage of a pulse neuron exceeds a fixed threshold, an action potential is generated and enters a rigid region.
In the above technical solution, when the change rate of the first membrane voltage is greater than a first preset threshold (i.e., in the rigid region), the second membrane voltage of the first neuron at the time t is calculated by using an algorithm with higher calculation efficiency, and when the change rate of the first membrane voltage is not greater than the first preset threshold (i.e., in the non-rigid region), the second membrane voltage of the first neuron at the time t is calculated by using an algorithm with higher calculation accuracy.
A specific implementation of the data processing method in the spiking neural network provided by the embodiment of the present application is described in detail below with reference to fig. 5. It should be noted that the following examples are merely provided to assist those skilled in the art in understanding the embodiments of the present application, and are not intended to limit the embodiments of the present application to the specific values or specific scenarios illustrated. It will be apparent to those skilled in the art from the examples given herein that various equivalent modifications or changes may be made, and such modifications and changes are intended to fall within the scope of the embodiments of the present application.
Fig. 5 is a schematic flow chart of another method for data processing in a spiking neural network according to an embodiment of the present disclosure. As shown in FIG. 5, the method may include steps 510-.
Step 510: acquiring parameter information Z of pulse neuron at t-1 momentt-1
In the embodiment of the application, the parameter information Z of the pulse neuron at the time t-1t-1May include the membrane voltage V of the pulsing neuron at time t-1t-1
Optionally, parameter information Zt-1The input current of the pulse neuron at the t-1 moment can be further included
Figure BDA0002486550260000101
And the intermediate variable of the pulse neuron at time t-1. Wherein the intermediate variables may include, but are not limited to: a gated variable parameter m of a sodium ion current channel, a gated variable parameter h of a potassium ion current channel and a gated variable parameter n of a leakage current channel.
Step 520: it is determined whether the spiking neuron is in a rigid region at time t-1.
Specifically, in one possible implementation, whether the pulse neuron is in the rigid region at the time t-1 can be determined according to whether the slope of the membrane voltage of the pulse neuron at the time t-1 is greater than a preset threshold. That is, whether the pulsing neuron is in the rigid region at time t-1 can be determined based on whether the rate of change of the membrane voltage of the pulsing neuron at time t-1 per unit time is greater than a preset threshold. It will be appreciated that the slope of the membrane voltage may also be referred to as the derivative of the membrane voltage
Figure BDA0002486550260000102
If the slope of the membrane voltage of the pulse neuron at the time t-1 is larger than a preset threshold, the pulse neuron can be determined to be in a rigid area with fast membrane voltage change at the time t-1, and the pulse neuron can also be determined to be in a rigid area with fast membrane voltage change at the time t.
If the slope of the membrane voltage of the pulse neuron at the time t-1 is smaller than a preset threshold, the pulse neuron can be determined to be in a non-rigid area with slower membrane voltage change at the time t-1, and the pulse neuron can also be determined to be in a non-rigid area with slower membrane voltage change at the time t.
Step 530: determining parameter information Z of the impulse neuron at the time t by adopting different algorithms in a rigid area and a non-rigid areat
In the embodiment of the application, the parameter information Z of the pulse neuron at the time ttMay include the membrane voltage V of the pulsing neuron at time tt
Optionally, parameter information Z of the pulse neuron at time ttThe input current of the pulse neuron at the time t can be further included
Figure BDA0002486550260000106
And the intermediate variable of the pulse neuron at time t. Wherein the intermediate variables may include, but are not limited to: a gated variable parameter m of a sodium ion current channel, a gated variable parameter h of a potassium ion current channel and a gated variable parameter n of a leakage current channel.
Taking the HH model shown in formula (1) as an example, the HH model can also be represented by the following formulas (4) to (5).
Figure BDA0002486550260000103
Figure BDA0002486550260000104
Wherein, aVThe principal component representing the derivative (or rate of change) of the membrane voltage V is the equation
Figure BDA0002486550260000105
Coefficients of the linear part;
amrepresenting the derivative (or rate of change) of the parameter m
Figure BDA0002486550260000111
Is the equation
Figure BDA0002486550260000112
Coefficients of the linear part;
ahrepresenting the derivative (or rate of change) of the parameter h
Figure BDA0002486550260000113
Is the equation
Figure BDA0002486550260000114
Coefficients of the linear part;
anrepresenting the derivative (or rate of change) of the parameter n
Figure BDA0002486550260000115
Is the equation
Figure BDA0002486550260000116
Coefficients of the linear part;
Figure BDA0002486550260000117
representing the derivative (or rate of change) of the membrane voltage V
Figure BDA0002486550260000118
Is the equation
Figure BDA0002486550260000119
A non-linear portion;
Figure BDA00024865502600001110
representing the derivative (or rate of change) of the parameter m
Figure BDA00024865502600001111
Is the equation
Figure BDA00024865502600001112
A non-linear portion;
Figure BDA00024865502600001113
representing the derivative (or rate of change) of the parameter h
Figure BDA00024865502600001114
Is the equation
Figure BDA00024865502600001115
A non-linear portion;
Figure BDA00024865502600001116
representing the derivative (or rate of change) of the parameter n
Figure BDA00024865502600001117
Is the equation
Figure BDA00024865502600001118
A non-linear portion.
The F function can be expressed by the following formula (6).
Figure BDA00024865502600001119
In the embodiment of the present application, for convenience of description, a plurality of F functions (for example,
Figure BDA00024865502600001120
) Are combined into one
Figure BDA00024865502600001121
Wherein, the variable z can be V, m, h and n respectively.
In one possible implementation, taking the impulse neuron determined in step 520 in the rigid region at time t-1 as an example, the parameter information Z for determining the impulse neuron at time t istThe specific implementation process of the method is described in detail.
In the embodiment of the application, the parameter information Z of the impulse neuron at the time t can be determined in the rigid area through a calculation-efficient algorithmt. Specifically, taking an algorithm with high computational efficiency as an example of the ETD algorithm, the ETD algorithm is used in the rigid regionDetermining parameter information Z of a spiking neuron at time tt
The ETD algorithm is described and illustrated in detail below.
1. According to parameter information Z of the pulse neuron at the t-1 momentt-1And equation (7) determining the parameter information Zt-1Is estimated from the minor component of the derivative of (F)z,1
Figure BDA00024865502600001122
Wherein, Fz,1Indicating parameter information Zt-1Is estimated from the minor component of the derivative of (a).
In the embodiment of the present application, when the variable z is V, m, h, n, F can be calculated respectivelyV,1,Fm,1,Fh,1,Fn,1
An example, take V with variable z. According to the membrane voltage V of the pulse neuron at the t-1 momentt-1
Figure BDA00024865502600001123
mt-1、ht-1
nt-1And the equation in the formula (6)
Figure BDA00024865502600001125
Equation a in equation (5)VDetermining the membrane voltage V of a spiking neuron at time t-1t-1Of the derivative (or rate of change) of (F)V,1
Another example, take m with variable z. According to the membrane voltage V of the pulse neuron at the t-1 momentt-1
Figure BDA00024865502600001124
mt-1、ht-1、nt-1And the equation in the formula (6)
Figure BDA0002486550260000121
Equation a in equation (5)mDetermining spiking neuronsParameter m at time t-1t-1Of the derivative (or rate of change) of (F)m,1
For another example, h is taken with the variable z. According to the membrane voltage V of the pulse neuron at the t-1 momentt-1
Figure BDA0002486550260000122
mt-1、ht-1、nt-1And the equation in the formula (6)
Figure BDA0002486550260000123
Equation a in equation (5)hDetermining parameter h of pulse neuron at t-1 momentt-1Of the derivative (or rate of change) of (F)h,1
Another example is to take n with the variable z. According to the membrane voltage V of the pulse neuron at the t-1 momentt-1
Figure BDA0002486550260000124
mt-1、ht-1、nt-1And the equation in the formula (6)
Figure BDA0002486550260000125
Equation a in equation (5)nDetermining parameter n of impulse neuron at t-1 momentt-1Of the derivative (or rate of change) of (F)n,1
2. According to Fz,1And equation (8) determining parameter information Z of the impulse neuron at time tt
Figure BDA0002486550260000126
Wherein, czRepresenting an estimate of z for the spiking neuron at time t.
In the embodiment of the present application, when the variable z is V, m, h, n, c may be calculated respectivelyV,cm,ch,cn. And can combine c withVMembrane voltage V at time t as a pulsing neurontC is mixingmAs the value of parameter m of the pulse neuron at time t, c is takenhC is taken as the value of parameter h of the pulse neuron at the time tnAs the value of the parameter n of the pulse neuron at time t.
An example, take V with variable z. M at time t-1 according to the pulse neuront-1、ht-1、nt-1Equation a in equation (5)VAnd FV,1Determining an estimate c of the membrane voltage of a spiking neuron at time tV. And can combine c withVMembrane voltage V at time t as a pulsing neuront
Another example, take m with variable z. M at time t-1 according to the pulse neuront-1、ht-1、nt-1Equation a in equation (5)mAnd Fm,1Determining an estimate c of a parameter m of a spiking neuron at time tm. And can combine c withmValue m as parameter m of the pulse neuron at time tt
For another example, h is taken with the variable z. M at time t-1 according to the pulse neuront-1、ht-1、nt-1Equation a in equation (5)hAnd Fh,1Determining an estimate c of a parameter h of a spiking neuron at time th. And can combine c withhValue h as parameter h of pulse neuron at time tt
Another example is to take n with the variable z. M at time t-1 according to the pulse neuront-1、ht-1、nt-1Equation a in equation (5)nAnd Fn,1Determining an estimate c of a parameter n of a spiking neuron at time tn. And can combine c withnValue n as parameter n of the pulse neuron at time tt
Optionally, in some embodiments, to obtain more accurate parameter information ZtFurther, the parameter information Z can be determined according to the formulas (9) to (10)t
Figure BDA0002486550260000127
Wherein, Fz,2Indicating parameter information ZtIs estimated from the minor component of the derivative of (a).
In the embodiment of the present application, when the variable z is V, m, h, n, F can be calculated respectivelyV,2,Fm,2,Fh,2,Fn,2
An example, take V with variable z. Estimate c of V at time t from the spiking neuronVEstimated value c of mmH estimated value chN, c is an estimated valuenAnd the equation in the formula (6)
Figure BDA0002486550260000128
Determining a secondary component estimate F of the derivative of V of a spiking neuron at time tV,2
Another example, take m with variable z. Estimate c of V at time t from the spiking neuronVEstimated value c of mmH estimated value chN, c is an estimated valuenAnd the equation in the formula (6)
Figure BDA0002486550260000131
Determining a secondary component estimate F of the derivative of a parameter m of a spiking neuron at time tm,2
For another example, h is taken with the variable z. Estimate c of V at time t from the spiking neuronVEstimated value c of mmH estimated value chN, c is an estimated valuenAnd the equation in the formula (6)
Figure BDA0002486550260000132
Determining a secondary component estimate F of the derivative of a parameter h of a spiking neuron at time th,2
Another example is to take n with the variable z. Estimate c of V at time t from the spiking neuronVEstimated value c of mmH estimated value chN, c is an estimated valuenAnd the equation in the formula (6)
Figure BDA0002486550260000133
Determining a secondary component estimate F of the derivative of a parameter n of a spiking neuron at time tn,2
Figure BDA0002486550260000134
Wherein Z istRepresenting the value of z for the spiking neuron at time t.
An example, take V with variable z. According to V of pulse neuron at t-1 momentt-1、aVMembrane voltage V of pulse neuron at t-1 momentt-1Of the derivative (or rate of change) of (F)V,1And a secondary component estimate F of the derivative of V of the impulse neuron at time tV,2Determining the value V of the pulse neuron at the time tt
Another example, take m with variable z. M at time t-1 according to the pulse neuront-1、amParameter m of the pulse neuron at time t-1t-1Of the derivative (or rate of change) of (F)m,1And a secondary component estimate F of the derivative of the parameter m of the impulse neuron at time tm,2Determining the value m of the impulse neuron at the time tt
For another example, h is taken with the variable z. According to h of pulse neuron at t-1 momentt-1、ahParameter h of pulse neuron at t-1 momentt-1Of the derivative (or rate of change) of (F)h,1And an estimate F of the minor component of the derivative of the parameter h of the impulse neuron at time th,2Determining the value h of the impulse neuron at the time tt
Another example is to take n with the variable z. According to n of pulse neuron at t-1 momentt-1、anParameter n of pulse neuron at t-1 momentt-1Of the derivative (or rate of change) of (F)n,1And a secondary component estimate F of the derivative of the parameter n of the impulse neuron at time tn,2Determining the value n of the impulse neuron at the time tt
In another possible implementation manner, taking the impulse neuron determined in step 520 in the non-rigid region at time t-1 as an example, the parameter information Z for determining the impulse neuron at time t istThe specific implementation process of the method is described in detail.
In the embodiment of the application, the parameter information Z of the pulse neuron at the time t can be determined in the non-rigid area through an algorithm with higher calculation precisiont. Specifically, taking an algorithm with high calculation accuracy as an example of an RK algorithm, determining parameter information Z of the impulse neuron at time t in a non-rigid region through the RK algorithmt
It should be noted that, in the embodiment of the present application, in order to implement a more efficient circuit, the ETD algorithm and the RK algorithm may be integrated into one circuit. A in the above formulas (7) to (10)zAnd when zero is taken, obtaining the RK algorithm. Taking the variable z as an example, aVIs zero. Taking m as an example for the variable z, amIs zero. Take the variable z to take h as an example, ahIs zero. Taking the variable z for n, anIs zero.
Calculating parameter information Z of pulse neuron at t moment through RK algorithmtThe process of the above is similar to the process of calculating by the ETD algorithm, and for details, reference is made to the description of the ETD algorithm above, and details are not repeated here.
Step 540: judging the membrane voltage V of the pulse neuron at the time ttWhether the threshold voltage is exceeded.
Step 550: if the membrane voltage V of the pulse neuron at time ttBeyond the threshold voltage, the firing time of the pulse neuron is estimated.
If the membrane voltage V of the preorder pulse neuron at the time t-1t-1Membrane voltage V at time t without exceeding threshold voltagetAbove a threshold voltage, the preceding pulse neuron may issue a pulse to a succeeding pulse neuron connected thereto, and the succeeding pulse neuron may generate an input current according to equation (2) after receiving the pulse.
In formula (2), the input current of the following pulse neuron is the discharge of the burst pulse of the preceding pulse neuronThe time of day is relevant. In a related aspect, if the preceding pulse neuron is discharged in a time step (t-1 time to t time), for example, the membrane voltage V at t-1 timet-1Membrane voltage V at time t without exceeding threshold voltagetBeyond the threshold voltage, the discharge time is typically the end of the default time step, e.g., the discharge time is time t. Because the membrane voltage of the preceding pulse neuron exceeds the threshold voltage at a certain time within a time step (from time t-1 to time t), the end of the time step is not very accurate as the discharge time, which may cause the input current of the following pulse neuron to be inaccurate, thereby affecting the calculation of the membrane voltage on the following pulse neuron.
In the embodiment of the application, the discharge time of the preamble pulse neuron can be estimated. Specifically, the firing time of the preceding pulse neuron may be estimated by an interpolation method, for example, a linear interpolation method. For example, referring to fig. 6, the discharge time estimated by the linear difference method is located between time steps (time t-1 to time t).
Please refer to equation (11) for a specific implementation of estimating the firing time of the preamble neurons by a linear difference method.
Figure BDA0002486550260000141
Wherein, tspikeIndicating the discharge time;
Vthrepresents a threshold voltage;
Vt-1represents the membrane voltage of the pulse neuron at the time t-1;
Vtrepresenting the membrane voltage of the pulsing neuron at time t.
Step 560: and outputting the current increment to the subsequent pulse neuron so that the subsequent pulse neuron corrects the input current according to the current increment.
In the exemplary embodiment of the application, the determined discharge time tspikeBetween the time steps (time t-1 and time t). Therefore, the related technical aspects are comparedIn the case that the discharge time is generally the end of the default time step, the discharge time t determined by the present applicationspikeAn increase in the input current to the subsequent pulse neuron will result. So that the subsequent pulse neuron updates the input current according to the input current increment.
Specifically, based on the obtained discharge time tspikeThe implementation procedure for determining the current increment refers to equation (12).
Figure BDA0002486550260000142
Wherein the content of the first and second substances,
Figure BDA0002486550260000143
indicating a current increment.
After the pulse signal emitted by the preceding neuron is received by the following neuron, the generated input current can be determined according to the formula (2)
Figure BDA0002486550260000144
In the embodiment of the application, the preamble neuron can also obtain the discharge time t in estimationspikeThe resulting current delta is then determined according to equation (12)
Figure BDA0002486550260000145
And output to the subsequent neurons. The subsequent neuron can increase according to the current
Figure BDA0002486550260000146
For the generated input current
Figure BDA0002486550260000147
And updating or adjusting to obtain updated input current. For a specific calculation process, please refer to the description in equation (13).
Figure BDA0002486550260000148
Wherein the content of the first and second substances,
Figure BDA0002486550260000149
representing the updated input current of the subsequent neuron.
In the embodiment of the application, the membrane voltage on the impulse neuron can be calculated by adopting an adaptive method according to the difference of the HH model in the rigid region and the non-rigid region. The membrane voltage on the impulse neuron can be calculated by a computationally efficient algorithm (e.g., ETD algorithm) in the rigid region, and can be calculated by a computationally accurate algorithm (e.g., RK algorithm) in the non-rigid region. Thus, on the one hand, compared with the RK algorithm adopted in both the rigid area and the non-rigid area, the calculation efficiency can be improved. On the other hand, compared with the ETD algorithm adopted in both the rigid region and the non-rigid region, the calculation accuracy can be improved.
The method for processing data in the spiking neural network provided by the embodiment of the present application is described in detail above with reference to fig. 1 to 6, and an embodiment of the apparatus of the present application is described in detail below with reference to fig. 7 to 9. It is to be understood that the description of the method embodiments corresponds to the description of the apparatus embodiments, and therefore reference may be made to the preceding method embodiments for parts not described in detail.
Fig. 7 is a schematic block diagram of an apparatus 700 for data processing in a spiking neural network according to an embodiment of the present disclosure. The data processing means may be implemented as part or all of the means in software, hardware or a combination of both. The apparatus provided in this embodiment of the present application may implement the method flow in fig. 4 in this embodiment of the present application, and the apparatus 700 for processing data in a spiking neural network includes: an obtaining module 710, a determining module 720, and a calculating module 730, wherein:
an obtaining module 710 for obtaining a first membrane voltage and a first input current on a first neuron, the first membrane voltage being a membrane voltage value of the first neuron at a time t-1, the first input current being determined by the first neuron at the time t-1 according to a received input pulse;
a determining module 720, configured to determine whether a rate of change of the first membrane voltage per unit time is greater than a first preset threshold;
a calculating module 730, configured to calculate a second membrane voltage on the first neuron according to the first membrane voltage and the first input current by using a first algorithm if the rate of change of the first membrane voltage in the unit time is greater than the first preset threshold, where the second membrane voltage is a membrane voltage value of the first neuron at a time t, and the time t-1 is a time before the time t; or
And if the change rate of the first membrane voltage in the unit time is not larger than the first preset threshold, the method is used for calculating a second membrane voltage on the first neuron according to the first membrane voltage and the first input current through a second algorithm, wherein the calculation efficiency of the first algorithm is higher than that of the second algorithm, and the calculation precision of the second algorithm is higher than that of the first algorithm.
Optionally, the determining module 720 is further configured to: determining a first firing time T for the first neuron, the first firing time T being between the T-1 time and the T time; determining a current increment according to the first discharge time T and the time T;
the apparatus 700 for data processing in the spiking neural network further comprises:
an output module 740, configured to output the current increment to the second neuron, where the current increment is used to instruct the second neuron to adjust a second current received from the first neuron according to the current increment, the second current is a current output to the second neuron when the first neuron determines that the second membrane voltage is greater than a second preset threshold, and the second neuron is a next layer neuron of the first neuron.
Optionally, the determining module 720 is specifically configured to: determining a first firing time T for the first neuron according to an interpolation algorithm.
Optionally, the determining module 720 is specifically configured to: determining a first firing time T for the first neuron according to a linear interpolation algorithm.
Optionally, the determining module 720 is specifically configured to: and determining the discharge time T of the first neuron according to the T-1 time, the first membrane voltage, the T time and the second membrane voltage.
Optionally, the first algorithm is an exponential time difference, ETD, algorithm.
Optionally, when the first algorithm is an Exponential Time Difference (ETD) algorithm, the calculating module 730 is specifically configured to: determining an estimate of a secondary component of the first rate of change of membrane voltage from the first membrane voltage and the first input current; determining an estimate of a linear principal component of the first rate of change of membrane voltage from a gating variable of an ion channel of the first neuron at the time t-1; determining an estimate of a second membrane voltage across the first neuron based on the estimate of the secondary component of the first rate of membrane voltage change and the estimate of the linear primary component of the first rate of membrane voltage change; determining an estimated value of a secondary component of the second membrane voltage change rate from the estimated value of the second membrane voltage; determining the second membrane voltage based on the estimated value of the secondary component of the first membrane voltage change rate, the estimated value of the linear primary component of the first membrane voltage change rate, and the estimated value of the secondary component of the second membrane voltage change rate.
Optionally, the second algorithm is a longge cottage tower RK algorithm.
Optionally, when the second algorithm is a longge kutta RK algorithm, the calculating module 730 is specifically configured to: determining an estimate of a secondary component of the first rate of change of membrane voltage from the first membrane voltage and the first input current; determining an estimate of a second membrane voltage across the first neuron based on the estimate of the secondary component of the first rate of change of membrane voltage; determining an estimated value of a secondary component of the second membrane voltage change rate from the estimated value of the second membrane voltage; determining the second membrane voltage based on the estimated value of the secondary component of the first membrane voltage change rate and the estimated value of the secondary primary component of the second membrane voltage change rate.
Fig. 8 is a schematic circuit block diagram of a spiking neural network provided in an embodiment of the present application. The spiking neural network may include at least two neurons, each of the neurons includes a plurality of registers, and for convenience of description, the neuron 800 is illustrated in fig. 8 as an example.
It is to be understood that neuron 800 is any one of a plurality of neurons in a spiking neural network. The input of neuron 800 is connected to the output of the neuron in the upper layer, and the transmission of neuron 800 is connected to the input of the neuron in the next layer.
The neuron 800 may include: current register 810, voltage register 820, first comparator 830, unified evolutionary algorithm circuit 840, current register 850, voltage register 860, second comparator 870, estimation circuit 880, current increment register 890.
1. Current register 810
At the input of the neuron 800, for storing the input current of the neuron 800 at the last time (time t-1).
2. Voltage register 820
For storing the membrane voltage of the neuron 800 at the last time instant (time t-1).
3. First comparator 830
For implementing the method steps in step 520. Specifically, it is used to determine whether the neuron 800 was in the rigid region at the previous time (time t-1).
For example, a preset threshold is stored in the first comparator 830, and if the derivative of the membrane voltage of the neuron 800 at the previous time (time t-1) is greater than the preset threshold, it can be determined that the neuron 800 is in a rigid region at the previous time (time t-1).
As another example, if the derivative of the membrane voltage of the neuron 800 at the previous time (time t-1) is greater than a preset threshold, it may be determined that the neuron 800 was in a non-rigid region at the previous time (time t-1).
4. Unified evolution algorithm circuit 840
For implementing the method steps in step 530. Specifically, the method is used for calculating the membrane voltage of the neuron 800 at the current moment (t moment) according to the input current of the neuron 800 at the last moment (t-1 moment) and the membrane voltage at the last moment (t-1 moment).
Referring to fig. 9, the unified evolutionary algorithm circuit 840 includes: register 841, register 842, register 843, register 844.
A register 841 for obtaining the stored parameters of the neuron 800 at the previous time (time t-1), such as the vector u ═ V, m, h, n, from the voltage register 820]TAnd according to the vector u ═ V, m, h, n]TAnd the above equation (5) determines and stores the linear part of the HH model, e.g. the vector a ═ aV,am,ah,an]T
A register 842 for retrieving the stored vector u ═ V, m, h, n from the voltage register 820]TAnd obtains the stored vector a ═ a from the register 841V,am,ah,an]TAnd the current register 810 obtains the input current of the neuron 800 stored at the previous time (time t-1)
Figure BDA0002486550260000171
And according to u ═ V, m, h, n]T、a=[aV,am,ah,an]T
Figure BDA0002486550260000172
And equation (6) determines and stores vector F1=[FV,1,Fm,1,Fh,1,Fn,1]T
Register 843 for fetching vector F1=[FV,1,Fm,1,Fh,1,Fn,1]TAnd vector u ═ V, m, h, n]TAnd according to F1=[FV,1,Fm,1,Fh,1,Fn,1]TAnd the vector u ═ V, m, h, n]TAnd equation (8) determines and stores the vector c ═ FV,1,cm,ch,cn]T
Register 844 for retrieving vector c ═ FV,1,cm,ch,cn]TInput of neuron 800 at the previous time (time t-1)Electric current
Figure BDA0002486550260000173
And according to the vector c ═ FV,1,cm,ch,cn]T
Figure BDA0002486550260000174
And equation (9) determines and stores vector F2=[FV,2,Fm,2,Fh,2,Fn,2]T
In the embodiment of the present application, the unified evolution algorithm circuit 840 may implement two different algorithms, for example, the RK algorithm circuit and the ETD algorithm circuit are integrated into one unified evolution algorithm circuit 840. The membrane voltage of the neuron 800 at the present time (time t) may be calculated using, for example, an ETD algorithm when the first comparator 830 determines that the neuron 800 is in the rigid region at the last time (time t-1). As another example, the membrane voltage of the neuron 800 at the current time (time t) may be calculated using, for example, the RK algorithm when the first comparator 830 determines that the neuron 800 was in a non-rigid region at the last time (time t-1).
As an example, when the RK algorithm is required to calculate the membrane voltage of the neuron 800 at the current time (time t), the vector a stored in the register 841 may be set to [ a ]V,am,ah,an]TTaken to be zero, so that the unified evolutionary algorithm circuit 840 may implement the RK algorithm.
As another example, when it is necessary to calculate the membrane voltage of the neuron 800 at the current time (time t) using the ETD algorithm, the vector a stored in the register 841 may be set to [ a ]V,am,ah,an]TTaken to be non-zero, so that the unified evolutionary algorithm circuit 840 may implement the ETD algorithm.
5. Current register 850
At the output of the neuron 800, for storing the output current of the neuron 800 at the current time (time t).
6. Voltage register 860
And is connected to the unified evolution algorithm circuit 840 for storing the membrane voltage of the neuron 800 at the current time (time t) calculated by the unified evolution algorithm circuit 840.
7. Second comparator 870
For implementing the method steps in step 540. Specifically, the method is used for determining whether the membrane voltage of the neuron 800 at the time t-1 exceeds the threshold voltage, and whether the membrane voltage at the time t exceeds the threshold voltage. For example, the second comparator 870 stores a threshold voltage, and if the membrane voltage of the neuron 800 at time t-1 does not exceed the threshold voltage, and the membrane voltage at time t exceeds the threshold voltage, it can be understood that the neuron 800 may issue a pulse to the next layer of neurons during the time period from time t-1 to time t.
8. Estimation circuit 880
For implementing the method steps in step 550. Specifically, the method calculates the firing time t of the neuron 800 based on the threshold voltage stored in the second comparator 870, the membrane voltage of the neuron 800 at the previous time (time t-1) stored in the voltage register 820, and the membrane voltage of the neuron 800 at the present time (time t) stored in the voltage register 860spike. For a specific calculation process, please refer to formula (11), which is not described herein again.
It should be noted that there are various implementations of the estimation circuit 880, and the present application is not limited in particular. In one possible implementation, the estimation circuit 880 may be a register for discharging the membrane voltage at the current time (tth) according to the threshold voltage, the membrane voltage of the neuron 800 at the previous time (tth-1), and the membrane voltage at the current time (tth)spikeAnd stores the electricity time tspike. In another possible implementation, the estimation circuit 880 may further include two registers, wherein one register is used for calculating the discharge time t according to the above methodspikeThe other register is used for storing the discharge time tspike
9. Current increment register 890
For implementing the method steps in step 560. In particular, for determining the discharge time tspikeThe current delta is calculated and stored. Current increment register 890 and next layer neuronsIs connected to transmit the current increment stored in the current increment register 890 to the next layer of neurons to facilitate the next layer of neurons updating the input current according to the input current increment.
In the embodiment of the application, on one hand, the process of the membrane voltage and the current can be realized through an iterative algorithm, the current voltage value can be quickly calculated only by storing corresponding parameters at the current moment and the previous moment, the calculated amount is greatly reduced, and meanwhile, the parallelism of calculation is greatly improved. On the other hand, the voltage threshold is constant and does not need to be adjusted, only the input current needs to be corrected at the end of the time step, and the method greatly simplifies the circuit logic.
In this embodiment, a computing device is further provided, where the computing device includes a processor and a memory, where the memory is used to store one or more instructions, and the processor implements the method for data processing in the spiking neural network provided above by executing the one or more instructions.
In this embodiment, a computer-readable storage medium is further provided, and instructions stored in the computer-readable storage medium, when executed on a computing device, cause the computing device to execute the provided method for data processing in an impulse neural network.
In this embodiment, a computer program product containing instructions is also provided, which when run on a computing device, causes the computing device to execute the method for data processing in the spiking neural network provided above, or causes the computing device to implement the functions of the apparatus for data processing in the spiking neural network provided above.
It should be understood that, in the various embodiments of the present application, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the several embodiments provided in the present application, it should be understood that the above-described embodiments of the spiking neural network are merely illustrative, for example, the division of the unit is only one logical function division, and other division manners may be available in actual implementation, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed couplings or direct couplings or communicative connections between each other may be through some interfaces.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
This functionality, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and all the changes or substitutions should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (17)

1. A method of data processing in a spiking neural network, comprising:
obtaining a first membrane voltage and a first input current on a first neuron, the first membrane voltage being a membrane voltage value of the first neuron at a time t-1, the first input current being determined by the first neuron at the time t-1 from a received input pulse;
determining whether a rate of change of the first membrane voltage per unit time is greater than a first preset threshold;
if the change rate of the first membrane voltage in the unit time is larger than the first preset threshold, calculating a second membrane voltage on the first neuron through a first algorithm according to the first membrane voltage and the first input current, wherein the second membrane voltage is a membrane voltage value of the first neuron at a time t, and the time t-1 is a time before the time t; or
And if the change rate of the first membrane voltage in the unit time is not larger than the first preset threshold, calculating a second membrane voltage on the first neuron according to the first membrane voltage and the first input current by using a second algorithm, wherein the calculation efficiency of the first algorithm is higher than that of the second algorithm, and the calculation precision of the second algorithm is higher than that of the first algorithm.
2. The method of claim 1, further comprising:
determining a first firing time T for the first neuron, the first firing time T being between the T-1 time and the T time;
determining a current increment according to the first discharge time T and the time T;
outputting the current increment to a second neuron, wherein the current increment is used for instructing the second neuron to adjust a second current received from the first neuron according to the current increment, the second current is the current output by the first neuron to the second neuron when the second membrane voltage is determined to be larger than a second preset threshold, and the second neuron is a next layer neuron of the first neuron.
3. The method of claim 2, wherein the determining the first firing time T for the first neuron comprises:
determining a discharge time T of the first neuron according to the T-1 time, the first membrane voltage, the T time and the second membrane voltage.
4. The method according to any one of claims 1 to 3, characterized in that the first algorithm is an Exponential Time Difference (ETD) algorithm.
5. The method according to any one of claims 1 to 4, wherein the second algorithm is a Longgkutta RK algorithm.
6. An apparatus for data processing in a spiking neural network, comprising:
an obtaining module, configured to obtain a first membrane voltage and a first input current on a first neuron, where the first membrane voltage is a membrane voltage value of the first neuron at a time t-1, and the first input current is determined by the first neuron at the time t-1 according to a received input pulse;
a determination module for determining whether a rate of change of the first membrane voltage per unit time is greater than a first preset threshold;
a calculating module, configured to calculate a second membrane voltage on the first neuron according to the first membrane voltage and the first input current by using a first algorithm if a change rate of the first membrane voltage in the unit time is greater than the first preset threshold, where the second membrane voltage is a membrane voltage value of the first neuron at a time t, and the time t-1 is a time before the time t; or
And if the change rate of the first membrane voltage in the unit time is not larger than the first preset threshold, the method is used for calculating a second membrane voltage on the first neuron according to the first membrane voltage and the first input current through a second algorithm, wherein the calculation efficiency of the first algorithm is higher than that of the second algorithm, and the calculation precision of the second algorithm is higher than that of the first algorithm.
7. The apparatus of claim 6, wherein the determining module is further configured to:
determining a first firing time T for the first neuron, the first firing time T being between the T-1 time and the T time;
determining a current increment according to the first discharge time T and the time T;
the device further comprises:
an output module, configured to output the current increment to a second neuron, where the current increment is used to instruct the second neuron to adjust a second current received from the first neuron according to the current increment, where the second current is a current output to the second neuron when the first neuron determines that the second membrane voltage is greater than a second preset threshold, and the second neuron is a next layer neuron of the first neuron.
8. The apparatus of claim 7, wherein the determining module is specifically configured to:
determining a discharge time T of the first neuron according to the T-1 time, the first membrane voltage, the T time and the second membrane voltage.
9. The apparatus according to any one of claims 6 to 8, wherein the first algorithm is an Exponential Time Difference (ETD) algorithm.
10. The apparatus according to any one of claims 6 to 9, wherein the second algorithm is a Longgkutta RK algorithm.
11. An apparatus for data processing in a spiking neural network, comprising:
the communication interface is used for receiving a first characteristic pulse sequence of an object to be identified;
a processor coupled to the communication interface and configured to perform the method of any of claims 1-5.
12. An impulse neural network, comprising:
a first current register to store a first input current for a first neuron at a time t-1, the first input current determined by the first neuron at the time t-1 from a received input pulse;
a first voltage register to store a first membrane voltage for the first neuron at the time t-1;
the first comparator is connected with the first voltage register and used for determining whether the change rate of the first membrane voltage stored in the first voltage register in unit time is larger than a first preset threshold value or not;
a first algorithm circuit, connected to the first current register and the first voltage register, configured to calculate a second membrane voltage across the first neuron according to the first membrane voltage and the first input current when a rate of change of the first membrane voltage in the unit time is greater than the first preset threshold, where the second membrane voltage is a membrane voltage value of the first neuron at a time t, and the time t-1 is a time before the time t; or
And a second algorithm for calculating a second membrane voltage on the first neuron when the rate of change of the first membrane voltage per unit time is not greater than the first preset threshold, wherein the calculation efficiency of the first algorithm is higher than that of the second algorithm, and the calculation accuracy of the second algorithm is higher than that of the first algorithm.
13. The spiking neural network according to claim 12, further comprising:
an estimation circuit storing a first discharge time T of the first neuron, the first discharge time T being between the T-1 time and the T time;
and a current increment register, connected to the estimation circuit, configured to determine a current increment according to the first discharging time T, and output the current increment to the second neuron, where the current increment is used to instruct the second neuron to adjust a second current received from the first neuron according to the current increment, the second current is a current output to the second neuron when the first neuron determines that the second membrane voltage is greater than a second preset threshold, and the second neuron is a next layer neuron of the first neuron.
14. The spiking neural network according to claim 13, further comprising:
a second voltage register to store a second membrane voltage on the first neuron;
the estimation circuit is connected to the second voltage register and the first voltage register, and is specifically configured to: and determining the discharge time T of the first neuron according to the T-1 moment, the first membrane voltage, the T moment and the second membrane voltage, and storing the first discharge time T of the first neuron.
15. The spiking neural network according to any one of claims 12 to 14, wherein the first algorithm is an exponential time difference, ETD, algorithm.
16. The spiking neural network according to any one of claims 12 to 15, wherein the second algorithm is a Longger Kutta RK algorithm.
17. A computer-readable storage medium having instructions stored thereon, which, when executed by a computing device, cause the computing device to perform the method of any of claims 1-5.
CN202010392960.2A 2020-05-11 2020-05-11 Method and device for processing data in impulse neural network Pending CN113642719A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010392960.2A CN113642719A (en) 2020-05-11 2020-05-11 Method and device for processing data in impulse neural network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010392960.2A CN113642719A (en) 2020-05-11 2020-05-11 Method and device for processing data in impulse neural network

Publications (1)

Publication Number Publication Date
CN113642719A true CN113642719A (en) 2021-11-12

Family

ID=78415495

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010392960.2A Pending CN113642719A (en) 2020-05-11 2020-05-11 Method and device for processing data in impulse neural network

Country Status (1)

Country Link
CN (1) CN113642719A (en)

Similar Documents

Publication Publication Date Title
US10460236B2 (en) Neural network learning device
KR101700145B1 (en) Automated method for modifying neural dynamics
US20150206050A1 (en) Configuring neural network for low spiking rate
JP2017525038A (en) Decomposition of convolution operations in neural networks
US20230367934A1 (en) Method and apparatus for constructing vehicle dynamics model and method and apparatus for predicting vehicle state information
CN114694379B (en) Traffic flow prediction method and system based on self-adaptive dynamic graph convolution
CN113467487A (en) Path planning model training method, path planning device and electronic equipment
CA2924468A1 (en) Congestion avoidance in networks of spiking neurons
Ren et al. In-context learning with transformer is really equivalent to a contrastive learning pattern
CN111930602B (en) Performance index prediction method and device
CN111260056B (en) Network model distillation method and device
CN113642719A (en) Method and device for processing data in impulse neural network
CN111582461B (en) Neural network training method and device, terminal equipment and readable storage medium
US9342782B2 (en) Stochastic delay plasticity
CN109697511B (en) Data reasoning method and device and computer equipment
US11868887B2 (en) Making time-series predictions of a computer-controlled system
CN114397817A (en) Network training method, robot control method, network training device, robot control device, equipment and storage medium
US11526735B2 (en) Neuromorphic neuron apparatus for artificial neural networks
CN115204350A (en) Training method and training device for impulse neural network
CN113379043A (en) Impulse neural network
CN110717590A (en) Efficient multi-pulse algorithm based on single-exponential kernel and neural membrane potential states
Awano et al. Use of a sparse structure to improve learning performance of recurrent neural networks
CN116798643A (en) Method, device, server and storage medium for generating number of new cases
CN118036825A (en) Power load prediction method and system based on multi-scale feature fusion
CN114817744A (en) Multi-agent-based recommendation method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination