Neuron
This page describes the computational model of spiking neurons used in Axon, which accurately characterizes the behavior of neurons in the neocortex and other brain areas, and enables many different types of channels to be used to modify the neural integration behavior to capture a wide range of neurobiologically identified neuron types.
Conceptually these neural integration dynamics can be understood in terms of the detector model of the neuron, where each neuron is continuously monitoring its synaptic inputs, looking for specific patterns that, when detected, cause it to signal the finding to other neurons.

Figure 1: Tracing of a cortical pyramidal neuron, showing the major components: dendrites where synaptic inputs come into the neuron; the cell body (soma) where these inputs are integrated, and the axon which communicates the output of the neuron.
Most biological neurons have a system of ion channels that drive a brief (< 1 ms (millisecond)) spike in electrical potential, followed by an afterhyperpolarization (AHP) that resets the potential back down to or below the resting potential. This spike triggers the action potential by initiating a travelling wave of depolarization down the axon, resulting in the release of neurotransmitter(s) that then propagate the neural communication on to other neurons (Figure 1, Figure 2). Critically, there is an effective threshold for this spiking dynamic to be initiated, so that electrical potentials below this threshold do not result in a spike or the consequent signal being sent.

Figure 2: Schematic of a synapse, showing a presynaptic terminal button and the postsynaptic dendritic spine. Neurotransmitter (NT) is released into the synaptic cleft from the presynaptic side, and then binds to postsynaptic receptors in the postsynaptic density (PSD) of the spine, causing ion channels to open (e.g., sodium ions for excitatory AMPA channels), and thus activating the receiving neuron. NMDA receptors and voltage gated calcium channels (VGCC) allow calcium (Ca++) to enter the cell, triggering synaptic plasticity (learning). Metabotropic receptors such as mGluR do not open to allow ions to flow (as ionotropic ones do), and instead they trigger second-messenger cascades of reactions that can affect learning and other processes in the postsynaptic cell.
The \(Na^+\) (sodium) and \(K^+\) (potassium) channels underlying neural spiking were first described by Hodgkin & Huxley (1952), and have remained a cornerstone of neuroscience since then. However, the actual “HH” channel dynamics require a very fast rate of numerical integration because a lot happens in a very short period of time, so they are not computationally efficient to use directly. Instead, we adopt in axon a widely used and well-established approximation called AdEx (Adaptive Exponential; Brette & Gerstner, 2005), that uses an exponential function to approximate the voltage spike, and it also captures the spike rate adaptation dynamics of the actual HH equations.
To explore the full behavior of Axon spiking neurons interactively, see the neuron simulation, which allows you to observe the behavior of the different channels.
Spiking neurons have several important differences from rate code activations, which are dominant in more abstract neural network models such as those used in large language models (LLMs), and were used in the Leabra model. In a rate code, neurons continuously communicate a floating point value representing something like the instantaneous rate of spiking.
When used in a biologically realistic context where neural signals are being updated and communicated continuously over time, typically at a roughly 1 ms (millisecond) resolution, a rate code neuron is constantly sending its signal to influence other neurons, with no gaps or pauses. By contrast, discrete spiking naturally creates significant periods of silence in terms of the output of a given neuron, and this silence turns out to be golden, because it allows other neurons to send their signals in turn, without every neuron constantly being influenced by every other neuron. In practice, this allows spiking networks to much more robustly integrate graded and high-dimensional signals over time, compared to rate code neurons.
The temporal dynamics of neural integration in spiking neurons exhibits the properties of temporal summation and spatial summation that are often discussed in introductory neuroscience textbooks: spikes that arrive close together in time can have an additive impact, and likewise there are important impacts of the spatial organization of synaptic inputs across the dendritic branches of a neuron (Figure 1).
The neural integration dynamics of biological neurons described in detail below are well-characterized using simple electronic circuit equations, reflecting the conductance of ions into and out of the cell across ion channels, and the resulting effects of this electrical current on the overall electrical potential of the neuron, as measured across its lipid membrane (i.e., the membrane potential, \(V_m\)).
Axon uses this standard conductance model to update the membrane potential of neurons, incorporating a number of more complex ion channels with various modulatory properties, that shape the overall information integration properties of the neuron across time. See also the Biological neuron model wikipedia page for an excellent broader treatment of these models.
Neural integration
The primary inputs to a neuron are excitation and inhibition, along with a constant leak channel, the dynamics of which can be understood using basic principles of electricity. We first provide a conceptual, intuitive understanding of this process, and then show how it relates to the underlying electrical properties of neurons. Then, we’ll see how to translate this process into mathematical equations that can actually be simulated on the computer.

