Skip to content

Commit

Permalink
change os dump (brian nb) oh and F(V) figs! :)
Browse files Browse the repository at this point in the history
  • Loading branch information
tfiers committed Jun 26, 2023
1 parent b415c43 commit c43b159
Show file tree
Hide file tree
Showing 9 changed files with 727 additions and 21 deletions.
7 changes: 6 additions & 1 deletion Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

julia_version = "1.9.0-beta3"
manifest_format = "2.0"
project_hash = "99d0b46c23143cc468e33e02179e944d43850429"
project_hash = "44656be0237184e93904c09781ea7366716f401a"

[[deps.ATK_jll]]
deps = ["Artifacts", "Glib_jll", "JLLWrappers", "Libdl", "Pkg"]
Expand Down Expand Up @@ -558,6 +558,11 @@ git-tree-sha1 = "f2355693d6778a178ade15952b7ac47a4ff97996"
uuid = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
version = "1.3.0"

[[deps.LambertW]]
git-tree-sha1 = "c5ffc834de5d61d00d2b0e18c96267cffc21f648"
uuid = "984bce1d-4616-540c-a9ee-88d1112d94c9"
version = "0.4.6"

[[deps.Latexify]]
deps = ["Formatting", "InteractiveUtils", "LaTeXStrings", "MacroTools", "Markdown", "OrderedCollections", "Printf", "Requires"]
git-tree-sha1 = "2422f47b34d4b127720a18f86fa7b1aa2e141f29"
Expand Down
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ DistributedLoopMonitor = "019de50b-5e20-4407-86b9-f655e2d8ca95"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
FilePathsBase = "48062228-2e41-5def-b9a4-89aafe57970f"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
GlobalMacros = "4356e881-4961-4a42-bf31-d836fc29b3e6"
Gtk = "4c0ca9eb-093a-5379-98c5-f87ac0bbbf44"
IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
LambertW = "984bce1d-4616-540c-a9ee-88d1112d94c9"
Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
LsqFit = "2fda8390-95c7-5789-9bda-21331edee243"
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
Expand Down
288 changes: 288 additions & 0 deletions nb/2023-06-23__Vm_traces_AdEx_Izh.ipynb

Large diffs are not rendered by default.

371 changes: 371 additions & 0 deletions nb/2023-06-23__Vm_traces_AdEx_Izh__Brian.ipynb

Large diffs are not rendered by default.

60 changes: 41 additions & 19 deletions thesis/ch2.tex
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ \section{The AdEx neuron model}
This is a leaky-integrate-and-fire (LIF) neuron model, with two additions.
First, the full upstroke of each spike is simulated, as an exponential runoff.
Second, an extra dynamic variable is added: the adaptation current.
This current allows the simulation of many non-linear effects of real neurons, like spike-rate adaptation and post-inhibitory rebound. (Note however that we do not focus on adaptation effects in this thesis).
This current allows the simulation of many non-linear effects of real neurons, like spike-rate adaptation and post-inhibitory rebound.
% (Note however that we do not focus on adaptation effects in this thesis).

\marginpar{
\includegraphics[w=1]{exIF-fit.png}
\captionof{figure}{A linear-plus-exponential model (red) fit to a real cortical pyrimidal neuron (black), from \cite{Badel2008ExtractingNonlinearIntegrateandfire}}
\captionof{figure}{A linear-plus-exponential model (red) fit to data from a real cortical pyrimidal neuron (black), from \cite{Badel2008ExtractingNonlinearIntegrateandfire}}
\label{fig:exIF-fit}
}

Expand All @@ -29,22 +30,22 @@ \section{The AdEx neuron model}

Other parameters are explained in \cref{tab:AdEx-params}.

In this chapter, we will often analyse $C\d{V}$ as a function of $V$, i.e. analyse it as a dynamical system: will the voltage increase or decrease at the current voltage?
For conciceness, we will call this function $F(V)$. I.e. $F(V) = C \d{V} =$ the right-hand-side of \cref{eq:AdEx-V}, here. We'll mostly analyse $F$ in the absence of synaptic and adaptation currents, i.e. for $I_\syn$ and $w$ both zero.
In this chapter, we will often analyse $\d{V}$ as a function of $V$, i.e. analyse it as a dynamical system: will the voltage increase or decrease at the current voltage?
For conciceness, we will call this function $F(V)$. I.e. $F(V) = \d{V} =$ the right-hand-side of \cref{eq:AdEx-V} here, scaled by $1/ C$. We'll mostly analyse $F$ in the absence of synaptic and adaptation currents, i.e. for $I_\syn$ and $w$ both zero.
\Cref{fig:exIF-fit} shows the $F(V)$ curve for an AdEx neuron fit to a real neuron.

