Debian Codegraph @

texmf-dist/doc/latex/tikz-nef/tikz-nef-doc.tex

raw
1 \documentclass{ltxdoc}
2
3 \usepackage{fontspec}
4
5 \GetFileInfo{tikzlibrarynef.code.tex}
6
7 \title{The \textsf{nef} TikZ library\thanks{This document corresponds to \textsf{tikz-nef}~\fileversion, dated~\filedate.}}
8 \author{Jan Gosmann \\ \texttt{[email protected]}}
9
10 \usepackage[backend=biber]{biblatex}
11 \usepackage{tikz}
12 \usetikzlibrary{graphs}
13 \usetikzlibrary{nef}
14 \usetikzlibrary{quotes}
15
16 \addbibresource{nef.bib}
17
18 \newcommand{\nef}{\emph{nef}}
19
20 \begin{document}
21 \maketitle
22 \begin{abstract}
23 The \nef\ TikZ library provides predefined styles and shapes to create diagrams for neural networks constructed with the methods of the Neural Engineering Framework (NEF)~\cite{eliasmith2003}.
24 \end{abstract}
25 \tableofcontents
26
27 \section{Usage}
28
29 To use the \nef\ TikZ library load the \emph{tikz} package and the library with:
30 \begin{verbatim}
31 \usepackage{tikz}
32 \usetikzlibrary{nef}
33 \end{verbatim}
34
35 \subsection{Global styles}
36 \paragraph{nef}
37 This style provides basic general settings like minimum node sizes and arrow tips for the diagrams. It also sets some layout options on for graphs. The style can be applied to the \texttt{tikzpicture} environment or to more narrow scopes.
38
39 \subsection{Node styles and shapes}
40 \begin{figure}
41 \centering
42 \begin{tikzpicture}
43 \matrix [row sep=4pt, column sep=4pt] {
44 \node {Style/shape}; & & \node [right] {Usage}; \\
45 \node {\texttt{ea}}; & \node [nef,ea] {}; & \node [right] {ensemble array}; \\
46 \node {\texttt{ens}}; & \node [nef,ens] {ens}; & \node [right] {ensemble}; \\
47 \node {\texttt{ext}}; & \node [nef,ext] {ext}; & \node [right] {external inputs and outputs}; \\
48 \node {\texttt{net}}; & \node [nef,net] {net}; & \node [right] {network}; \\
49 \node {\texttt{pnode}}; & \node [nef,pnode] {}; & \node [right] {pass-through node}; \\
50 \node {\texttt{rect}}; & \node [nef,rect] {}; & \node [right] {rectification ensemble}; \\
51 };
52 \end{tikzpicture}
53 \caption{Node styles and shapes.}
54 \end{figure}
55
56 \paragraph{ea}
57 Use this style for ensemble arrays.
58
59 \paragraph{ens}
60 Use this style for single ensembles.
61
62 \paragraph{ext}
63 Use this style for inputs and outputs external to the displayed network.
64
65 \paragraph{net}
66 Use this style for networks.
67
68 \paragraph{pnode}
69 Use this style for pass-through nodes.
70
71 \paragraph{rect}
72 Use this style for rectification ensembles (i.e., all encoders are 1).
73
74 \subsection{Edge styles}
75 \begin{figure}
76 \centering
77 \begin{tikzpicture}
78 \matrix [row sep=4pt, column sep=4pt] {
79 \node {Style}; & & \node [right] {Usage}; \\
80 \node {\texttt{inhibit}}; & \draw (-10pt, 0) -- (10pt, 0) [inhibit]; & \node [right] {inhibitory connection}; \\
81 \node {\texttt{modulatory}}; & \draw (-10pt, 0) -- (10pt, 0) [modulatory]; & \node [right] {modulatory connection}; \\
82 \node {\texttt{recurrent}}; & \node (ens) [nef,ens] {}; \path [nef] (ens) edge [nef,recurrent] (ens) ; & \node [right] {recurrent connection}; \\
83 };
84 \end{tikzpicture}
85 \caption{Edge styles.}
86 \end{figure}
87
88 \paragraph{inhibit}
89 Use this style for inhibitory connections.
90
91 \paragraph{modulatory}
92 Use this style for modulatory connections.
93
94 \paragraph{recurrent}
95 Use this style for recurrent connections. It will add a loop above an ensemble or network.
96
97
98
99 \section{Examples}
100
101 \subsection{Gated difference integrator (working memory)}
102 \begin{center}
103 \begin{tikzpicture}[nef]
104 \graph {
105 input [ext] -> gate [ens] -> integrator/$x$ [ens] -> output [ext];
106 integrator -> [bend right, "$-1$"] gate;
107 integrator -> [recurrent] integrator;
108 store -> [inhibit] gate;
109 };
110 \end{tikzpicture}
111 \end{center}
112
113 \begin{verbatim}
114 \usepackage{tikz}
115 \usetikzlibrary{graphs}
116 \usetikzlibrary{nef}
117 \usetikzlibrary{quotes}
118
119 %% ....
120
121 \begin{tikzpicture}[nef]
122 \graph {
123 input [ext] -> gate [ens] -> integrator/$x$ [ens] -> output [ext];
124 integrator -> [bend right, "$-1$"] gate;
125 integrator -> [recurrent] integrator;
126 store -> [inhibit] gate;
127 };
128 \end{tikzpicture}
129 \end{verbatim}
130
131
132 \printbibliography{}
133 \end{document}