Figure 3: The neuron is a tug-of-war battleground between inhibition and excitation. The relative strength of each is what determines the membrane potential, Vm, which is what must get over threshold to fire an action potential output from the neuron.
The neural integration process can be understood in terms of a tug-of-war (Figure 3). This tug-of-war takes place in the space of electrical potentials (measured in millivolts, mV) that exist in the neuron relative to the surrounding extracellular medium in which neurons live. Interestingly, this medium, and the insides of neurons and other cells, is basically salt water, with sodium (\(Na^+\)), chloride (\(Cl^-\)) and other ions floating around: we carry our ancient evolutionary environment around within us at all times. The electrical potentials (and differences in concentration) cause the electrically charged ions to flow in and out of the neuron through tiny pores called ion channels, creating small amounts of electrical current.
To see how this works, let’s just consider excitation versus inhibition (inhibition and leak are effectively the same for our purposes at this time). The key point is that the integration process reflects the relative strength of excitation versus inhibition: if excitation is stronger than inhibition, then the neuron’s electrical potential (voltage) increases, perhaps to the point of getting over threshold and firing an output action potential. If inhibition is stronger, then the neuron’s electrical potential decreases, and thus moves further away from getting over the threshold for firing.
Membrane potential tug-of-war
vmTau := 10.0 // time constant for vm integration
gbarE := 0.2
gbarI := 0.4
var gbarEStr, gbarIStr, vmTauStr string
##
totalTime := 100
gE := zeros(totalTime) // excitatory conductance
gI := zeros(totalTime) // inhibitory conductance
Vm := zeros(totalTime) // membrane potential
##
func vmRun() {
gbarEStr = fmt.Sprintf("E: %7.4g", gbarE)
gbarIStr = fmt.Sprintf("I: %7.4g", gbarI)
vmTauStr = fmt.Sprintf("Vm Tau: %7.4g", vmTau)
##
vm := 0.0 // current excitation
tau := array(vmTau)
gbE := array(gbarE)
gbI := array(gbarI)
##
for t := range 100 {
##
ge := gbE * (1.0 - vm)
gi := gbI * (0.0 - vm)
dvm := (1.0 / tau) * (ge + gi)
vm += dvm
Vm[t] = vm
gE[t] = gbE
gI[t] = gbI
##
}
}
vmRun()
plotStyler := func(s *plot.Style) {
s.Range.SetMax(1).SetMin(0)
s.Plot.XAxis.Label = "Time"
s.Plot.XAxis.Range.SetMax(100).SetMin(0)
s.Plot.Legend.Position.Left = true
}
plot.SetStyler(Vm, plotStyler)
fig1, pw := lab.NewPlotWidget(b)
Vml := plots.NewLine(fig1, Vm)
gIl := plots.NewLine(fig1, gI)
gEl := plots.NewLine(fig1, gE)
fig1.Legend.Add("Vm", Vml)
fig1.Legend.Add("I", gIl)
fig1.Legend.Add("E", gEl)
func updt() {
vmRun()
Vml.SetData(Vm)
gEl.SetData(gE)
gIl.SetData(gI)
pw.NeedsRender()
}
func addTauSlider(label *string, val *float64, mxVal float32) {
tx := core.NewText(b)
tx.Styler(func(s *styles.Style) {
s.Min.X.Ch(40) // clean rendering with variable width content
})
core.Bind(label, tx)
sld := core.NewSlider(b).SetMin(1).SetMax(mxVal).SetStep(1).SetEnforceStep(true)
sld.SendChangeOnInput()
sld.OnChange(func(e events.Event) {
updt()
tx.UpdateRender()
})
core.Bind(val, sld)
}
func addSlider(label *string, val *float64, mxVal float32) {
tx := core.NewText(b)
tx.Styler(func(s *styles.Style) {
s.Min.X.Ch(40) // clean rendering with variable width content
})
core.Bind(label, tx)
sld := core.NewSlider(b).SetMin(0.02).SetMax(mxVal).SetStep(0.02).SetEnforceStep(true)
sld.SendChangeOnInput()
sld.OnChange(func(e events.Event) {
updt()
tx.UpdateRender()
})
core.Bind(val, sld)
}
addSlider(&gbarIStr, &gbarI, 1)
addSlider(&gbarEStr, &gbarE, 1)
addTauSlider(&vmTauStr, &vmTau, 50)Sim 1 provides an interactive exploration of this tug-of-war dynamic. As you drag the E (excitation) and I (inhibition) sliders, you control the strength of these two inputs, which are also plotted for easy visualization. The membrane potential Vm starts at 0, and is pushed up toward 1 by the E inputs, and down toward 0 by the I inputs. Thus, if you move E down toward 0, you can see that Vm barely gets off the ground, whereas if it is equal to I (e.g., both are 0.4) then Vm goes to exactly 0.5, reflecting an even balance between these opposing forces. When E is greater than I then, Vm goes increasingly higher, closer to 1. The Vm Tau slider controls the rate at which Vm is updated (see exponential integration for critical background on such parameters), with larger values taking a longer time to converge on a stable final Vm value.
- • What happens when
EandIare both tied, but both at 0.2, or both at 0.8? Are these cases equivalent in all respects in terms of the resultingVmplot? If not, in which ways do they differ?
Hopefully, you can see the relative nature of this neural integration process: what matters most (though not entirely) is the relative balance between these values, not their absolute values.
The standard neuroscience notation in Figure 3 is as follows:
• \(g_i\) — the inhibitory conductance (g is the symbol for a conductance, and i indicates inhibition) — this is the total strength of the inhibitory input (i.e., how strong the inhibitory guy is tugging), and plays a major role in determining how strong of an inhibitory current there is. This corresponds biologically to the proportion of inhibitory ion channels that are currently open and allowing inhibitory ions to flow (these are chloride or \(Cl^-\) ions in the case of GABA inhibition, and potassium or \(K^+\) ions in the case of leak currents). For electricity buffs, the conductance is the inverse of resistance — most people find conductance more intuitive than resistance, so we’ll stick with it.
• \(E_i\) — the inhibitory driving potential — in the tug-of-war metaphor, this just amounts to where the inhibitory guy happens to be standing relative to the electrical potential scale that operates within the neuron. Typically, this value is around -75mV where mV stands for millivolts — one thousandth (1\/1,000) of a volt. These are very small electrical potentials for very small neurons.
• \(\Theta\) — the action potential threshold — this is the electrical potential at which the neuron will fire an action potential output to signal other neurons. This is typically around -50mV. This is also called the firing threshold or the spiking threshold, because neurons are described as “firing a spike” when they get over this threshold.
• \(V_m\) — the membrane potential of the neuron (V = voltage or electrical potential, and m = membrane). This is the current electrical potential of the neuron relative to the extracellular space outside the neuron. It is called the membrane potential because it is the cell membrane (thin layer of fat basically) that separates the inside and outside of the neuron, and that is where the electrical potential really happens. An electrical potential or voltage is a relative comparison between the amount of electric charge in one location versus another. It is called a “potential” because when there is a difference, there is the potential to make stuff happen.
For example, when there is a big potential difference between the charge in a cloud and that on the ground, it creates the potential for lightning. Just like water, differences in charge always flow “downhill” to try to balance things out. So if you have a lot of charge (water) in one location, it will flow until everything is all level. The cell membrane is effectively a dam against this flow, enabling the charge inside the cell to be different from that outside the cell. The ion channels in this context are like little tunnels in the dam wall that allow things to flow in a controlled manner. And when things flow, the membrane potential changes! In the tug-of-war metaphor, think of the membrane potential as the flag attached to the rope that marks where the balance of tugging is at the current moment.
• \(E_e\) — the excitatory driving potential — this is where the excitatory guy is standing in the electrical potential space (typically around 0 mV).
• \(g_e\) — the excitatory conductance — this is the total strength of the excitatory input, reflecting the proportion of excitatory ion channels that are open (these channels pass sodium (\(Na^+\)) ions — our deepest thoughts are all just salt water moving around).