\begin{table}[h]
\begin{sidecaption}
{Quantities and parameters of the AdEx neuron, \cref{eq:AdEx-V,eq:AdEx-w,eq:AdEx-reset}. By defining the location of $F(V)$'s minmum, $V_T$ also determines the location of the firing threshold.}
{Quantities and parameters of the AdEx neuron, \cref{eq:AdEx-V,eq:AdEx-w,eq:AdEx-reset}. By defining the location of $\d{V}$'s minmum, $V_T$ also determines the location of the firing threshold.}
[tab:AdEx-params]
\begin{tabular}{c l l}
Name & Description & Units \\
\hline
$V$ & Membrane voltage & V \\
$g_L$ & Input / leak conductance & S (V/A) \\
$E_L$ & Resting / leak potential & V \\
$Δ_T$ & Steepness of $F$ around the firing threshold & V \\
$V_T$ & Location of minimum of $F$ & V \\
$Δ_T$ & Steepness of $\d{V}$ around the firing threshold & V \\
$V_T$ & Location of minimum of $\d{V}$ & V \\
$w$ & Adaptation current & A \\
$τ_w$ & Time constant of adaptation current & s \\
$a$ & Sensitivity of adaptation current to $V$ & S \\
Expand All @@ -61,9 +62,16 @@ \section{The AdEx neuron model}
& w ← w + Δw \notag
\end{align}

% Slowly injecting current $I$ shifts Izhikevich's parabola upwards, raising the resting potential and lowering the spiking threshold. At a certain point, the two fixed points merge and disappear ("annihilate"), in a "saddle--node"\fnm or "fold" bifurcation. The voltage can only go up -- and with the reset of \cref{eq:Izh_V_reset}, the neuron keeps spiking.

% \fnt{In the full $(V, u)$ phase plane, at $V_r$ there is a node (both eigendirections are attracting), and at $V_t$ there is a saddle (only one eigendirection attracts, the other repels). Hence, "saddle--node" bifurcation.}

% On the other hand, negative input currents or a positive adaptation current $u$ shift $\dot{V}$ downwards, giving a lower resting potential and a higher spiking threshold. This is how the model creates spike rate adaptation: every spike increases $u$ (\cref{eq:Izh_u_update}), and thus the spiking threshold.


\subsection{Analysis}

Where are the fixed points of the dynamical system $C\d{V} = F(V)$? I.e, where is $F = 0$? Like other neuron models, there are two fixed points: a stable one at the leak potential $E_L$, and an unstable one at the instantaneous firing threshold (which we'll call $E_T$).
Where are the fixed points of the dynamical system $\d{V} = F(V)$? I.e, where is $F = 0$? Like other neuron models, there are two fixed points: a stable one at the leak potential $E_L$, and an unstable one at the instantaneous firing threshold (which we'll call $E_T$).

We see in \cref{eq:AdEx-V} (for $I_\syn = 0$ and $w = 0$) that the leak potential $E_L$ is indeed a fixed point -- or rather lies very close to a fixed point: the exponential term is negligibly small at $V = E_L$.
\marginpar{
Expand Down Expand Up @@ -107,7 +115,7 @@ \section{Alternative neuron models}
A simpler model than AdEx would be the well-known LIF neuron:
\begin{align*}
C \d{V} = -g_L (V - E_L) - I_\syn \\[1em]
\text{if}\ V > θ\ \text{then:}\ V ← V_r \\
\text{if}\ V > θ,\ \text{then:}\ V ← V_r \\
\end{align*}
As is apparent from comparing this with \cref{eq:AdEx-V,eq:AdEx-reset}, the AdEx model is an extension of the LIF model. The LIF neuron lacks a simulation of the upstroke of spikes (the exponential term in \cref{eq:AdEx-V}), and the slower time-scale adaptation current (\cref{eq:AdEx-w}), which allows the simulation of many qualitatively different real neuron types.
It is especially this first addition, the full upstroke simulation, that seems relevant in generating realistic voltage traces.
Expand All @@ -134,16 +142,15 @@ \section{The Izhikevich neuron}
These are the Izhikevich equations, using the same symbols as used before (in \cref{eq:AdEx-V,eq:AdEx-w,eq:AdEx-reset}):
\begin{align}
C \d{V} &= k (V - E_L) (V - E_T) - I_\syn - w \label{eq:Izh-V} \\[1em]
τ_w \d{w} &= b (V - E_L) - w \label{eq:Izh-w} \\[2em]
τ_w \d{w} &= a (V - E_L) - w \label{eq:Izh-w} \\[2em]
\text{if}\ V& > θ,\ \text{then:} \label{eq:Izh-reset} \\
&V ← V_r \notag \\
&w ← w + Δw \notag
\end{align}

We have introduced two new parameters not present in the AdEx equations: a `steepness' parameter $k$; and $E_T$, the instantaneous firing threshold -- that is, the firing threshold in the absence of any synaptic or adaptation currents.
The only difference is in \cref{eq:Izh-V}, where the $F(V)$ curve is not made by a linear plus exponential term as in AdEx; but rather by a quadratic (a parabola). Its two zeros (the fixed points) are readily apparent, as $E_L$ and $E_T$.

Note that, in the absence of synaptic and adaptation currents, \cref{eq:Izh-V} is a quadratic function of $V$, and its two zeros, $E_L$ and $E_T$, are directly apparent.
These two zeros are respectively the stable fixed point (the resting threshold or leak potential $E_L$), and the unstable fixed point (the firing threshold $E_T$).
We have introduced two new parameters not present in the AdEx equations: the steepness of the parabola, $k$; and $E_T$, the instantaneous firing threshold (the firing threshold in the absence of any synaptic or adaptation currents).


\subsection{Correspondences with AdEx}
Expand Down Expand Up @@ -178,21 +185,21 @@ \subsection{Correspondences with AdEx}
\end{sidecaption}
\end{table}

Beside these straightforward correspondences, there are some parameters in either model that have no direct equivalent in the other: $k$ and $E_T$ in Izhikevich, and $g_L$, $Δ_T$, and $V_T$ in AdEx.
Beside these straightforward correspondences, there are some parameters in either model that have no direct equivalent in the other: $k$ and $v_t$ in Izhikevich, and $g_L$, $Δ_T$, and $V_T$ in AdEx.
For those, we'll look at the shape of Izhikevich's $F(V)$, as we've done for the AdEx neuron before.

First, the AdEx parameter $g_L$. This is the input conductance, a.k.a. the leak conductance, a.k.a. the slope of $F(V)$ around the leak potential. We can find this same conductance for the Izhikevich neuron too, by taking the derivative with respect to $V$ of the right hand side of \cref{eq:Izh-V}, at $w = 0$, $I_\syn = 0$, and $V = E_L$. We find:
First, the AdEx parameter $g_L$. This is the input conductance, a.k.a. the leak conductance, and the slope of $F(V)$ around the leak potential. We can find this same conductance for the Izhikevich neuron by taking the derivative with respect to $v$ of the right hand side of \cref{eq:IzhIzh-v}, at $w = 0$, $I_\syn = 0$, and $v = v_r$. We find:
\begin{equation}
\dd{V}(k(V-E_L)(V-E_T)) \Big|_{V=E_L} = k(E_L - E_T)
\dd{v}(k(v-v_r)(v-v_t)) \Big|_{v=v_r} = k(v_r - v_t)
\end{equation}
(this value is negative: the leak potential is a stable fixed point. This corresponds to \cref{eq:AdEx-V}, where we find `$-g_L$').
Thus, our first nontrivial correspondence:
\begin{equation}
g_L = k (E_T - E_L) \label{eq:leak_conductance}
g_L = k (v_t - v_r) \label{eq:leak_conductance}
\end{equation}

We've seen that $V_T$ is the minimum of AdEx's $F$.
The minimum of Izhikevich's $F$ is easily found as the average of the parabola's two zeros. I.e, $V_T$ corresponds to $(E_L + E_T) / 2$.
The minimum of Izhikevich's $F$ is easily found as the average of the parabola's two zeros. I.e, $V_T$ corresponds to $(v_r + v_t) / 2$.

Finally, $Δ_T$ co-determines the slope of AdEx's $F$ at the firing threshold (\cref{eq:AdEx-slope}). Given that Izhikevich's $F$ is a parabola, with slopes equal in magnitude at both roots, we already know the firing threshold slope: it is the same as the leak conductance, \cref{eq:leak_conductance}.\\
Here, the AdEx model is more expressive than Izhikevich's: the slope of $\d{V}$ at the firing threshold can be independently tweaked from the leak conductance; in Izhikevich these two are clung together by the form of the quadratic equation.
Expand All @@ -203,9 +210,24 @@ \subsection{Comparison with AdEx}
The Izhikevich and AdEx models are very similar. Their phase spaces are topologically identical:
the adaptive current equation is identical (up to a renaming of the variables); and the $F(V)$-graph has the same shape, with two fixed points: a stable fixed point at the resting potential, and an unstable one at the firing threshold (\cref{fig:dynsys}).

They differ in the exact shape: Izhikevich's $F(V)$ is a parabola, while AdEx is the more realistic 'linear subthreshold, and then transitioning to an exponential'. [ref bio fig]
They differ in the exact shape: Izhikevich's $F(V)$ is a parabola, while AdEx is the more realistic 'linear subthreshold, and then transitioning to an exponential' (see \cref{fig:exIF-fit,fig:dynsys}).
As a result, Izhikevich neurons have an unrealistically slow spike upstroke.

\begin{figure}
\hspace*{10em}
\includegraphics[w=1.5]{testbench-I-Izh-EIF.png}
\caption{The nonlinear response of Izhikevich neurons to subthreshold input currents. `EIF' stands for exponential integrate-and-fire; it has the same $\d{V}$ as an AdEx neuron. Adaptation currents are negligibly small for both models in this test scenario.
% Izhikevich parameters from \cite{Izhikevich2007DynamicalSystemsNeuroscience,Humphries2006UnderstandingUsingIzhikevich}, for a Cortical Regular Spiking neuron.
% EIF parameters chosen to match: $C = 100$ pF, $E_L = -60$ mV, $R = 80\, \si{\mega\ohm}$.
}
\label{fig:testbench-I-Izh-EIF}
\end{figure}

A second issue is Izhikevich's subthreshold nonlinearity. The effects of this can be seen in \cref{fig:testbench-I-Izh-EIF}. Positive input currents produce stronger responses than equally large negative input currents. This is explained by the quadratic $\d{V}$ shape: positive deviations are attenuated less, and negative deviations more, than a linear neuron would. Real and AdEx neurons do not suffer this assymetry.

This nonlinearity is not visible for small voltage deviations, which is what the postsynaptic potentials we are interested in in this thesis tend to be. There is however an effect of the neuron's average voltage: if this voltage is constantly on the higher side, then inputs -- both negative and positive -- will cause larger responses than if the median voltage was lower.



\clearpage
\section{Synapse model}
Expand Down
Binary file added thesis/figs/testbench-I-Izh-EIF.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified thesis/main.pdf
Binary file not shown.
18 changes: 18 additions & 0 deletions thesis/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ @article{Badel2008ExtractingNonlinearIntegrateandfire
langid = {english}
}

@article{Brette2005AdaptiveExponentialIntegrateandFirea,
title = {Adaptive {{Exponential Integrate-and-Fire Model}} as an {{Effective Description}} of {{Neuronal Activity}}},
author = {Brette, Romain and Gerstner, Wulfram},
date = {2005-11},
journaltitle = {Journal of Neurophysiology},
publisher = {{American Physiological Society}},
doi = {10.1152/jn.00686.2005},
url = {https://journals.physiology.org/doi/full/10.1152/jn.00686.2005}
}

@book{Dayan2001TheoreticalNeuroscienceComputational,
title = {Theoretical Neuroscience: Computational and Mathematical Modeling of Neural Systems},
shorttitle = {Theoretical Neuroscience},
Expand All @@ -31,6 +41,14 @@ @article{Gerstner2009AdaptiveExponentialIntegrateandfire
langid = {english}
}

@report{Humphries2006UnderstandingUsingIzhikevich,
title = {Understanding and Using {{Izhikevich}}’s Simple Model Neuron},
author = {Humphries, Mark D.},
date = {2006-06-22},
location = {{Unpublished}},
annotation = {Received via email from Mark}
}

@book{Izhikevich2007DynamicalSystemsNeuroscience,
title = {Dynamical {{Systems}} in {{Neuroscience}}: {{The Geometry}} of {{Excitability}} and {{Bursting}}},
shorttitle = {Dynamical {{Systems}} in {{Neuroscience}}},
Expand Down

0 comments on commit c43b159

Please sign in to comment.