2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-26 06:48:04 +02:00

Add aggregation block

This commit is contained in:
Martin Thoma 2017-01-07 13:20:04 +01:00
parent d2f31daaca
commit ad1a3ead0c
4 changed files with 79 additions and 0 deletions

View file

@ -0,0 +1,31 @@
SOURCE = aggregation-blocks
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:
#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

View file

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View file

@ -0,0 +1,45 @@
\documentclass{standalone}
\usepackage{amssymb}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{shapes.geometric,arrows,positioning}
\begin{document}
\newcommand{\filtersize}{3}
\begin{tikzpicture}
\tikzstyle{conv-layer}=[draw,minimum width=3cm,minimum height=1cm]
\tikzstyle{arrow}=[->, -Latex, thick]
\draw[fill=black!10,dashed] (-4.2, -5.4) rectangle (7.5, 1.2);
\node (input) at (1.5, 1) {};
\path[arrow] (1.5, 2) edge node[right, midway] {$256$-d in} (input.south);
\node[draw, dashed] (concatenate) at (1.5, -5) {concatenate};
\node (between) at (3.4, -2.0) [align=center,text width=1.5cm] {total $32$ paths\\ \dots};
\path[arrow] (concatenate.south) edge node[right, midway] {$128$-d out} (1.5, -6);
% first path
\node (rect11) at (-2.5,-1.5) [conv-layer] {4 @ $1 \times 1 \times 256$};
\node (rect12) at (-2.5,-3.0) [conv-layer] {4 @ $1 \times 1 \times 4$};
\draw[arrow] (input.south) -- (rect11.north);
\draw[arrow] (rect11.south) -- (rect12.north);
\draw[arrow] (rect12.south) -- (concatenate);
% second path
\node (rect21) at ( 1,-1.5) [conv-layer] {4 @ $1 \times 1 \times 256$};
\node (rect22) at ( 1,-3.0) [conv-layer] {4 @ $1 \times 1 \times 4$};
\draw[arrow] (input.south) -- (rect21.north);
\draw[arrow] (rect21.south) -- (rect22.north);
\draw[arrow] (rect22.south) -- (concatenate);
% last path
\node (rect31) at ( 5.8,-1.5) [conv-layer] {4 @ $1 \times 1 \times 256$};
\node (rect32) at ( 5.8,-3.0) [conv-layer] {4 @ $1 \times 1 \times 4$};
\draw[arrow] (input.south) -- (rect31.north);
\draw[arrow] (rect31.south) -- (rect32.north);
\draw[arrow] (rect32.south) -- (concatenate);
\end{tikzpicture}
\end{document}