Figure 4: Specific cases in the tug-of-war scenario.
Figure 4 illustrates specific cases in the tug-of-war scenario. In the first case, the excitatory conductance \(g_e\) is very low (indicated by the small size of the excitatory guy), which represents a neuron at rest, not receiving many excitatory input signals from other neurons. In this case, the inhibition/leak pulls much more strongly, and keeps the membrane potential (\(V_m\)) down near the -70mV territory, which is also called the resting potential of the neuron. As such, it is below the action potential threshold \(\Theta\), and so the neuron does not output any signals itself.
In the next case (b), the excitation is as strong as the inhibition, and this means that it can pull the membrane potential up to about the middle of the range. Because the firing threshold is toward the lower end of the range, this is enough to get over threshold and fire a spike. The neuron will now communicate its signal to other neurons, and contribute to the overall flow of information in the brain’s network.
The last case (c) illustrates how the integration process is sensitive to the relative balance of excitation versus inhibition. If both are overall weaker, then neurons can still get over firing threshold. This is important for example in the visual system, which can experience huge variation in the overall amount of light depending on the environment (e.g., compare snowboarding on a bright sunny day versus walking through thick woods after sunset). The total amount of light coming into the visual system also drives a “background” level of inhibition, in addition to the amount of excitation that visual neurons experience. Thus, when it’s bright, neurons get greater amounts of both excitation and inhibition compared to when it is dark. This enables the neurons to remain in their sensitive range for detecting things despite large differences in overall input levels.
Spiking output
The membrane potential \(V_m\) is not communicated directly to other neurons; instead it is subject to a threshold, so that only the strongest relative levels of excitation are then communicated, resulting in a more efficient and compact encoding of information in the brain. In human terms, neurons avoid sharing “TMI” (too much information), and instead communicate only relevant, important information, as if they were following “Gricean maxims”.

