2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-19 11:38:05 +02:00

Add baseline model

This commit is contained in:
Martin Thoma 2017-04-18 15:25:31 +02:00
parent 78621f234c
commit ca4080c520
5 changed files with 115 additions and 0 deletions

View file

@ -0,0 +1,35 @@
SOURCE = baselineMain
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

View file

@ -0,0 +1,3 @@
Compiled example
----------------
![Example](vgg-16.png)

View file

@ -0,0 +1,64 @@
\newcommand{\width}{0.2}
\newcommand{\height}{0.4}
\newcommand{\disty}{0.2}
\definecolor{colorbblue}{HTML}{0072B2}
\definecolor{colorbgreen}{HTML}{009E73}
\definecolor{colorborange}{HTML}{D55E00}
\tikzstyle{input}=[draw,fill=red!50]
\tikzstyle{conv}=[draw,fill=black!20]
\tikzstyle{max}=[draw,dashed,fill=black!10]
\tikzstyle{dropout}=[draw,dashed,fill=colorbgreen!30]
\tikzstyle{fc}=[draw,fill=green!10]
\tikzstyle{output}=[draw,fill=red!50]
\tikzstyle{act}=[draw,dashed,fill=colorbblue!30]
\def \coldist {2.3}
\def \widthb {1.9}
\begin{tikzpicture}[scale=2]
\draw[->, -Latex, line width=5pt]
(1.0+0*\coldist, 0.5) --(1.0+0*\coldist, -4*\disty-5*\height-0.3) --(2.1+0*\coldist, -4*\disty-5*\height-0.3) --(2.2+0*\coldist, 0.5)
-- (1.0+1*\coldist, 0.5) --(1.0+1*\coldist, -4*\disty-5*\height-0.3) --(2.1+1*\coldist, -4*\disty-5*\height-0.3) --(2.2+1*\coldist, 0.5)
-- (1.0+2*\coldist, 0.5) --(1.0+2*\coldist, -2*\disty-3*\height-0.3) --(2.1+2*\coldist, -2*\disty-3*\height-0.3) --(2.2+2*\coldist, 0.5)
-- (1.0+3*\coldist, 0.5) --(1.0+3*\coldist, -3*\disty-4*\height-0.3) --(2.1+3*\coldist, -3*\disty-4*\height-0.3) --(2.2+3*\coldist, 0.5)
-- (1.0+4*\coldist, 0.5) --(1.0+4*\coldist, -5*\disty-6*\height-0.6);% --(2.1+4*\coldist, -4.3) --(2.2+4*\coldist, 0.5)
% -- (1.0+5*\coldist, 0.5) --(1.0+5*\coldist, -4.5);
\draw[draw=none] (0*\coldist,-1*\height) rectangle (1.0,-1*\disty-1*\height) node[pos=.5] {$32 \times 32$};
\draw[input] (0*\coldist,-0*\height-0*\disty) rectangle (2.0,-0*\disty-1*\height) node[pos=.5] {Input};
\draw[conv] (0*\coldist,-1*\height-1*\disty) rectangle (2.0,-1*\disty-2*\height) node[pos=.5] {C $32@3 \times 3 / 1$};
\draw[act] (0*\coldist,-2*\height-2*\disty) rectangle (2.0,-2*\disty-3*\height) node[pos=.5] {BN + ELU};
\draw[conv] (0*\coldist,-3*\height-3*\disty) rectangle (2.0,-3*\disty-4*\height) node[pos=.5] {C $32@3 \times 3 / 1$};
\draw[act] (0*\coldist,-4*\height-4*\disty) rectangle (2.0,-4*\disty-5*\height) node[pos=.5] {BN + ELU};
% 16x16
\draw[draw=none] (1*\coldist,-1*\height) rectangle (1*\coldist+\widthb/2,-1*\disty-1*\height) node[pos=.5] {$16 \times 16$};
\draw[max] (1*\coldist,-0*\height-0*\disty) rectangle (1*\coldist+\widthb,-0*\disty-1*\height) node[pos=.5] {max pooling $2\times 2 / 1$};
\draw[conv] (1*\coldist,-1*\height-1*\disty) rectangle (1*\coldist+\widthb,-1*\disty-2*\height) node[pos=.5] {C $64@3 \times 3 / 1$};
\draw[act] (1*\coldist,-2*\height-2*\disty) rectangle (1*\coldist+\widthb,-2*\disty-3*\height) node[pos=.5] {BN + ELU};
\draw[conv] (1*\coldist,-3*\height-3*\disty) rectangle (1*\coldist+\widthb,-3*\disty-4*\height) node[pos=.5] {C $64@3 \times 3 / 1$};
\draw[act] (1*\coldist,-4*\height-4*\disty) rectangle (1*\coldist+\widthb,-4*\disty-5*\height) node[pos=.5] {BN + ELU};
% 8x8
\draw[draw=none] (2*\coldist,-1*\height) rectangle (2*\coldist+\widthb/2,-1*\disty-1*\height) node[pos=.5] {$8 \times 8$};
\draw[max] (2*\coldist,-0*\height-0*\disty) rectangle (2*\coldist+\widthb,-0*\disty-1*\height) node[pos=.5] {max pooling $2\times 2 / 1$};
\draw[conv] (2*\coldist,-1*\height-1*\disty) rectangle (2*\coldist+\widthb,-1*\disty-2*\height) node[pos=.5] {C $64@3 \times 3 / 1$};
\draw[act] (2*\coldist,-2*\height-2*\disty) rectangle (2*\coldist+\widthb,-2*\disty-3*\height) node[pos=.5] {BN + ELU};
% 4x4
\draw[draw=none] (3*\coldist,-1*\height) rectangle (3*\coldist+\widthb/2,-1*\disty-1*\height) node[pos=.5] {$4 \times 4$};
\draw[max] (3*\coldist,-0*\height-0*\disty) rectangle (3*\coldist+\widthb,-0*\disty-1*\height) node[pos=.5] {max pooling $2\times 2 / 1$};
\draw[conv] (3*\coldist,-1*\height-1*\disty) rectangle (3*\coldist+\widthb,-1*\disty-2*\height) node[pos=.5] {C $512@4 \times 4 / 1$ (V)};
\draw[act] (3*\coldist,-2*\height-2*\disty) rectangle (3*\coldist+\widthb,-2*\disty-3*\height) node[pos=.5] {BN + ELU};
\draw[dropout] (3*\coldist,-3*\height-3*\disty) rectangle (3*\coldist+\widthb,-3*\disty-4*\height) node[pos=.5] {Dropout, $p=0.5$};
% 1x1
\draw[draw=none] (4*\coldist,-1*\height) rectangle (4*\coldist+\widthb/2,-1*\disty-1*\height) node[pos=.5] {$1 \times 1$};
\draw[conv] (4*\coldist,-0*\height-0*\disty) rectangle (4*\coldist+\widthb,-0*\disty-1*\height) node[pos=.5] {C $512@1 \times 1 / 1$};
\draw[act] (4*\coldist,-1*\height-1*\disty) rectangle (4*\coldist+\widthb,-1*\disty-2*\height) node[pos=.5] {BN + ELU};
\draw[dropout] (4*\coldist,-2*\height-2*\disty) rectangle (4*\coldist+\widthb,-2*\disty-3*\height) node[pos=.5] {Dropout, $p=0.5$};
\draw[conv] (4*\coldist,-3*\height-3*\disty) rectangle (4*\coldist+\widthb,-3*\disty-4*\height) node[pos=.5] {C $k@3 \times 3 / 1$};
\draw[dropout] (4*\coldist,-4*\height-4*\disty) rectangle (4*\coldist+\widthb,-4*\disty-5*\height) node[pos=.5] {Global AVG pooling};
\draw[max] (4*\coldist,-5*\height-5*\disty) rectangle (4*\coldist+\widthb,-5*\disty-6*\height) node[pos=.5] {BN + Softmax};
\end{tikzpicture}

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View file

@ -0,0 +1,13 @@
\documentclass{article}
\usepackage{xcolor}
\usepackage[pdftex,active,tightpage]{preview}
\setlength\PreviewBorder{2mm}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{shapes, calc, shapes, arrows, snakes, arrows.meta}
\begin{document}
\begin{preview}
\input{baseline}
\end{preview}
\end{document}