瀏覽代碼

Add aggregation block

Martin Thoma 8 年之前
父節點
當前提交
ad1a3ead0c

+ 31 - 0
tikz/aggregation-blocks/Makefile

@@ -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

+ 3 - 0
tikz/aggregation-blocks/README.md

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

二進制
tikz/aggregation-blocks/aggregation-blocks.png


+ 45 - 0
tikz/aggregation-blocks/aggregation-blocks.tex

@@ -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}