mirror of
https://github.com/MartinThoma/LaTeX-examples.git
synced 2025-04-19 11:38:05 +02:00
Added feed forward perceptron
This commit is contained in:
parent
385254300a
commit
0ef1a9e285
4 changed files with 79 additions and 0 deletions
35
tikz/feed-forward-perceptron/Makefile
Normal file
35
tikz/feed-forward-perceptron/Makefile
Normal file
|
@ -0,0 +1,35 @@
|
|||
SOURCE = feed-forward-perceptron
|
||||
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
|
3
tikz/feed-forward-perceptron/Readme.md
Normal file
3
tikz/feed-forward-perceptron/Readme.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
Compiled example
|
||||
----------------
|
||||

|
BIN
tikz/feed-forward-perceptron/feed-forward-perceptron.png
Normal file
BIN
tikz/feed-forward-perceptron/feed-forward-perceptron.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
41
tikz/feed-forward-perceptron/feed-forward-perceptron.tex
Normal file
41
tikz/feed-forward-perceptron/feed-forward-perceptron.tex
Normal file
|
@ -0,0 +1,41 @@
|
|||
\documentclass{article}
|
||||
\usepackage[pdftex,active,tightpage]{preview}
|
||||
\setlength\PreviewBorder{2mm}
|
||||
|
||||
\usepackage{tikz}
|
||||
\usetikzlibrary{arrows}
|
||||
|
||||
\tikzstyle{input}=[draw,fill=red!50,circle,minimum size=10pt,inner sep=0pt]
|
||||
\tikzstyle{hidden}=[draw,fill=green!50,circle,minimum size=10pt,inner sep=0pt]
|
||||
\tikzstyle{output}=[draw,fill=blue!50,circle,minimum size=10pt,inner sep=0pt]
|
||||
\tikzstyle{bias}=[draw,dashed,fill=gray!50,circle,minimum size=10pt,inner sep=0pt]
|
||||
|
||||
\begin{document}
|
||||
\begin{preview}
|
||||
\begin{tikzpicture}
|
||||
\node (b1)[bias] at (-1,0) {};
|
||||
\node (b2)[bias] at (-0.5,1) {};
|
||||
\node (i1)[input] at (0,0) {};
|
||||
\node (i2)[input] at (1,0) {};
|
||||
\node (i3)[input] at (2,0) {};
|
||||
\node (i4)[input] at (3,0) {};
|
||||
\node (i5)[input] at (4,0) {};
|
||||
\node (h1)[hidden] at (0.5,1) {};
|
||||
\node (h2)[hidden] at (1.5,1) {};
|
||||
\node (h3)[hidden] at (2.5,1) {};
|
||||
\node (o1)[output] at (1.5,2) {};
|
||||
|
||||
\draw (b2) -- (o1);
|
||||
\draw (h1) -- (o1);
|
||||
\draw (h2) -- (o1);
|
||||
\draw (h3) -- (o1);
|
||||
|
||||
\foreach \j in {1, ..., 3}{
|
||||
\foreach \i in {1, ..., 5}{
|
||||
\draw (h\j) -- (i\i);
|
||||
}
|
||||
\draw (h\j) -- (b1);
|
||||
}
|
||||
\end{tikzpicture}
|
||||
\end{preview}
|
||||
\end{document}
|
Loading…
Add table
Add a link
Reference in a new issue