Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converted NEST by example to Jupyter notebook and updated for 2.12. #602

Merged
merged 15 commits into from
Jan 17, 2017
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
191 changes: 191 additions & 0 deletions doc/nest_by_example/latex_template.tplx
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
((*- extends 'article.tplx' -*))

((* set cell_style = 'style_python.tplx' *))

((* block header *))
((( super() )))
\usepackage{multicol}
\usepackage{tabularx}
\usepackage{multirow}
\usepackage{colortbl}
\usepackage{authblk}

\newcommand{\hdr}[2]{%
\textbf{\makebox[0pt]{\hspace{5mm}#1}\hspace{0.5\linewidth}\makebox[0pt][c]{#2}}%
}
\author[1]{Marc-Oliver Gewaltig}
\author[2]{Abigail Morrison}
\author[3, 2]{Hans Ekkehard Plesser}
\affil[1]{Blue Brain Project, Ecole Polytechnique Federale de
Lausanne, QI-J, Lausanne 1015, Switzerland}
\affil[2]{Institute of Neuroscience and Medicine (INM-6)
Functional Neural Circuits Group, J\"ulich Research Center, 52425
J\"ulich, Germany}
\affil[3]{Dept of Mathematical Sciences and Technology,
Norwegian University of Life Sciences, PO Box 5003, 1432 Aas,
Norway}
\date{}
((* endblock header *))


((* block abstract *))
\abstract{The neural simulation tool NEST can simulate small to very
large networks of point-neurons or neurons with a few
compartments. In this chapter, we show by example how models are
programmed and simulated in NEST.

This document is based on a preprint version of
\cite{Gewa:2012(533)} and has been updated for NEST 2.12.

\begin{description}
\item[Updated to 2.12.0] Håkon\ Mørk, December 2016
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could add here "Converted to Jupyter Notebook and updated ..."

\item[Edited] Sacha J.\ van Albada, May 2015
\item[Updated to 2.6.0] Hans E.\ Plesser, December 2014
\item[Updated to 2.4.0] Hans E.\ Plesser, June 2014
\item[Updated to 2.2.2] Hans E.\ Plesser \& Marc-Oliver Gewaltig,
December 2012
\end{description}
}
((* endblock abstract *))

((* block markdowncell *))

((*- if not cell.metadata.get('table', {}) and not cell.metadata.get('bib', {})-*))
((( super() )))
((*- endif -*))
((*- if cell.metadata.get('table', {}) -*))

\begin{table}[!htp]
\noindent
\caption{Summary of the network model.}
\begin{tabularx}{0.95\linewidth}{|l|X|}\hline
%
\multicolumn{2}{|l|}{\color{white}\cellcolor[gray]{0.0}\hdr{A}{Model Summary}}\\\hline
\textbf{Populations} & Three: excitatory, inhibitory, external input \\\hline
\textbf{Topology} & --- \\\hline
\textbf{Connectivity} & Random convergent connections with probability
$P=0.1$ and fixed in-degree of $C_E=P N_E$ and $C_I=P N_I$.
\\\hline
{\textbf{Neuron model}} & Leaky integrate-and-fire, fixed voltage
threshold, fixed absolute refractory time (voltage clamp) \\\hline
\textbf{Channel models} & --- \\\hline
\textbf{Synapse model} & $\delta$-current inputs (discontinuous
voltage jumps) \\\hline
\textbf{Plasticity} & ---\\\hline
\textbf{Input} & Independent fixed-rate Poisson spike trains to all
neurons \\\hline
\textbf{Measurements} & Spike activity \\\hline
\end{tabularx}

\vspace{2ex}

\noindent\begin{tabularx}{0.95\linewidth}{|l|l|X|}\hline
\multicolumn{3}{|l|}{\color{white}\cellcolor[gray]{0.0}\hdr{B}{Populations}}\\\hline
\textbf{Name} & \textbf{Elements} & \textbf{Size} \\\hline
E & Iaf neuron & $N_{\text{E}} = 4N_{\text{I}}$ \\\hline
I & Iaf neuron & $N_{\text{I}}$ \\\hline
E$_{\text{ext}}$ & Poisson generator & $1$ \\\hline
\end{tabularx}

\vspace{2ex}

\noindent\begin{tabularx}{0.95\linewidth}{|l|l|l|X|}\hline
\multicolumn{4}{|l|}{\color{white}\cellcolor[gray]{0.0}\hdr{C}{Connectivity}}\\\hline
\textbf{Name} & \textbf{Source} & \textbf{Target} & \textbf{Pattern} \\\hline
EE & E & E &
Random convergent $C_{\text{E}}\rightarrow 1$, weight $J$, delay $D$ \\\hline
IE & E & I &
Random convergent $C_{\text{E}}\rightarrow 1$, weight $J$, delay $D$ \\\hline
EI & I & E &
Random convergent $C_{\text{I}}\rightarrow 1$, weight $-gJ$, delay $D$ \\\hline
II & I & I &
Random convergent $C_{\text{I}}\rightarrow 1$, weight $-gJ$, delay $D$ \\\hline
Ext& E$_{\text{ext}}$ & E $\cup$ I &
Divergent $1 \rightarrow N_{\text{E}} + N_{\text{I}}$, weight $J$, delay $D$ \\\hline
\end{tabularx}

\vspace{2ex}

\noindent\begin{tabularx}{0.95\linewidth}{|l|X|}\hline
\multicolumn{2}{|l|}{\color{white}\cellcolor[gray]{0.0}\hdr{D}{Neuron and Synapse Model}}\\\hline
\textbf{Name} & Iaf neuron \\\hline
\textbf{Type} & Leaky integrate-and-fire, $\delta$-current input\\\hline
\raisebox{-4.5ex}{\parbox{5em}{\textbf{Sub\-threshold dynamics}}} &
\rule{1em}{0em}\vspace*{-3.5ex}
\begin{equation*}
\begin{array}{r@{\;=\;}ll}
\tau_m \dot{V_m}(t) & -V_m(t) + R_m I(t) &\text{if not refractory}\; (t > t^*+\tau_{\text{rp}}) \\[1ex]
V_m(t) & V_{\text{r}} & \text{while refractory}\; (t^*<t\leq t^*+\tau_{\text{rp}}) \\[2ex]
I(t) & \multicolumn{2}{l}{\frac{\tau_m}{R_m} \sum_{\tilde{t}} w
\delta(t-(\tilde{t}+D))}
\end{array}
\end{equation*}
\vspace*{-2.5ex}\rule{1em}{0em}
\\\hline
\multirow{3}{*}{\textbf{Spiking}} &
If $V_m(t-)<V_{\theta} \wedge V_m(t+)\geq V_{\theta}$
\vspace*{-1ex}
\begin{enumerate}\setlength{\itemsep}{-0.5ex}
\item set $t^* = t$
\item emit spike with time-stamp $t^*$
\end{enumerate}
\vspace*{-4ex}\rule{1em}{0em}
\\\hline
\end{tabularx}

\vspace{2ex}

\noindent\begin{tabularx}{0.95\linewidth}{|l|X|}\hline
\multicolumn{2}{|l|}{\color{white}\cellcolor[gray]{0.0}\hdr{E}{Input}}\\\hline
\textbf{Type} & \textbf{Description} \\\hline
{Poisson generator} & Fixed rate $\nu_{\text{ext}} \cdot C_{\text{E}}$,
one generator providing independent input to each target neuron\\\hline
\end{tabularx}

\vspace{2ex}

\noindent\begin{tabularx}{0.95\linewidth}{|X|}\hline
\multicolumn{1}{|l|}{\color{white}\cellcolor[gray]{0.0}\hdr{F}{Measurements}}\\\hline
Spike activity as raster plots, rates and ``global frequencies'', no
details given \\\hline
\end{tabularx}
\end{table}
\begin{table}[!htp]
\noindent
\caption{\label{nest:tab:Brunelparams} Summary of the network
parameters for the model.}
\begin{tabularx}{0.95\linewidth}{Xr}
%
\multicolumn{2}{|l|}{\color{white}\cellcolor[gray]{0.0}\hdr{G}{Network
Parameters}}\\
\textbf{Parameter} & \textbf{Value}\\\hline
Number of excitatory neurons $N_E$ & 8000 \\
Number of inhibitory neurons $N_I$ & 2000\\
Excitatory synapses per neuron $C_E$ & 800 \\
Inhibitory synapses per neuron $C_I$ & 200 \\
\hline
\end{tabularx}
\begin{tabularx}{0.95\linewidth}{Xr}
\multicolumn{2}{|l|}{\color{white}\cellcolor[gray]{0.0}\hdr{H}{Neuron
Parameters}}\\
\textbf{Parameter} & \textbf{Value}\\\hline
Membrane time constant $\tau_m$ & 20 ms\\
Refractory period $\tau_{\text{rp}}$ & 2 ms\\
Firing threshold $V_{\text{th}}$ & 20 mV\\
Membrane capacitance $C_m$ & 1 pF\\
Resting potential $V_E$ & 0 mV\\
Reset potential $V_{\text{reset}}$ & 10 mV\\
Excitatory PSP amplitude $J_E$ & 0.1 mV\\
Inhibitory PSP amplitude $J_I$ & $-0.5$ mV\\
Synaptic delay $D$ & 1.5 ms \\
Background rate $\eta$ & 2.0 \\
\hline
\end{tabularx}
\end{table}
((*- endif -*))
((* endblock markdowncell *))

((* block bibliography *))
\bibliography{NEST_by_Example}
\bibliographystyle{apalike}
((* endblock bibliography *))