Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Point Neurons Discretization

Authors
Affiliations
Virginia Tech, USA
Technical University of Denmark
Innatera

Here, we present the derivations based on the Forward Euler method to discretize the continuous time equations of the IF\texttt{IF} and LIF\texttt{LIF} neurons. The Forward Euler method is a simple numerical method to approximate solutions to the first order Ordinary Differential Equations (ODEs). Note that the equations of the IF\texttt{IF} (Eq (1)) and LIF\texttt{LIF} (Eq (3)) neurons are first order ODEs. Therefore, we can use the Forward Euler method to discretize and solve them numerically on our computers.

Forward Euler method

Consider

dy(t)dt=f(t,y)\frac{dy(t)}{dt} = f(t, y)

and an initial condition y(t=0)=y0y(t=0) = y_{0}. In the Forward Euler method, a first order ODE is approximated (based on the forward difference derivative) as below:

f(t,y)y(t+h)y(t)hf(t, y) \approx \frac{y(t+h) - y(t)}{h}

where hh is a very small value, i.e., a very small change in time tt. Let us sample y(t)y(t) (defined over continuous time tt) at discrete times tnt_{n}, i.e., y[tn]y[t_{n}]. In the spirit of this discretization, let us also assume that the difference between consecutive discrete time-steps (i.e., tn+1t_{n+1} and tnt_{n}) is very small, i.e., let h=tn+1tnh = t_{n+1} - t_{n}. Thus, the Eq (2) becomes the following:

f(tn,y[tn])y[tn+1]y[tn]hf(t_{n}, y[t_{n}]) \approx \frac{y[t_{n+1}] - y[t_{n}]}{h}

For convenience, let us replace y[tn+1]y[t_{n+1}] and y[tn]y[t_{n}] with y[n+1]y[n+1] and y[n]y[n] respectively. Also, for practical purposes, let us replace ‘\approx’ with ‘==’, however, we should keep in mind that Forward Euler method is still an approximation and error grows with the value of hh as well as accumulates with every next time-step. Finally, rearranging the Eq (3) gives us the following:

y[n+1]=y[n]+h×f(n,y[n])y[n+1] = y[n] + h\times f(n, y[n])

We can use the formulation of the Eqs (4) or (3) to derive the discrete-time equations of the IF\texttt{IF} and LIF\texttt{LIF} neurons.

Discretizing IF\texttt{IF} neuron

The continuous-time equation of the IF\texttt{IF} neuron as mentioned in the Section 1.1.2.1 is:

CmdV(t)dt=I(t)C_\text{m}\frac{dV(t)}{dt} = I(t)

To discretize it, let us consider Cm=1C_\text{m}=1, therefore, the Eq Equation to discretize becomes:

dV(t)dt=I(t)\frac{dV(t)}{dt} = I(t)

As can be easily seen, the Eq Equation is of the same form as Eq (1) above, thus, from Eq (4), we get the following discrete form of Eq Equation:

V[n+1]V[n]h=f(n,V[n])\frac{V[n+1] - V[n]}{h} = f(n, V[n])

i.e.,

V[n+1]V[n]h=I[n]\frac{V[n+1] - V[n]}{h} = I[n]

Note that in Eq Equation, hh denotes the difference between consecutive timesteps (as mentioned in Forward Euler method), therefore, let us assume the difference is 1 timestep, i.e., h=1h=1. Thus, setting h=1h=1 in Eq Equation, we get the following:

V[n+1]=V[n]+I[n]V[n+1] = V[n] + I[n]

which is a discrete-time equation of an IF\texttt{IF} neuron.

Discretizing LIF\texttt{LIF} neuron

The continuous-time equation of the LIF\texttt{LIF} neuron as mentioned in the Section 1.1.2.2 is:

τmdV(t)dt=(V(t)Vrest)+RmI(t)\tau_\text{m}\frac{dV(t)}{dt} = -(V(t) - V_\text{rest}) + R_\text{m}I(t)

which upon rearranging becomes:

dV(t)dt=(V(t)Vrest)τm+RmI(t)τm\frac{dV(t)}{dt} = \frac{-(V(t) - V_\text{rest})}{\tau_\text{m}} + \frac{R_\text{m}I(t)}{\tau_\text{m}}

Note that τm=RmCm\tau_\text{m}=R_\text{m}C_\text{m}, therefore, Eq Equation becomes:

dV(t)dt=(V(t)Vrest)RmCm+I(t)Cm\begin{align*} \frac{dV(t)}{dt} &= \frac{-(V(t)-V_\text{rest})}{R_\text{m}C_\text{m}} + \frac{I(t)}{C_\text{m}} \end{align*}

To discretize it, let us consider Cm=1C_\text{m}=1 (same as for discretizing the IF\texttt{IF} neuron), and Vrest=0V_\text{rest}=0, therefore, the Eq Equation to discretize becomes:

dV(t)dt=V(t)Rm+I(t)=vdecayV(t)+I(t)where vdecay=1Rm\begin{align*} \frac{dV(t)}{dt} &= \frac{-V(t)}{R_\text{m}} + I(t) \\ &= -v_\text{decay}V(t) + I(t) \quad\quad\text{where }v_\text{decay} = \frac{1}{R_\text{m}} \end{align*}

As can be easily seen, Eq Equation is of the same form as Eq (1), thus, from Eq (4), we get the following discrete form of Eq Equation:

V[n+1]V[n]h=f(n,V[n])\frac{V[n+1] - V[n]}{h} = f(n, V[n])

i.e.,

V[n+1]V[n]h=vdecay×V[n]+I[n]\frac{V[n+1] - V[n]}{h} = -v_\text{decay}\times V[n] + I[n]

Note that in Eq Equation (similar to the case of discretizing the IF\texttt{IF} neuron), hh denotes the difference between consecutive timesteps, therefore, assuming h=1h=1 in Eq Equation, we get the following:

V[n+1]=V[n]vdecay×V[n]+I[n]=(1vdecay)×V[n]+I[n]\begin{align*} V[n+1] &= V[n] - v_\text{decay}\times V[n] + I[n] \\ &= (1-v_\text{decay})\times V[n] + I[n] \end{align*}

which is the discrete-time equation of a LIF\texttt{LIF} neuron.