Figure 5: Trace of an Axon neuron spiking action potentials in response to an excitatory input. The Vm line shows the membrane potential and its spikes, with resetting after each spike (afterhyperpolarization or AHP) and the climb back up to spike again, as a function of the relative excitatory and inhibitory currents. The spikes increase in frequency over time as the NMDA current shown in Gnmda increases in strength. The Act line shows an integrated rate of spiking based on the average inter-spike-interval (ISI).
As described above, the firing of discrete spikes when \(V_m\) gets above threshold occurs in biological neurons via the fast \(Na^+\) and \(K^+\) channels as first described by Hodgkin & Huxley, 1952, and we use the AdEx (Adaptive Exponential; Brette & Gerstner, 2005) model to approximate these fast dynamics. There is an overall cycle of spiking followed by afterhyperpolarization (AHP) and a subsequent rise in \(V_m\) driven by continued excitation (Figure 5), which results in an overall spike rate that reflects the relative balance of excitation vs. inhibition.
In rate code activation models, this expected rate of spiking is computed directly from the inputs to a neuron, and is then computed as an overall activation value to other neurons. The validity of this rate code approximation is a matter of considerable debate, which is discussed further in the rate code activation page. Briefly, the Leabra model used rate code signaling, and direct comparisons with the discrete spiking Axon model show that rate codes can capture many of the same functional and cognitive phenomena as a discrete spiking model, but overall they are more brittle and require a significant tradeoff between representing graded, probabilistic information, and the speed and responsiveness of the network overall.
Specifically, a key functional advantage of discrete spiking is that considerable information about a new stimulus input can be rapidly propagated throughout the network via a cascade of first spike responses (Thorpe et al., 2001). Electrophysiological recordings show that this initial wave of responding conveys significant information about the stimulus within a relatively short window of roughly 50-70 ms after it first hits the neocortex, with the relative timing of these first spikes being strongly correlated with the subsequent rate of firing. However, the subsequent firing is also critical for resolving many important properties of the stimulus, and provides a window for top-down and bottom-up signals to converge on a consistent interpretation. Thus, discrete spiking enables this “best of both worlds” of fast initial responding plus effective subsequent integration of more graded signals.
Mathematical formulation
With the above intuitive understanding of how the neuron integrates excitation and inhibition, we can now see how a set of mathematical equations can be used to simulate this behavior in our models.
Neural integration
We begin by formalizing the “strength” by which each side of the tug-of-war pulls, and then show how that causes the \(V_m\) “flag” to move as a result. This provides explicit equations for the tug-of-war dynamic integration process. Then, we show how to actually compute the conductance factors in this tug-of-war equation as a function of the inputs coming into the neuron, and the synaptic weights (focusing on the excitatory inputs for now).
The key idea behind these equations is that each side in the tug-of-war pulls with a strength that is proportional to both its overall strength (conductance), and how far the “flag” (\(V_m\)) is away from its position (indicated by the driving potential E). Imagine that the tuggers are planted in their position, and their arms are fully contracted when the \(V_m\) flag gets to their position (E), and they can’t re-grip the rope, such that they can’t pull any more at this point. To put this idea into an equation, we can write the “force” or current that the excitatory side exerts as:
\[ I_e = g_e \left(E_e-V_m\right) \]
The excitatory current is \(I_e\) (I is the traditional term for an electrical current, and e again for excitation), and it is the product of the conductance \(g_e\) times how far the membrane potential is away from the excitatory driving potential. If \(V_m = E_e\) then the excitatory side has “won” the tug of war, and it no longer pulls anymore, and the current goes to zero (regardless of how big the conductance might be — anything times 0 is 0). Interestingly, this also means that the excitatory side pulls the strongest when the \(V_m\) “flag” is furthest away from it — i.e., when the neuron is at its resting potential. Thus, it is easiest to excite a neuron when it’s well rested.
This equation is known as Ohm’s Law, one of the most basic laws of electricity, which you might have learned about in terms of resistance, which is 1 / conductance. Conductance is more intuitive in this case because it can be directly understood as the size and number of the channel openings that allow ions to flow.
The same basic equation can be written for the inhibition side, and also separately for the leak “side” (which we can now reintroduce as a clone of the inhibition term):
\[ I_i = g_i \left(E_i-V_m\right) \]
\[ I_l = g_l \left(E_l-V_m\right) \]
(only the subscripts are different in all of these equations).
Next, we can add together these three different currents to get the net current, which represents the net flow of charged ions across the neuron’s membrane (through the ion channels):
\[ I_{net} = I_e + I_i + I_l \]
\[ = g_e \left(E_e-V_m\right) + g_i \left(E_i-V_m\right) + g_l \left(E_l-V_m\right) \]
So what good is a net current? Recall that electricity is like water, and it flows to even itself out. When water flows from a place where there is a lot of water to a place where there is less, the result is that there is less water in the first place and more in the second. The same thing happens with our currents: the flow of current changes the membrane potential (height of the water) inside the neuron:
\[ V_m\left(t\right) = V_m\left(t-1\right) + \frac{1}{\tau_{vm}} I_{net} \]
\(V_m(t)\) is the current value of \(V_m\), which is updated from value on the previous time step \(V_m(t-1)\), and the \(\tau_{vm}\) is an exponential integration time constant that determines how fast the membrane potential changes. It mainly reflects the capacitance of the neuron’s membrane.
The above two equations are the most essential tools we need to simulate a neuron on a computer. It tells us how the membrane potential changes as a function of the inhibitory, leak and excitatory inputs — given specific numbers for these input conductances, and a starting \(V_m\) value, we can then iteratively compute the new \(V_m\) value according to the above equations, and this will accurately reflect how a real neuron would respond to similar such inputs.
To summarize, here’s a single version of the above equations that does everything:
\[ V_m(t) = V_m(t-1) + \frac{1}{\tau_{vm}} \left[ g_e (E_e-V_m) + g_i (E_i-V_m) + g_l (E_l-V_m) \right] \]
For those of you who noticed the issue with the minus sign above, or are curious know more details about where these equations come from, see neuron electrophysiology. If you’re happy enough with where we’ve come, feel free to move along to finding out how we compute these input conductances, and what we then do with the \(V_m\) value to drive the output signal of the neuron.
Computing input conductances
The excitatory and inhibitory input conductances represent the total number of ion channels of each type that are currently open and thus allowing ions to flow. In real neurons, these conductances are typically measured in nanosiemens (nS), which is \(10^{-9}\) siemens (a very small number — neurons are very tiny). Typically, neuroscientists divide these conductances into two components:
• \(\overline{g}\) (“g-bar”) — a constant value that determines the maximum conductance that would occur if every ion channel were to be open, and:
• \(g(t)\) — a dynamically changing variable that indicates at the present moment, what fraction of the total number of ion channels are currently open (goes between 0 and 1). All of the computed values in simulations go into this value, with the \(\overline{g}\) effectively just providing a conversion of these normalized 0..1 values into the appropriate neurobiological units, as shown in Units and parameters.
Thus, the total conductances of interest are written as:
\[ \overline{g}_e g_e(t) \]
\[ \overline{g}_i g_i(t) \]
\[ \overline{g}_l \]
(note that because leak is a constant, it does not have a dynamically changing value, only the constant g-bar value).
This separation of terms makes it easier to compute the conductance, because all we need to focus on is computing the proportion or fraction of open ion channels of each type. This can be done by computing the average number of ion channels open at each synaptic input to the neuron. As we discuss in neuron channels, the fast synaptic channels involved in excitation (AMPA) and inhibition (GABA-A) respond in less than a millisecond to new neurotransmitter binding, and have exponential decay constants that cause them to stay open for a few milliseconds after this initial binding.
The rise (opening) component of the excitatory conductance is computed as a function of the new glutamate neurotransmitter released by the presynaptic sending neurons that binds to the AMPA channels (as shown in Figure 2), which we label in the simulation code as GeRaw:
\[ g_{e-raw}(t) = \frac{1}{n} \sum_i x_i w_i \]
where \(x_i\) is the 0 or 1 spiking activity of a particular sending neuron indexed by the subscript \(i\), which is subject to axonal conductance delays in arriving at the synapse as discussed below. \(w_i\) is the synaptic weight strength that connects sending neuron \(i\) to the receiving neuron, which is a function of the number and efficacy of the AMPA receptors at this synapse. \(n\) is the total number of channels of that type (in this case, excitatory) across all relevant synaptic inputs, which we use to normalize this term. As discussed in neuron detector, the synaptic weight determines what patterns the receiving neuron is sensitive to, and is what adapts with learning — this equation shows how it enters mathematically into computing the total amount of excitatory conductance.
The resulting AMPA excitatory conductance is integrated over time from this raw new input, plus the exponential decay of previously opened channels:
\[ g_e(t) = g_{e-raw}(t) + g_e(t-1) \left( 1 - \frac{1}{\tau_d} \right) \]
Eq 10 suggests that the neuron performs a very simple function to determine how much input it is getting: it just adds it up from all of its different sources (and takes the average to compute a proportion instead of a sum). Each input source contributes in proportion to how active the sender is, multiplied by how much the receiving neuron cares about that information, determined by the synaptic weight value. We also refer to this average total input as the net input, which is the term used in abstract neural network models.
The same types of equations apply to inhibitory input conductances, which are computed in terms of the activations of inhibitory sending neurons, times the inhibitory weight values, and involve the GABA neurotransmitter and GABA-A receptors.
The AMPA receptor conductance decays exponentially with a time constant \(\tau_d\) of about 5 ms (Hestrin et al., 1990), while GABA-A inhibitory channels have a time constant of around 7 ms (Xiang et al., 1998).
Functionally, this extra trace of discrete spiking inputs supports the temporal summation of inputs over time, so that inputs arriving within this temporal integration window can add together to drive larger overall excitatory conductances.
Table 1: Axonal conduction delays
| Pathway | Minimum | Mean or Median |
|---|---|---|
| Corticocortical | 2 ms | 2.3 (magno visual) – ~10 ms |
| Corticothalamic | 2 ms | ~10 ms |
| Thalamocortical | 0.5 ms | ~1 ms |
| Collosal | ~2 ms | ~10 ms |
It takes time for action potentials to propagate down the axon, which is generally a function of the distance travelled and also the extent of myelination of the axon, where the myelin acts as an insulator that speeds conduction velocities by reducing the capacitance of the axonal membrane. Table 1 shows approximate values from scholarpedia assembled from various sources and species (e.g., Ferraina et al., 2002; Swadlow, 1990; Swadlow, 2000). We include this axonal conduction delay in the model, with a default value of 2 ms, under the assumption that most of our models represent relatively small brains at this point. In practice, using a value of 10 ms does not significantly affect the performance of the models.
There are some further complexities about how we integrate inputs from different input sources (i.e., projections from different source brain areas into a given receiving neuron), which we discuss in neuron dendrites. These mechanisms account in part for the biological complexities associated with inputs coming into different branches on the dendrites (Migliore et al., 1999; Poirazi et al., 2003; Jarsky et al., 2005).
Membrane potential tug-of-war: currents
vmTau := 10.0 // time constant for vm integration
gbarE := 0.2
gbarI := 0.4
var gbarEStr, gbarIStr, vmTauStr string
##
totalTime := 100
iE := zeros(totalTime) // excitatory current
iI := zeros(totalTime) // inhibitory current
Vm := zeros(totalTime) // membrane potential
##
func vmRun() {
gbarEStr = fmt.Sprintf("gbar E: %7.4g", gbarE)
gbarIStr = fmt.Sprintf("gbar I: %7.4g", gbarI)
vmTauStr = fmt.Sprintf("Vm Tau: %7.4g", vmTau)
##
vm := 0.0 // current excitation
tau := array(vmTau)
gbE := array(gbarE)
gbI := array(gbarI)
##
for t := range 100 {
##
ie := gbE * (1.0 - vm)
ii := gbI * (0.0 - vm)
dvm := (1.0 / tau) * (ie + ii)
vm += dvm
Vm[t] = vm
iE[t] = ie
iI[t] = -ii
##
}
}
vmRun()
plotStyler := func(s *plot.Style) {
s.Range.SetMax(1).SetMin(0)
s.Plot.XAxis.Label = "Time"
s.Plot.XAxis.Range.SetMax(100).SetMin(0)
s.Plot.Legend.Position.Left = true
}
plot.SetStyler(Vm, plotStyler)
fig1, pw := lab.NewPlotWidget(b)
Vml := plots.NewLine(fig1, Vm)
iIl := plots.NewLine(fig1, iI)
iEl := plots.NewLine(fig1, iE)
fig1.Legend.Add("Vm", Vml)
fig1.Legend.Add("I_i", iIl)
fig1.Legend.Add("I_e", iEl)
func updt() {
vmRun()
Vml.SetData(Vm)
iEl.SetData(iE)
iIl.SetData(iI)
pw.NeedsRender()
}
func addTauSlider(label *string, val *float64, mxVal float32) {
tx := core.NewText(b)
tx.Styler(func(s *styles.Style) {
s.Min.X.Ch(40) // clean rendering with variable width content
})
core.Bind(label, tx)
sld := core.NewSlider(b).SetMin(1).SetMax(mxVal).SetStep(1).SetEnforceStep(true)
sld.SendChangeOnInput()
sld.OnChange(func(e events.Event) {
updt()
tx.UpdateRender()
})
core.Bind(val, sld)
}
func addSlider(label *string, val *float64, mxVal float32) {
tx := core.NewText(b)
tx.Styler(func(s *styles.Style) {
s.Min.X.Ch(40) // clean rendering with variable width content
})
core.Bind(label, tx)
sld := core.NewSlider(b).SetMin(0.02).SetMax(mxVal).SetStep(0.02).SetEnforceStep(true)
sld.SendChangeOnInput()
sld.OnChange(func(e events.Event) {
updt()
tx.UpdateRender()
})
core.Bind(val, sld)
}
addSlider(&gbarIStr, &gbarI, 1)
addSlider(&gbarEStr, &gbarE, 1)
addTauSlider(&vmTauStr, &vmTau, 50)Sim 2 provides an interactive summary of these neural integration dynamics, plotting the excitatory vs inhibitory currents instead of the conductances as in Sim 1. The inhibitory current is plotted as an absolute value (it actually has a negative sign in our equations), so that it can be directly compared with the excitatory current.
As before, the \(V_m\) value continues to reflect the relative balance between excitation and inhibition, but now you can see how that balance arises in terms of the currents. You should see that no matter what you do to the gbar sliders that control the strength of excitation vs. inhibition, the resulting currents always converge to the same magnitude over time. Why is this?
AdEx spiking equations
Spiking in real neurons according to the Hodgkin & Huxley (1952) equations is driven by a fast sequence of voltage-gated sodium channels that cause a rapid rise in membrane potential once it gets above a critical threshold level, followed by sodium-gated potassium channels that quickly bring the membrane potential back down to a level below the resting potential (afterhyperpolarization, AHP).
Implementing these HH dynamics in a model requires very fast time integration rates that would significantly slow down computation, so we use a much simpler approximation that just sets a Spike value to 1 whenever the membrane potential gets over the spiking threshold. This spike value is then reset to 0 on the next time step, which accounts for the fact that a spike impulse typically lasts about 1 ms, which is the numerical integration step size that we use.
This logic is simpler to express in pseudocode:
if (Vm > Theta) then: Spike = 1; Vm = Vm_r; else Spike = 0where Theta is the effective spiking threshold, and Vm_r is the “reset” or “refractory” membrane potential that the Hodgkin-Huxley sodium-gated potassium channels produce. The extra potassium from these channels stays around for a few additional milliseconds, producing a refractory period when the neuron is effectively inactivated and cannot spike again. We use a time constant of 3 ms for this refractory period, during which we simply do not update the Vm variable.
To capture the HH spiking dynamics more accurately, yet still efficiently, Brette & Gerstner (2005) added an exponential term to the Vm computation (introduced by Fourcaud-Trocmé et al., 2003), that simulates the rapid rise caused by the voltage-gated sodium channels:
\[ \overline{g}_l \Delta_T e^{\frac{V_m - \Theta}{\Delta_T}} \]
where \(\Delta_T = 2 mV\) is the slope factor for the exponential function, and \(\Theta = -50 mV\) is the spiking threshold.
The other main feature of the AdEx model is adaptation which makes it harder for the neuron to fire spikes as a function of ongoing activity. This is implemented in Axon using specialized channels.
Units and parameters
Table 2: Neural scale units
| Dimension | Unit | Multiplier | Axon Unit |
|---|---|---|---|
| potential | volt (V) | 0.001 | mV millivolt |
| current | ampere (A) | \(10^{-12}\) | pA picoamperes |
| time | second (s) | 0.001 | ms millisecond |
| conductance | siemens S = A / V | \(10^{-9}\) | nS nanosiemens |
| capacitance | farad F = (s ⋅A) / V | \(10^{-12}\) | pF picofarads |
Table 2 shows the standard neural-scale units that are used in Axon for all of the electrical parameters. Table 3 shows some example parameters in these units, with relevant values from Destexhe et al. (1998) and Migliore et al. (1999).
Table 3: Neural scale parameters
| Parameter | Value |
|---|---|
| Resting potential | -70 mV |
| Spiking threshold \(\Theta\) | -50 mV |
| \(g_{ampa}\) = conductance per excitatory AMPA channel | 0.05 nS |
| \(g_{syn}\) = conductance per excitatory synapse = ~20 channels | 1 nS |
| \(\overline{g}_e\) = ~ max total excitatory input = ~100 synapses | 100 nS |
| \(\overline{g}_{leak}\) | 20 nS |
| max \(I_e(V=-70 mV)\) | 7000 pA |
| standard membrane capacitance C | 281 pF |
| change in V over 1 ms from \(I_e(V=-70 mV)\) = I_e / C | 25 mV |
Table 4 shows the full set of reversal potentials for the basic channels:
Table 4: Electrical potentials
| Parameter | Value |
|---|---|
| Resting potential | -70 mV |
| Leak \(E_l\) | -70 mV |
| Excitatory \(E_e\) | 0 mV |
| Inhibition \(E_i\) | -90 mV |
| Spiking threshold \(\Theta\) | -50 mV |
| Exp Slope \(\Delta_T\) | 2 mV |
Other channels
See the page on neuron channels for more details about the biological properties of the excitatory and inhibitory channels, and a number of other channel types that further modify the dynamics of neurons in functionally important ways. The most important of these additional channels are adaptation channels that cause the neuron to reduce its firing over time in response to sustained excitatory input, and the synergistic effects of NMDA and GABA-B channels that work together to support stable activation states which are critical for learning.
Additional details
There are several additional in-depth pages providing more details about biological and computational neurons:
• Neuron simulation: provides an interactive exploration of the full set of Axon neuron equations responding to a simple pulse of excitation.
• Neuron detector: describes the high-level conceptual model of a neuron as a detector, including a simulation thereof.
• Neuron electrophysiology: more detailed description of the electrophysiology of the neuron, and how the underlying concentration gradients of ions give rise to the electrical integration properties of the neuron.
• Neuron dendrites: details on how excitatory and other neural inputs are computed and scaled across multiple different input projections, in ways that capture some of the additional computational power of dendritic processing within individual neurons.
• Neuron equilibrium potential: shows how to derive the equilibrium (steady-state) \(V_m\) equation, which clearly exhibits the relative tug-of-war dynamic.
• Neuron as a Bayesian optimal detector: shows how the equilibrium membrane potential represents a Bayesian optimal way of integrating the different inputs to the neuron.
Links
Next in Intro Book: Neuron Detector