Patent Publication Number: US-9886663-B2

Title: Compiling network descriptions to multiple platforms

Description:
CROSS REFERENCE TO RELATED APPLICATION 
     The present application claims the benefit of U.S. Provisional Patent Application No. 61/888,296, filed on Oct. 8, 2013, in the names of Sarah et al., the disclosure of which is expressly incorporated by reference herein in its entirety. 
    
    
     BACKGROUND 
     1. Field 
     Certain aspects of the present disclosure generally relate to neural system engineering and, more particularly, to systems and methods for compiling network descriptions to multiple platforms in a neural network. 
     2. Background 
     An artificial neural network, which may comprise an interconnected group of artificial neurons (i.e., neuron models), is a computational device or represents a method to be performed by a computational device. Artificial neural networks may have corresponding structure and/or function in biological neural networks. However, artificial neural networks may provide innovative and useful computational techniques for certain applications in which traditional computational techniques are cumbersome, impractical, or inadequate. 
     Users and researchers of spiking neural networks rely on the ability to simulate these networks on a number of different platforms. Oftentimes, the size of the network dictates that to be simulated in a reasonable amount of time, specialized hardware (such as digital signal processors (DSPs) or graphics processing units (GPUs)) is employed. Hence, for real-time simulation of a large variety of networks, the platforms may range from general-purpose desktop computers having general-purpose (CPUs) to highly specialized, application-specific integrated circuits (ASICs). 
     The simulation of spiking neural networks in real-time depends on the size and complexity of the network. As a network grows and is modified, the computational specifications change. For example, a spiking neural network may grow in size until it is no longer feasible to simulate the network on a desktop computer. At this point, the researcher may choose to convert the source code describing the network so that it may be simulated on more specialized hardware and circuitry, such as a DSP or GPU. 
     SUMMARY 
     In an aspect of the present disclosure, a method of generating executable code for a target platform in a neural network is disclosed. The method includes receiving a spiking neural network description. The method also includes receiving platform-specific instructions for a target platform(s). Further, the method includes, generating executable code for the target platform(s) based on the platform-specific instructions and the network description. 
     In another aspect of the present disclosure, an apparatus for generating executable code for a target platform in a neural network is disclosed. The apparatus includes a memory and a processor(s) coupled to the memory. The processor(s) is (are) configured to receive a spiking neural network description. In addition, the processor(s) is (are) configured to receive platform-specific instructions for a target platform(s). The processor(s) is (are) further configured to generate executable code for the target platform(s) based on the platform-specific instructions and the network description. 
     In yet another aspect of the present disclosure, an apparatus for generating executable code for a target platform in a neural network is disclosed. The apparatus includes means for receiving a spiking neural network description. The apparatus also includes means for receiving platform-specific instructions for a target platform(s). The apparatus further includes means for generating executable code for the target platform(s) based on the platform-specific instructions and the network description. 
     In still another aspect of the present disclosure, a computer program product for generating executable code for a target platform in a neural network is disclosed. The computer program product includes a non-transitory computer-readable medium having encoded thereon program code. The program code includes program code to receive a spiking neural network description. The program code also includes program code to receive platform-specific instructions for a target platform(s). The program code further includes program code to generate executable code for the target platform(s) based on the platform-specific instructions and the network description. 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
       The features, nature, and advantages of the present disclosure will become more apparent from the detailed description set forth below when taken in conjunction with the drawings in which like reference characters identify correspondingly throughout. 
         FIG. 1  illustrates an example network of neurons in accordance with certain aspects of the present disclosure. 
         FIG. 2  illustrates an example of a processing unit (neuron) of a computational network (neural system or neural network) in accordance with certain aspects of the present disclosure. 
         FIG. 3  illustrates an example of spike-timing dependent plasticity (STDP) curve in accordance with certain aspects of the present disclosure. 
         FIG. 4  illustrates an example of a positive regime and a negative regime for defining behavior of a neuron model in accordance with certain aspects of the present disclosure. 
         FIG. 5  illustrates an example implementation of designing a neural network using a general-purpose processor in accordance with certain aspects of the present disclosure. 
         FIG. 6  illustrates an example implementation of designing a neural network where a memory may be interfaced with individual distributed processing units in accordance with certain aspects of the present disclosure. 
         FIG. 7  illustrates an example implementation of designing a neural network based on distributed memories and distributed processing units in accordance with certain aspects of the present disclosure. 
         FIG. 8  illustrates an example implementation of a neural network in accordance with certain aspects of the present disclosure. 
         FIG. 9  is a block diagram illustrating an exemplary network description in accordance with aspects of the present disclosure. 
         FIG. 10  is a block diagram illustrating a method for generating executable code in accordance with aspects of the present disclosure. 
     
    
    
     DETAILED DESCRIPTION 
     The detailed description set forth below, in connection with the appended drawings, is intended as a description of various configurations and is not intended to represent the only configurations in which the concepts described herein may be practiced. The detailed description includes specific details for the purpose of providing a thorough understanding of the various concepts. However, it will be apparent to those skilled in the art that these concepts may be practiced without these specific details. In some instances, well-known structures and components are shown in block diagram form in order to avoid obscuring such concepts. 
     Based on the teachings, one skilled in the art should appreciate that the scope of the disclosure is intended to cover any aspect of the disclosure, whether implemented independently of or combined with any other aspect of the disclosure. For example, an apparatus may be implemented or a method may be practiced using any number of the aspects set forth. In addition, the scope of the disclosure is intended to cover such an apparatus or method practiced using other structure, functionality, or structure and functionality in addition to or other than the various aspects of the disclosure set forth. It should be understood that any aspect of the disclosure disclosed may be embodied by one or more elements of a claim. 
     The word “exemplary” is used herein to mean “serving as an example, instance, or illustration.” Any aspect described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other aspects. 
     Although particular aspects are described herein, many variations and permutations of these aspects fall within the scope of the disclosure. Although some benefits and advantages of the preferred aspects are mentioned, the scope of the disclosure is not intended to be limited to particular benefits, uses or objectives. Rather, aspects of the disclosure are intended to be broadly applicable to different technologies, system configurations, networks and protocols, some of which are illustrated by way of example in the figures and in the following description of the preferred aspects. The detailed description and drawings are merely illustrative of the disclosure rather than limiting, the scope of the disclosure being defined by the appended claims and equivalents thereof. 
     An Example Neural System, Training and Operation 
       FIG. 1  illustrates an example artificial neural system  100  with multiple levels of neurons in accordance with certain aspects of the present disclosure. The neural system  100  may have a level of neurons  102  connected to another level of neurons  106  through a network of synaptic connections  104  (i.e., feed-forward connections). For simplicity, only two levels of neurons are illustrated in  FIG. 1 , although fewer or more levels of neurons may exist in a neural system. It should be noted that some of the neurons may connect to other neurons of the same layer through lateral connections. Furthermore, some of the neurons may connect back to a neuron of a previous layer through feedback connections. 
     As illustrated in  FIG. 1 , each neuron in the level  102  may receive an input signal  108  that may be generated by neurons of a previous level (not shown in  FIG. 1 ). The signal  108  may represent an input current of the level  102  neuron. This current may be accumulated on the neuron membrane to charge a membrane potential. When the membrane potential reaches its threshold value, the neuron may fire and generate an output spike to be transferred to the next level of neurons (e.g., the level  106 ). In some modeling approaches, the neuron may continuously transfer a signal to the next level of neurons. This signal is typically a function of the membrane potential. Such behavior can be emulated or simulated in hardware and/or software, including analog and digital implementations such as those described below. 
     In biological neurons, the output spike generated when a neuron fires is referred to as an action potential. This electrical signal is a relatively rapid, transient, nerve impulse, having an amplitude of roughly 100 mV and a duration of about  1  ms. In a particular embodiment of a neural system having a series of connected neurons (e.g., the transfer of spikes from one level of neurons to another in  FIG. 1 ), every action potential has basically the same amplitude and duration, and thus, the information in the signal may be represented only by the frequency and number of spikes, or the time of spikes, rather than by the amplitude. The information carried by an action potential may be determined by the spike, the neuron that spiked, and the time of the spike relative to other spike or spikes. The importance of the spike may be determined by a weight applied to a connection between neurons, as explained below. 
     The transfer of spikes from one level of neurons to another may be achieved through the network of synaptic connections (or simply “synapses”)  104 , as illustrated in  FIG. 1 . Relative to the synapses  104 , neurons of level  102  may be considered presynaptic neurons and neurons of level  106  may be considered postsynaptic neurons. The synapses  104  may receive output signals (i.e., spikes) from the level  102  neurons and scale those signals according to adjustable synaptic weights w 1   (i,i+1) , . . . , w P   (i,i+1)  where P is a total number of synaptic connections between the neurons of levels  102  and  106  and i is an indicator of the neuron level. In the example of  FIG. 1 , i represents neuron level  102  and i+1 represents neuron level  106 . Further, the scaled signals may be combined as an input signal of each neuron in the level  106 . Every neuron in the level  106  may generate output spikes  110  based on the corresponding combined input signal. The output spikes  110  may be transferred to another level of neurons using another network of synaptic connections (not shown in  FIG. 1 ). 
     Biological synapses can mediate either excitatory or inhibitory (hyperpolarizing) actions in postsynaptic neurons and can also serve to amplify neuronal signals. Excitatory signals depolarize the membrane potential (i.e., increase the membrane potential with respect to the resting potential). If enough excitatory signals are received within a certain time period to depolarize the membrane potential above a threshold, an action potential occurs in the postsynaptic neuron. In contrast, inhibitory signals generally hyperpolarize (i.e., lower) the membrane potential. Inhibitory signals, if strong enough, can counteract the sum of excitatory signals and prevent the membrane potential from reaching a threshold. In addition to counteracting synaptic excitation, synaptic inhibition can exert powerful control over spontaneously active neurons. A spontaneously active neuron refers to a neuron that spikes without further input, for example due to its dynamics or a feedback. By suppressing the spontaneous generation of action potentials in these neurons, synaptic inhibition can shape the pattern of firing in a neuron, which is generally referred to as sculpturing. The various synapses  104  may act as any combination of excitatory or inhibitory synapses, depending on the behavior desired. 
     The neural system  100  may be emulated by a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device (PLD), discrete gate or transistor logic, discrete hardware components, a software module executed by a processor, or any combination thereof. The neural system  100  may be utilized in a large range of applications, such as image and pattern recognition, machine learning, motor control, and alike. Each neuron in the neural system  100  may be implemented as a neuron circuit. The neuron membrane charged to the threshold value initiating the output spike may be implemented, for example, as a capacitor that integrates an electrical current flowing through it. 
     In an aspect, the capacitor may be eliminated as the electrical current integrating device of the neuron circuit, and a smaller memristor element may be used in its place. This approach may be applied in neuron circuits, as well as in various other applications where bulky capacitors are utilized as electrical current integrators. In addition, each of the synapses  104  may be implemented based on a memristor element, where synaptic weight changes may relate to changes of the memristor resistance. With nanometer feature-sized memristors, the area of a neuron circuit and synapses may be substantially reduced, which may make implementation of a large-scale neural system hardware implementation more practical. 
     Functionality of a neural processor that emulates the neural system  100  may depend on weights of synaptic connections, which may control strengths of connections between neurons. The synaptic weights may be stored in a non-volatile memory in order to preserve functionality of the processor after being powered down. In an aspect, the synaptic weight memory may be implemented on a separate external chip from the main neural processor chip. The synaptic weight memory may be packaged separately from the neural processor chip as a replaceable memory card. This may provide diverse functionalities to the neural processor, where a particular functionality may be based on synaptic weights stored in a memory card currently attached to the neural processor. 
       FIG. 2  illustrates an exemplary diagram  200  of a processing unit (e.g., a neuron or neuron circuit)  202  of a computational network (e.g., a neural system or a neural network) in accordance with certain aspects of the present disclosure. For example, the neuron  202  may correspond to any of the neurons of levels  102  and  106  from  FIG. 1 . The neuron  202  may receive multiple input signals  204   1 - 204   N , which may be signals external to the neural system, or signals generated by other neurons of the same neural system, or both. The input signal may be a current, a conductance, a voltage, a real-valued, and/or a complex-valued. The input signal may comprise a numerical value with a fixed-point or a floating-point representation. These input signals may be delivered to the neuron  202  through synaptic connections that scale the signals according to adjustable synaptic weights  206   1 - 206   N  (W 1 -W N ), where N may be a total number of input connections of the neuron  202 . 
     The neuron  202  may combine the scaled input signals and use the combined scaled inputs to generate an output signal  208  (i.e., a signal Y). The output signal  208  may be a current, a conductance, a voltage, a real-valued and/or a complex-valued. The output signal may be a numerical value with a fixed-point or a floating-point representation. The output signal  208  may be then transferred as an input signal to other neurons of the same neural system, or as an input signal to the same neuron  202 , or as an output of the neural system. 
     The processing unit (neuron)  202  may be emulated by an electrical circuit, and its input and output connections may be emulated by electrical connections with synaptic circuits. The processing unit  202  and its input and output connections may also be emulated by a software code. The processing unit  202  may also be emulated by an electric circuit, whereas its input and output connections may be emulated by a software code. In an aspect, the processing unit  202  in the computational network may be an analog electrical circuit. In another aspect, the processing unit  202  may be a digital electrical circuit. In yet another aspect, the processing unit  202  may be a mixed-signal electrical circuit with both analog and digital components. The computational network may include processing units in any of the aforementioned forms. The computational network (neural system or neural network) using such processing units may be utilized in a large range of applications, such as image and pattern recognition, machine learning, motor control, and the like. 
     During the course of training a neural network, synaptic weights (e.g., the weights w 1   (i,i+1) , . . . , w P   (i,i+1)  from  FIG. 1  and/or the weights  206   1 - 206   N  from  FIG. 2 ) may be initialized with random values and increased or decreased according to a learning rule. Those skilled in the art will appreciate that examples of the learning rule include, but are not limited to the spike-timing-dependent plasticity (STDP) learning rule, the Hebb rule, the Oja rule, the Bienenstock-Copper-Munro (BCM) rule, etc. In certain aspects, the weights may settle or converge to one of two values (i.e., a bimodal distribution of weights). This effect can be utilized to reduce the number of bits for each synaptic weight, increase the speed of reading and writing from/to a memory storing the synaptic weights, and to reduce power and/or processor consumption of the synaptic memory. 
     Synapse Type 
     In hardware and software models of neural networks, the processing of synapse related functions can be based on synaptic type. Synapse types may be non-plastic synapses (no changes of weight and delay), plastic synapses (weight may change), structural delay plastic synapses (weight and delay may change), fully plastic synapses (weight, delay and connectivity may change), and variations thereupon (e.g., delay may change, but no change in weight or connectivity). The advantage of multiple types is that processing can be subdivided. For example, non-plastic synapses may not require plasticity functions to be executed (or waiting for such functions to complete). Similarly, delay and weight plasticity may be subdivided into operations that may operate together or separately, in sequence or in parallel. Different types of synapses may have different lookup tables or formulas and parameters for each of the different plasticity types that apply. Thus, the methods would access the relevant tables, formulas, or parameters for the synapse&#39;s type. 
     There are further implications of the fact that spike-timing dependent structural plasticity may be executed independently of synaptic plasticity. Structural plasticity may be executed even if there is no change to weight magnitude (e.g., if the weight has reached a minimum or maximum value, or it is not changed due to some other reason) s structural plasticity (i.e., an amount of delay change) may be a direct function of pre-post spike time difference. Alternatively, structural plasticity may be set as a function of the weight change amount or based on conditions relating to bounds of the weights or weight changes. For example, a synapse delay may change only when a weight change occurs or if weights reach zero but not if they are at a maximum value. However, it may be advantageous to have independent functions so that these processes can be parallelized reducing the number and overlap of memory accesses. 
     Determination of Synaptic Plasicity 
     Neuroplasticity (or simply “plasticity”) is the capacity of neurons and neural networks in the brain to change their synaptic connections and behavior in response to new information, sensory stimulation, development, damage, or dysfunction. Plasticity is important to learning and memory in biology, as well as for computational neuroscience and neural networks. Various forms of plasticity have been studied, such as synaptic plasticity (e.g., according to the Hebbian theory), spike-timing-dependent plasticity (STDP), non-synaptic plasticity, activity-dependent plasticity, structural plasticity and homeostatic plasticity. 
     STDP is a learning process that adjusts the strength of synaptic connections between neurons. The connection strengths are adjusted based on the relative timing of a particular neuron&#39;s output and received input spikes (i.e., action potentials). Under the STDP process, long-term potentiation (LTP) may occur if an input spike to a certain neuron tends, on average, to occur immediately before that neuron&#39;s output spike. Then, that particular input is made somewhat stronger. On the other hand, long-term depression (LTD) may occur if an input spike tends, on average, to occur immediately after an output spike. Then, that particular input is made somewhat weaker, and hence the name “spike-timing-dependent plasticity.” Consequently, inputs that might be the cause of the postsynaptic neuron&#39;s excitation are made even more likely to contribute in the future, whereas inputs that are not the cause of the postsynaptic spike are made less likely to contribute in the future. The process continues until a subset of the initial set of connections remains, while the influence of all others is reduced to an insignificant level. 
     Because a neuron generally produces an output spike when many of its inputs occur within a brief period (i.e., being cumulative sufficient to cause the output), the subset of inputs that typically remains includes those that tended to be correlated in time. In addition, because the inputs that occur before the output spike are strengthened, the inputs that provide the earliest sufficiently cumulative indication of correlation will eventually become the final input to the neuron. 
     The STDP learning rule may effectively adapt a synaptic weight of a synapse connecting a presynaptic neuron to a postsynaptic neuron as a function of time difference between spike time t pre  of the presynaptic neuron and spike time t post  of the postsynaptic neuron (i.e., t=t post −t pre ). A typical formulation of the STDP is to increase the synaptic weight (i.e., potentiate the synapse) if the time difference is positive (the presynaptic neuron fires before the postsynaptic neuron), and decrease the synaptic weight (i.e., depress the synapse) if the time difference is negative (the postsynaptic neuron fires before the presynaptic neuron). 
     In the STDP process, a change of the synaptic weight over time may be typically achieved using an exponential decay, as given by: 
                     Δ   ⁢           ⁢     w   ⁡     (   t   )         =     {                   a   +     ⁢     ⅇ       -   t     /     k   +           +   μ     ,     t   &gt;   0                     a   -     ⁢     ⅇ       -   t     /     k   -           ,     t   &lt;   0             ,               (   1   )               
where k +  and k − τ sign(Δt)  are time constants for positive and negative time difference, respectively, a +  and a −  are corresponding scaling magnitudes, and μ is an offset that may be applied to the positive time difference and/or the negative time difference.
 
       FIG. 3  illustrates an exemplary diagram  300  of a synaptic weight change as a function of relative timing of presynaptic and postsynaptic spikes in accordance with the STDP. If a presynaptic neuron fires before a postsynaptic neuron, then a corresponding synaptic weight may be increased, as illustrated in a portion  302  of the graph  300 . This weight increase can be referred to as an LTP of the synapse. It can be observed from the graph portion  302  that the amount of LTP may decrease roughly exponentially as a function of the difference between presynaptic and postsynaptic spike times. The reverse order of firing may reduce the synaptic weight, as illustrated in a portion  304  of the graph  300 , causing an LTD of the synapse. 
     As illustrated in the graph  300  in  FIG. 3 , a negative offset p may be applied to the LTP (causal) portion  302  of the STDP graph. A point of cross-over  306  of the x-axis (y=0) may be configured to coincide with the maximum time lag for considering correlation for causal inputs from layer i−1. In the case of a frame-based input (i.e., an input that is in the form of a frame of a particular duration comprising spikes or pulses), the offset value μ can be computed to reflect the frame boundary. A first input spike (pulse) in the frame may be considered to decay over time either as modeled by a postsynaptic potential directly or in terms of the effect on neural state. If a second input spike (pulse) in the frame is considered correlated or relevant to a particular time frame, then the relevant times before and after the frame may be separated at that time frame boundary and treated differently in plasticity terms by offsetting one or more parts of the STDP curve such that the value in the relevant times may be different (e.g., negative for greater than one frame and positive for less than one frame). For example, the negative offset μ may be set to offset LTP such that the curve actually goes below zero at a pre-post time greater than the frame time and it is thus part of LTD instead of LTP. 
     Neuron Models and Operation 
     There are some general principles for designing a useful spiking neuron model. A good neuron model may have rich potential behavior in terms of two computational regimes: coincidence detection and functional computation. Moreover, a good neuron model should have two elements to allow temporal coding: arrival time of inputs affects output time and coincidence detection can have a narrow time window. Finally, to be computationally attractive, a good neuron model may have a closed-form solution in continuous time and stable behavior including near attractors and saddle points. In other words, a useful neuron model is one that is practical and that can be used to model rich, realistic and biologically-consistent behaviors, as well as be used to both engineer and reverse engineer neural circuits. 
     A neuron model may depend on events, such as an input arrival, output spike or other event whether internal or external. To achieve a rich behavioral repertoire, a state machine that can exhibit complex behaviors may be desired. If the occurrence of an event itself, separate from the input contribution (if any), can influence the state machine and constrain dynamics subsequent to the event, then the future state of the system is not only a function of a state and input, but rather a function of a state, event, and input. 
     In an aspect, a neuron n may be modeled as a spiking leaky-integrate-and-fire neuron with a membrane voltage v n (t) governed by the following dynamics: 
                         ⅆ       v   n     ⁡     (   t   )           ⅆ   t       =       α   ⁢           ⁢       v   n     ⁡     (   t   )         +     β   ⁢       ∑   m             ⁢       w     m   ,   n       ⁢       y   m     ⁡     (     t   -     Δ   ⁢           ⁢     t     m   ,   n           )                 ,           (   2   )               
where α and β are parameters, w m.n  is a synaptic weight for the synapse connecting a presynaptic neuron m to a postsynaptic neuron n, and y m (t) is the spiking output of the neuron m that may be delayed by dendritic or axonal delay according to Δt m,n  until arrival at the neuron n&#39;s soma.
 
     It should be noted that there is a delay from the time when sufficient input to a postsynaptic neuron is established until the time when the postsynaptic neuron actually fires. In a dynamic spiking neuron model, such as Izhikevich&#39;s simple model, a time delay may be incurred if there is a difference between a depolarization threshold v t  and a peak spike voltage v peak . For example, in the simple model, neuron soma dynamics can be governed by the pair of differential equations for voltage and recovery, i.e.: 
                         ⅆ   v       ⅆ   t       =       (         k   ⁡     (     v   -     v   t       )       ⁢     (     v   -     v   r       )       -   u   +   I     )     /   C       ,           (   3   )                   ⅆ   u       ⅆ   t       =       a   ⁡     (       b   ⁡     (     v   -     v   r       )       -   u     )       .             (   4   )               
where v is a membrane potential, u is a membrane recovery variable, k is a parameter that describes time scale of the membrane potential v, a is a parameter that describes time scale of the recovery variable u, b is a parameter that describes sensitivity of the recovery variable u to the sub-threshold fluctuations of the membrane potential v , v r  is a membrane resting potential, I is a synaptic current, and C is a membrane&#39;s capacitance. In accordance with this model, the neuron is defined to spike when v&gt;v peak .
 
Hunzinger Cold Model
 
     The Hunzinger Cold neuron model is a minimal dual-regime spiking linear dynamical model that can reproduce a rich variety of neural behaviors. The model&#39;s one- or two-dimensional linear dynamics can have two regimes, wherein the time constant (and coupling) can depend on the regime. In the sub-threshold regime, the time constant, negative by convention, represents leaky channel dynamics generally acting to return a cell to rest in a biologically-consistent linear fashion. The time constant in the supra-threshold regime, positive by convention, reflects anti-leaky channel dynamics generally driving a cell to spike while incurring latency in spike-generation. 
     As illustrated in  FIG. 4 , the dynamics of the model  400  may be divided into two (or more) regimes. These regimes may be called the negative regime  402  (also interchangeably referred to as the leaky-integrate-and-fire (LIF) regime, not to be confused with the LIF neuron model) and the positive regime  404  (also interchangeably referred to as the anti-leaky-integrate-and-fire (ALIF) regime, not to be confused with the ALIF neuron model). In the negative regime  402 , the state tends toward rest (v − ) at the time of a future event. In this negative regime, the model generally exhibits temporal input detection properties and other sub-threshold behavior. In the positive regime  404 , the state tends toward a spiking event (v s ). In this positive regime, the model exhibits computational properties, such as incurring a latency to spike depending on subsequent input events. Formulation of dynamics in terms of events and separation of the dynamics into these two regimes are fundamental characteristics of the model. 
     Linear dual-regime bi-dimensional dynamics (for states v and u) may be defined by convention as: 
                       τ   ρ     ⁢       ⅆ   v       ⅆ   t         =     v   +     q   ρ               (   5   )                   -     τ   u       ⁢       ⅆ   u       ⅆ   t         =     u   +   r             (   6   )               
where q p  and r are the linear transformation variables for coupling.
 
     The symbol ρ is used herein to denote the dynamics regime with the convention to replace the symbol ρ with the sign “−” or “+” for the negative and positive regimes, respectively, when discussing or expressing a relation for a specific regime. 
     The model state is defined by a membrane potential (voltage) v and recovery current u. In basic form, the regime is essentially determined by the model state. There are subtle, but important aspects of the precise and general definition, but for the moment, consider the model to be in the positive regime  404  if the voltage v is above a threshold (v + ) and otherwise in the negative regime  402 . 
     The regime-dependent time constants include τ −  which is the negative regime time constant, and τ +  which is the positive regime time constant. The recovery current time constant τ u  is typically independent of regime. For convenience, the negative regime time constant τ −  is typically specified as a negative quantity to reflect decay so that the same expression for voltage evolution may be used as for the positive regime in which the exponent and τ −  will generally be positive, as will be τ u . 
     The dynamics of the two state elements may be coupled at events by transformations offsetting the states from their null-clines, where the transformation variables are:
 
 q   ρ =−τ ρ   βu−v   ρ   (7)
 
 r =δ( v +ε)   (8)
 
where δ, ε, β and v − , v +  are parameters. The two values for v ρ  are the base for reference voltages for the two regimes. The parameter v −  is the base voltage for the negative regime, and the membrane potential will generally decay toward v in the negative regime. The parameter v +  is the base voltage for the positive regime, and the membrane potential will generally tend away from v +  in the positive regime.
 
     The null-clines for v and u are given by the negative of the transformation variables q ρ and r, respectively. The parameter δ is a scale factor controlling the slope of the u null-cline. The parameter ε is typically set equal to −v − . The parameter β is a resistance value controlling the slope of the v null-clines in both regimes. The τ ρ  time-constant parameters control not only the exponential decays, but also the null-cline slopes in each regime separately. 
     The model may be defined to spike when the voltage v reaches a value v s . Subsequently, the state may be reset at a reset event (which may be one and the same as the spike event):
 
 v={circumflex over (v)}   −   (9)
 
 u=u+Δu    (10)
 
where {circumflex over (v)} −  and Δu are parameters. The reset voltage {circumflex over (v)} −  is typically set to v − .
 
     By a principle of momentary coupling, a closed form solution is possible not only for state (and with a single exponential term), but also for the time required to reach a particular state. The close form state solutions are: 
     
       
         
           
             
               
                 
                   
                     v 
                     ⁡ 
                     
                       ( 
                       
                         t 
                         + 
                         
                           Δ 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           t 
                         
                       
                       ) 
                     
                   
                   = 
                   
                     
                       
                         ( 
                         
                           
                             v 
                             ⁡ 
                             
                               ( 
                               t 
                               ) 
                             
                           
                           + 
                           
                             q 
                             ρ 
                           
                         
                         ) 
                       
                       ⁢ 
                       
                         ⅇ 
                         
                           
                             Δ 
                             ⁢ 
                             
                                 
                             
                             ⁢ 
                             t 
                           
                           
                             τ 
                             ρ 
                           
                         
                       
                     
                     - 
                     
                       q 
                       ρ 
                     
                   
                 
               
               
                 
                   ( 
                   11 
                   ) 
                 
               
             
             
               
                 
                   
                     u 
                     ⁡ 
                     
                       ( 
                       
                         t 
                         + 
                         
                           Δ 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           t 
                         
                       
                       ) 
                     
                   
                   = 
                   
                     
                       
                         ( 
                         
                           
                             u 
                             ⁡ 
                             
                               ( 
                               t 
                               ) 
                             
                           
                           + 
                           r 
                         
                         ) 
                       
                       ⁢ 
                       
                         ⅇ 
                         
                           - 
                           
                             
                               Δ 
                               ⁢ 
                               
                                   
                               
                               ⁢ 
                               t 
                             
                             
                               τ 
                               u 
                             
                           
                         
                       
                     
                     - 
                     r 
                   
                 
               
               
                 
                   ( 
                   12 
                   ) 
                 
               
             
           
         
       
     
     Therefore, the model state may be updated only upon events, such as an input (presynaptic spike) or output (postsynaptic spike). Operations may also be performed at any particular time (whether or not there is input or output). 
     Moreover, by the momentary coupling principle, the time of a postsynaptic spike may be anticipated so the time to reach a particular state may be determined in advance without iterative techniques or Numerical Methods (e.g., the Euler numerical method). Given a prior voltage state v 0 , the time delay until voltage state v f  is reached is given by: 
     
       
         
           
             
               
                 
                   
                     Δ 
                     ⁢ 
                     
                         
                     
                     ⁢ 
                     t 
                   
                   = 
                   
                     
                       τ 
                       ρ 
                     
                     ⁢ 
                     log 
                     ⁢ 
                     
                       
                         
                           v 
                           f 
                         
                         + 
                         
                           q 
                           ρ 
                         
                       
                       
                         
                           v 
                           0 
                         
                         + 
                         
                           q 
                           ρ 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   13 
                   ) 
                 
               
             
           
         
       
     
     If a spike is defined as occurring at the time the voltage state v reaches v s , then the closed-form solution for the amount of time, or relative delay, until a spike occurs as measured from the time that the voltage is at a given state v is: 
                     Δ   ⁢           ⁢     t   s       =     {             τ   +     ⁢   log   ⁢         v   s     +     q   +         v   +     q   +                   if   ⁢           ⁢   v     &gt;       v   ^     +               ∞       otherwise                   (   14   )               
where {circumflex over (v)} +  is typically set to parameter v − , although other variations may be possible.
 
     The above definitions of the model dynamics depend on whether the model is in the positive or negative regime. As mentioned, the coupling and the regime ρ may be computed upon events. For purposes of state propagation, the regime and coupling (transformation) variables may be defined based on the state at the time of the last (prior) event. For purposes of subsequently anticipating spike output time, the regime and coupling variable may be defined based on the state at the time of the next (current) event. 
     There are several possible implementations of the Cold model, and executing the simulation, emulation or model in time. This includes, for example, event-update, step-event update, and step-update modes. An event update is an update where states are updated based on events or “event update” (at particular moments). A step update is an update when the model is updated at intervals (e.g., 1 ms). This does not necessarily require iterative methods or Numerical methods. An event-based implementation is also possible at a limited time resolution in a step-based simulator by only updating the model if an event occurs at or between steps or by “step-event” update. 
     Compiling Network Descriptions to Multiple Platforms 
     In accordance with aspects of the present disclosure, a system that allows for compilation of networks that target multiple platforms without any modifications to the network description is described. A network description may be created once in a high-level language. Thereafter, previously written and available optimizations for a target platform for compiling and simulating the network may be used without recreating the network description. Making use of another platform may be accomplished by including another set of available optimizations and re-compilation of the network. Thus, the target platform may be changed without modifying or recreating the network description. 
       FIG. 5  illustrates an example implementation  500  of generating executable code for a target platform in a neural network using a general-purpose processor  502  in accordance with certain aspects of the present disclosure. Variables (neural signals), synaptic weights, system parameters associated with a computational network (neural network), delays, frequency bin information, platform-specific optimization information and partitioning functions may be stored in a memory block  504 , while instructions executed at the general-purpose processor  502  may be loaded from a program memory  506 . In an aspect of the present disclosure, the instructions loaded into the general-purpose processor  502  may comprise code for receiving a spiking neural network description. The instructions may also comprise code for receiving platform-specific instructions (e.g., optimizations) for a target platform. Further, the instructions may comprise code for generating executable code for a target platform based on the platform-specific instructions and the network description. 
       FIG. 6  illustrates an example implementation  600  of generating executable code for a target platform in a neural network where a memory  602  can be interfaced via an interconnection network  604  with individual (distributed) processing units (neural processors)  606  of a computational network (neural network) in accordance with certain aspects of the present disclosure. Variables (neural signals), synaptic weights, system parameters associated with the computational network (neural network) delays, frequency bin information, platform-specific optimization information and partitioning functions may be stored in the memory  602 , and may be loaded from the memory  602  via connection(s) of the interconnection network  604  into each processing unit (neural processor)  606 . In an aspect of the present disclosure, the processing unit  606  may be configured to receive a spiking neural network description. The processing unit  606  may also be configured to receive platform-specific instructions (e.g., optimizations) for a target platform. Further, processing unit  606  may be configured to generate executable code for the target platform based on the platform-specific instructions and the network description. 
       FIG. 7  illustrates an example implementation  700  of generating executable code for a target platform in a neural network. As illustrated in  FIG. 7 , one memory bank  702  may be directly interfaced with one processing unit  704  of a computational network (neural network). Each memory bank  702  may store variables (neural signals), synaptic weights, and/or system parameters associated with a corresponding processing unit (neural processor)  704 , delays, frequency bin information platform-specific optimization information and partitioning functions. In an aspect of the present disclosure, the processing unit  704  may be configured to receiving a spiking neural network description. Processing unit  704  may additionally be configured to receive platform-specific instructions (e.g., optimizations) for a target platform. Further, processing unit  704  may be configured to generate executable code for the target platform based on the platform-specific instructions and the network description. 
       FIG. 8  illustrates an example implementation of a neural network  800  in accordance with certain aspects of the present disclosure. As illustrated in  FIG. 8 , the neural network  800  may have multiple local processing units  802  that may perform various operations of methods described herein. Each local processing unit  802  may comprise a local state memory  804  and a local parameter memory  806  that store parameters of the neural network. In addition, the local processing unit  802  may have a local (neuron) model program (LMP) memory  808  for storing a local model program, a local learning program (LLP) memory  810  for storing a local learning program, and a local connection memory  812 . Furthermore, as illustrated in  FIG. 8 , each local processing unit  802  may be interfaced with a configuration processor unit  814  for providing configurations for local memories of the local processing unit  802 , and with a routing connection processing unit  816  that provides routing between the local processing units  802 . 
     In one configuration, a neuron model has means for receiving a spiking neural network description, means for receiving platform-specific instructions (e.g., optimizations), and means for generating executable code. In one aspect, the means for receiving a spiking neural network description, means for receiving platform-specific instructions and/or generating means may be the general-purpose processor  502 , program memory  506 , memory block  504 , memory  602 , interconnection network  604 , processing units  606 , processing unit  704 , local processing units  802 , and/or the routing connection processing units  816  configured to perform the functions recited. In another configuration, the aforementioned means may be any module or any apparatus configured to perform the functions recited by the aforementioned means. 
     According to certain aspects of the present disclosure, each local processing unit  802  may be configured to determine parameters of the neural network based upon desired one or more functional features of the neural network, and develop the one or more functional features towards the desired functional features as the determined parameters are further adapted, tuned and updated. 
       FIG. 9  is a block diagram illustrating an exemplary network description in accordance with aspects of the present disclosure. Referring to  FIG. 9 , a network description  902  is written only once in a high-level language. A compiler  904  processes the network description  902  along with a set of platform-specific optimizations  906  to generate executable code that may be deployed onto a target platform  908 . As shown in  FIG. 9 , the target platform  908 , may for example, comprise a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processor (DSP), a field programmable gate array (FPGA) an application-specific integrated circuit (ASIC) or a combination thereof. Further, the target platform  908  may be a single processor system or a cluster of processors. 
     By way of example,  FIG. 9  shows multiple platform-specific optimizations  906  that may be available for each target platform. The platform-specific optimization  906  may include, but are not limited to, executable optimizations and cache coherence. Executable optimizations may attempt to reduce or minimize certain aspects of the generated executable code. For example, the platform-specific optimization  906  may minimize the amount of time to simulate the network on the specified platform. Other examples include platform-specific optimizations that minimize memory or power consumption during simulation of the neural network. 
     In some aspects, the platform-specific optimizations  906  may include cache coherence in a multiple-processor system (cluster of processors). For example, the compiler  904  may generate code to promote the consistency of data stored in local caches of multiple processors. The platform-specific optimizations  906  may be specified to enable changes of the data in one cache to be propagated throughout the system according to a desired timing. 
     In addition to the platform-specific optimizations  906 , in some aspects, further optimization of the network simulations may be based on how the network is partitioned across different platforms. 
     In some aspects, multiple platform-specific optimizations may be compiled with a single network description  902  to be deployed on multiple target platforms (e.g.,  908 ). This may enable different parts of the network to be simulated on different platforms and be used as another optimization. For example, one functional module of the network may best be simulated using a digital signal processor (DSP), but the remainder of the network may best be simulated using an application-specific integrated circuit (ASIC) specifically designed for it. To overcome this obstacle, in accordance with aspects of the present disclosure, optimizations may be included for both the DSP and the ASIC in the compilation. As such, executable code may be generated and used for simulation on both a target DSP platform and a target ASIC platform. 
     In some aspects, user specified partitioning may be included in the network description  902 . That is, when designing a particular network, a user may attempt to partition or modularize the network in a logical manner. For example, a certain set of neurons in the network may have a high level of interconnectivity and therefore, have a high level of inter-communication. In such a case, it may be desirable for all neurons to reside on a single processor so that communication bandwidth may be increased or even maximized. Thus, in accordance with aspects of the present disclosure, a user may, for example, specify that certain groups of neurons reside on a single processor as an optimization in the high-level network description  902 . 
     In some aspects, a function specified partitioning optimization may be included in the network description  902 . For example, during the design of a particular network, a partitioning function may be implemented that may accept specific values (e.g., total number of neurons, connectivity statistics and network topography) as arguments and may assign subsets of neurons to different partitions. In another example, the partitioning function may be implemented such that it accepts network topography information as an input and determines a subset of neurons that have only feed-forward connections to another subset of neurons. In this case, the partitioning function may assign a first subset of neurons to one partition and a second subset of neurons to another partition. As such, automatically partitioning the network with a user specified function in this way would allow for an efficient method of distributing neurons onto different processors. 
     In some aspects, the network description  902  may include an optimization for partitioning based on feature restrictions. At times, the description of a particular network may contain features that may only be executed on certain platforms. For example, when deploying the network, certain features may not be supported on a highly specialized ASIC and should be executed on more general-purpose hardware, such as a CPU. In accordance with aspects of the present disclosure, the compiler  904  may partition the network such that the features that are not supported in the ASIC are executed on the CPU instead. Thus, the network description may remain unchanged even when a user is completely unaware of feature restrictions. 
     In some aspects, the network description  902  may include partitioning optimizations related to fault tolerance. For example, in cases where certain hardware failures occur, simulation of the network may continue by re-distributing neurons that resided on the faulty hardware onto functioning hardware. In a further example, if a certain platform fails, the system may recognize the failure and remove that platform from a list of available platforms. 
     In some aspects, the network may be recompiled with a user specified partitioning function (as discussed above) to assign subsets of neurons to only the available platforms that are still functioning properly. In some aspects, neuron groups may be reassigned by identifying a platform failure, recompiling the network and assigning neurons that resided on the faulty hardware platform to another platform with the appropriate capabilities. 
     In some aspects, the network description  902  may include partitioning optimizations based on simulation statistics. In some instances, an optimal way in which to partition the network may not be clear because sufficiently complex networks may preclude manual analysis. In one example, statistics may be gathered from a network that has not been partitioned. These statistics may be processed with a user specified partitioning function (as described above) to assign subsets of neurons to different partitions. The partitioned network may be a canonical form of the network and may be delivered as a product in this form. 
       FIG. 10  illustrates a method  1000  for generating executable code. In block  1002 , the neuron model receives a spiking neural network description. In block  1004 , the neuron model receiving platform-specific instructions (e.g., optimizations) for a target platform. Furthermore, in block  1006 , the neuron model generates executable code for the target platform based on the platform-specific instructions and the network description. 
     The various operations of methods described above may be performed by any suitable means capable of performing the corresponding functions. The means may include various hardware and/or software component(s) and/or module(s), including, but not limited to, a circuit, an application specific integrated circuit (ASIC), or processor. Generally, where there are operations illustrated in the figures, those operations may have corresponding counterpart means-plus-function components with similar numbering. 
     As used herein, the term “determining” encompasses a wide variety of actions. For example, “determining” may include calculating, computing, processing, deriving, investigating, looking up (e.g., looking up in a table, a database or another data structure), ascertaining and the like. Additionally, “determining” may include receiving (e.g., receiving information), accessing (e.g., accessing data in a memory) and the like. Furthermore, “determining” may include resolving, selecting, choosing, establishing and the like. 
     As used herein, a phrase referring to “at least one of” a list of items refers to any combination of those items, including single members. As an example, “at least one of: a, b, or c” is intended to cover: a, b, c, a-b, a-c, b-c, and a-b-c. 
     The various illustrative logical blocks, modules and circuits described in connection with the present disclosure may be implemented or performed with a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array signal (FPGA) or other programmable logic device (PLD), discrete gate or transistor logic, discrete hardware components or any combination thereof designed to perform the functions described herein. A general-purpose processor may be a microprocessor, but in the alternative, the processor may be any commercially available processor, controller, microcontroller or state machine. A processor may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration. 
     The steps of a method or algorithm described in connection with the present disclosure may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in any form of storage medium that is known in the art. Some examples of storage media that may be used include random access memory (RAM), read only memory (ROM), flash memory, erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, a hard disk, a removable disk, a CD-ROM and so forth. A software module may comprise a single instruction, or many instructions, and may be distributed over several different code segments, among different programs, and across multiple storage media. A storage medium may be coupled to a processor such that the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor. 
     The methods disclosed herein comprise one or more steps or actions for achieving the described method. The method steps and/or actions may be interchanged with one another without departing from the scope of the claims. In other words, unless a specific order of steps or actions is specified, the order and/or use of specific steps and/or actions may be modified without departing from the scope of the claims. 
     The functions described may be implemented in hardware, software, firmware, or any combination thereof. If implemented in hardware, an example hardware configuration may comprise a processing system in a device. The processing system may be implemented with a bus architecture. The bus may include any number of interconnecting buses and bridges depending on the specific application of the processing system and the overall design constraints. The bus may link together various circuits including a processor, machine-readable media, and a bus interface. The bus interface may be used to connect a network adapter, among other things, to the processing system via the bus. The network adapter may be used to implement signal processing functions. For certain aspects, a user interface (e.g., keypad, display, mouse, joystick, etc.) may also be connected to the bus. The bus may also link various other circuits such as timing sources, peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further. 
     The processor may be responsible for managing the bus and general processing, including the execution of software stored on the machine-readable media. The processor may be implemented with one or more general-purpose and/or special-purpose processors. Examples include microprocessors, microcontrollers, DSP processors, and other circuitry that can execute software. Software shall be construed broadly to mean instructions, data, or any combination thereof, whether referred to as software, firmware, middleware, microcode, hardware description language, or otherwise. Machine-readable media may include, by way of example, random access memory (RAM), flash memory, read only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable Read-only memory (EEPROM), registers, magnetic disks, optical disks, hard drives, or any other suitable storage medium, or any combination thereof. The machine-readable media may be embodied in a computer-program product. The computer-program product may comprise packaging materials. 
     In a hardware implementation, the machine-readable media may be part of the processing system separate from the processor. However, as those skilled in the art will readily appreciate, the machine-readable media, or any portion thereof, may be external to the processing system. By way of example, the machine-readable media may include a transmission line, a carrier wave modulated by data, and/or a computer product separate from the device, all which may be accessed by the processor through the bus interface. Alternatively, or in addition, the machine-readable media, or any portion thereof, may be integrated into the processor, such as the case may be with cache and/or general register files. Although the various components discussed may be described as having a specific location, such as a local component, they may also be configured in various ways, such as certain components being configured as part of a distributed computing system. 
     The processing system may be configured as a general-purpose processing system with one or more microprocessors providing the processor functionality and external memory providing at least a portion of the machine-readable media, all linked together with other supporting circuitry through an external bus architecture. Alternatively, the processing system may comprise one or more neuromorphic processors for implementing the neuron models and models of neural systems described herein. As another alternative, the processing system may be implemented with an application specific integrated circuit (ASIC) with the processor, the bus interface, the user interface, supporting circuitry, and at least a portion of the machine-readable media integrated into a single chip, or with one or more field programmable gate arrays (FPGAs), programmable logic devices (PLDs), controllers, state machines, gated logic, discrete hardware components, or any other suitable circuitry, or any combination of circuits that can perform the various functionality described throughout this disclosure. Those skilled in the art will recognize how best to implement the described functionality for the processing system depending on the particular application and the overall design constraints imposed on the overall system. 
     The machine-readable media may comprise a number of software modules. The software modules include instructions that, when executed by the processor, cause the processing system to perform various functions. The software modules may include a transmission module and a receiving module. Each software module may reside in a single storage device or be distributed across multiple storage devices. By way of example, a software module may be loaded into RAM from a hard drive when a triggering event occurs. During execution of the software module, the processor may load some of the instructions into cache to increase access speed. One or more cache lines may then be loaded into a general register file for execution by the processor. When referring to the functionality of a software module below, it will be understood that such functionality is implemented by the processor when executing instructions from that software module. 
     If implemented in software, the functions may be stored or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media include both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage medium may be any available medium that can be accessed by a computer. By way of example, and not limitation, such computer-readable media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. In addition, any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared (IR), radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Disk and disc, as used herein, include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk, and Blu-ray® disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Thus, in some aspects computer-readable media may comprise non-transitory computer-readable media (e.g., tangible media). In addition, for other aspects computer-readable media may comprise transitory computer-readable media (e.g., a signal). Combinations of the above should also be included within the scope of computer-readable media. 
     Thus, certain aspects may comprise a computer program product for performing the operations presented herein. For example, such a computer program product may comprise a computer-readable medium having instructions stored (and/or encoded) thereon, the instructions being executable by one or more processors to perform the operations described herein. For certain aspects, the computer program product may include packaging material. 
     Further, it should be appreciated that modules and/or other appropriate means for performing the methods and techniques described herein can be downloaded and/or otherwise obtained by a user terminal and/or base station as applicable. For example, such a device can be coupled to a server to facilitate the transfer of means for performing the methods described herein. Alternatively, various methods described herein can be provided via storage means (e.g., RAM, ROM, a physical storage medium such as a compact disc (CD) or floppy disk, etc.), such that a user terminal and/or base station can obtain the various methods upon coupling or providing the storage means to the device. Moreover, any other suitable technique for providing the methods and techniques described herein to a device can be utilized. 
     It is to be understood that the claims are not limited to the precise configuration and components illustrated above. Various modifications, changes and variations may be made in the arrangement, operation and details of the methods and apparatus described above without departing from the scope of the claims.