diff --git a/tikz/artificial-neuron/Makefile b/tikz/artificial-neuron/Makefile new file mode 100644 index 0000000..eaac3ae --- /dev/null +++ b/tikz/artificial-neuron/Makefile @@ -0,0 +1,35 @@ +SOURCE = artificial-neuron +DELAY = 80 +DENSITY = 300 +WIDTH = 512 + +make: + pdflatex $(SOURCE).tex -output-format=pdf + make clean + +clean: + rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot + +gif: + pdfcrop $(SOURCE).pdf + convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif + make clean + +png: + make + make svg + inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png + +transparentGif: + convert $(SOURCE).pdf -transparent white result.gif + make clean + +svg: + make + #inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg + pdf2svg $(SOURCE).pdf $(SOURCE).svg + # Necessary, as pdf2svg does not always create valid svgs: + inkscape $(SOURCE).svg --export-plain-svg=$(SOURCE).svg + rsvg-convert -a -w $(WIDTH) -f svg $(SOURCE).svg -o $(SOURCE)2.svg + inkscape $(SOURCE)2.svg --export-plain-svg=$(SOURCE).svg + rm $(SOURCE)2.svg diff --git a/tikz/artificial-neuron/Readme.md b/tikz/artificial-neuron/Readme.md new file mode 100644 index 0000000..595e3db --- /dev/null +++ b/tikz/artificial-neuron/Readme.md @@ -0,0 +1,3 @@ +Compiled example +---------------- +![Example](artificial-neuron.png) diff --git a/tikz/artificial-neuron/artificial-neuron.png b/tikz/artificial-neuron/artificial-neuron.png new file mode 100644 index 0000000..7dcb58a Binary files /dev/null and b/tikz/artificial-neuron/artificial-neuron.png differ diff --git a/tikz/artificial-neuron/artificial-neuron.tex b/tikz/artificial-neuron/artificial-neuron.tex new file mode 100644 index 0000000..f7c4041 --- /dev/null +++ b/tikz/artificial-neuron/artificial-neuron.tex @@ -0,0 +1,32 @@ +\documentclass{article} +\usepackage[pdftex,active,tightpage]{preview} +\setlength\PreviewBorder{2mm} + +\usepackage{amsmath} +\usepackage{tikz} +\usetikzlibrary{shapes, calc, shapes, arrows} + +\tikzstyle{inputNode}=[draw,circle,minimum size=10pt,inner sep=0pt] +\tikzstyle{stateTransition}=[->, thick] +\begin{document} +\begin{preview} +\begin{tikzpicture} + \node[draw,circle,minimum size=25pt,inner sep=0pt] (x) at (0,0) {$\Sigma$ $\varphi$}; + + \node[inputNode] (x0) at (-2, 1.5) {$\tiny x_0$}; + \node[inputNode] (x1) at (-2, 0.75) {$\tiny x_1$}; + \node[inputNode] (x2) at (-2, 0) {$\tiny x_2$}; + \node[inputNode] (x3) at (-2, -0.75) {$\tiny x_3$}; + \node[inputNode] (xn) at (-2, -1.75) {$\tiny x_n$}; + + \draw[stateTransition] (x0) to[out=0,in=120] node [midway, sloped, above=-2] {$w_0$} (x); + \draw[stateTransition] (x1) to[out=0,in=150] node [midway, sloped, above=-2] {$w_1$} (x); + \draw[stateTransition] (x2) to[out=0,in=180] node [midway, sloped, above=-2] {$w_2$} (x); + \draw[stateTransition] (x3) to[out=0,in=210] node [midway, sloped, above=-2] {$w_3$} (x); + \draw[stateTransition] (xn) to[out=0,in=240] node [midway, sloped, above=-2] {$w_n$} (x); + \draw[stateTransition] (x) -- (2,0) node [midway,above=-0.1cm] {}; + \draw[dashed] (0,-0.43) -- (0,0.43); + \node (dots) at (-2, -1.15) {$\vdots$}; +\end{tikzpicture} +\end{preview} +\end{document}