This commit is contained in:
Robin Clark 2010-11-30 18:19:37 +00:00
parent 5e9e0bdc65
commit 39fb997879

View File

@ -1,16 +1,7 @@
\documentclass{article}
\usepackage{tikz}
\usepackage{verbatim}
\begin{comment}
:Title: Neural network
:Tags: Foreach
The ``\foreach`` command is very useful for quickly creating structured graphics
like this neural network diagram.
\end{comment}
\begin{document}
\pagestyle{empty}
@ -44,9 +35,10 @@ like this neural network diagram.
% \path[yshift=0.5cm]
\node[failure] (C-1a) at (\layersep,-1) {a};
\node[failure] (C-1b) at (\layersep,-2) {b};
\node[failure] (C-2a) at (\layersep,-3) {a};
\node[failure] (C-2b) at (\layersep,-4) {b};
% Draw the output layer node
\node[symptom,pin={[pin edge={->}]right:Output}, right of=C-1a] (O) {};
% Connect every node in the input layer with every node in the
% hidden layer.
@ -54,18 +46,40 @@ like this neural network diagram.
% \foreach \dest in {1,...,5}
\path (C-1) edge (C-1a);
\path (C-1) edge (C-1b);
\path (C-2) edge (C-2a);
\path (C-2) edge (C-2b);
%\node[symptom,pin={[pin edge={->}]right:Output}, right of=C-1a] (O) {};
\node[symptom, right of=C-1a] (s1) {s1};
\node[symptom, right of=C-2a] (s2) {s2};
\path (C-2b) edge (s1);
\path (C-1a) edge (s1);
\path (C-2a) edge (s2);
\path (C-1b) edge (s2);
\node[component, right of=s1] (DC) {$C^1_1$};
\path (s1) edge (DC);
\path (s2) edge (DC);
% Connect every node in the hidden layer with the output layer
%\foreach \source in {1,...,5}
% \path (H-\source) edge (O);
% Annotate the layers
\node[annot,above of=C-1a, node distance=1cm] (hl) {Hidden layer};
\node[annot,left of=hl] {Input layer};
\node[annot,right of=hl] {Output layer};
\node[annot,above of=C-1a, node distance=1cm] (hl) {Failure modes};
\node[annot,left of=hl] {Base Components};
\node[annot,right of=hl](s) {Symptoms};
\node[annot,right of=s](dcl) {Derived Component};
\end{tikzpicture}
% End of code
\caption{bollocks}
\caption{DAG representing failure modes and symptoms $FG^0_1 \rightarrow DC^1_1$}
\end{figure}
\end{document}