perceptron-unit.tex 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. \documentclass{article}
  2. \usepackage[pdftex,active,tightpage]{preview}
  3. \setlength\PreviewBorder{2mm}
  4. \usepackage{tikz}
  5. \usetikzlibrary{arrows,shapes}
  6. \tikzstyle{inputNode}=[draw,circle,minimum size=10pt,inner sep=0pt,fill=red!50]
  7. \tikzstyle{stateTransition}=[->, thick]
  8. \tikzstyle{hidden}=[draw,circle,minimum size=25pt,inner sep=0pt,fill=green!50]
  9. \tikzstyle{output}=[draw,fill=blue!50,circle,minimum size=10pt,inner sep=0pt]
  10. \begin{document}
  11. \begin{preview}
  12. \begin{tikzpicture}
  13. \node[hidden] (x) at (0,0) {$\Sigma$ $\varphi$};
  14. \node[inputNode] (x0) at (-2, 1.5) {$\tiny x_0$};
  15. \node[inputNode] (x1) at (-2, 0.75) {$\tiny x_1$};
  16. \node[inputNode] (x2) at (-2, 0) {$\tiny x_2$};
  17. \node[inputNode] (x3) at (-2, -0.75) {$\tiny x_3$};
  18. \node[inputNode] (xn) at (-2, -1.75) {$\tiny x_n$};
  19. \node (dots) at (-2, -1.15) {$\vdots$};
  20. \draw[stateTransition] (x0) to[out=0,in=120] node [midway, sloped, above=-2] {$w_0$} (x);
  21. \draw[stateTransition] (x1) to[out=0,in=150] node [midway, sloped, above=-2] {$w_1$} (x);
  22. \draw[stateTransition] (x2) to[out=0,in=180] node [midway, sloped, above=-2] {$w_2$} (x);
  23. \draw[stateTransition] (x3) to[out=0,in=210] node [midway, sloped, above=-2] {$w_3$} (x);
  24. \draw[stateTransition] (xn) to[out=0,in=240] node [midway, sloped, above=-2] {$w_n$} (x);
  25. \draw[stateTransition] (x) -- (1.5,0) node[right] {$o$};
  26. \draw[dashed] (0,-0.43) -- (0,0.43);
  27. \end{tikzpicture}
  28. \end{preview}
  29. \end{document}