![](https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=1974476665,1279001790&fm=26&gp=0.jpg)

这种图片有什么简便的画法呢,或者我可以参考哪一个例子画呢

1 回答1

1
<p></p><p></p><p>简单实现了一下,具体形状、颜色等根据需要调整。</p><p>```</p><p>\documentclass[margin=3pt,</p><p>&nbsp; 12pt,</p><p>&nbsp; border = 8pt,</p><p>&nbsp; convert,</p><p>&nbsp; convert={</p><p>&nbsp; &nbsp; outext=.png,</p><p>&nbsp; &nbsp; command=\unexpanded{</p><p>&nbsp; &nbsp; &nbsp; pdftocairo -r 300 -png \infile % 将生成的pdf文件转换为png图像</p><p>&nbsp; &nbsp; }</p><p>&nbsp; }</p><p>&nbsp; ]{standalone}</p><p><br/></p><p>\usepackage{tikz}</p><p>\usetikzlibrary{positioning}</p><p>\usetikzlibrary{calc}</p><p>\usetikzlibrary{arrows.meta}</p><p>\usetikzlibrary{shadows}</p><p><br/></p><p>\begin{document}</p><p>\begin{tikzpicture}[</p><p>&nbsp; %node distance = 5mm and 7mm,</p><p>&nbsp; MN/.style args = {#1/#2}{</p><p>&nbsp; &nbsp; draw=#1,% line color</p><p>&nbsp; &nbsp; top color=#2!10,</p><p>&nbsp; &nbsp; bottom color=#2!80,</p><p>&nbsp; &nbsp; rounded corners,</p><p>&nbsp; &nbsp; thick,</p><p>&nbsp; &nbsp; text width=9em,</p><p>&nbsp; &nbsp; minimum height=15mm,</p><p>&nbsp; &nbsp; inner sep=1mm,</p><p>&nbsp; &nbsp; align=flush center</p><p>&nbsp; },</p><p>&nbsp; line/.style = {</p><p>&nbsp; &nbsp; thick,</p><p>&nbsp; &nbsp; draw=#1,%line color</p><p>&nbsp; &nbsp; -{Stealth[scale=1.0]},</p><p>&nbsp; &nbsp; shorten >=1mm,</p><p>&nbsp; &nbsp; shorten <=1mm</p><p>&nbsp; },</p><p>&nbsp; ds/.style = {drop shadow}%drop shadow</p><p>&nbsp; ]</p><p>&nbsp; % 布置结点</p><p>&nbsp; \node[MN=black/red, ds](n1){Filter\\concatenation};</p><p>&nbsp; \node[MN=black/cyan,ds, below=1.0 of n1, shift={(-1.5cm, 0cm)}] (n2){$3\times{}3$ convolutions};</p><p>&nbsp; \node[MN=black/green,ds,right=of n2] (n3)&nbsp; {$5\times{}5$ convolutions};</p><p>&nbsp; \node[MN=black/yellow,ds,right=of n3] (n4) {$1\times{}1$ convolutions};</p><p>&nbsp; \node[MN=black/yellow,ds,left=1.5 of n2, shift={(0.0cm, -1.5cm)}] (n5) {$1\times{}1$ convolutions};</p><p>&nbsp; \node[MN=black/yellow,ds,below=1.0 of n2] (n6) {$1\times{}1$ convolutions};</p><p>&nbsp; \node[MN=black/yellow,ds,right=of n6] (n7) {$1\times{}1$ convolutions};</p><p>&nbsp; \node[MN=black/yellow,ds,right=of n7] (n8) {$3\times{}3$ max pooling};</p><p>&nbsp; \node[MN=black/yellow,ds,below=1.0 of n6, shift={(0.5cm, 0cm)}] (n9) {Previous layer};</p><p><br/></p><p>&nbsp; % 绘制连线</p><p>&nbsp; \draw[line=black] (n5.north) to[out=90, in = -160] (n1.south);</p><p>&nbsp; \draw[line=black] (n2.north) to[out=90, in = -100] (n1.south);</p><p>&nbsp; \draw[line=black] (n3.north) to[out=145, in = -45] (n1.south);</p><p>&nbsp; \draw[line=black] (n4.north) to[out=165, in = -20] (n1.south);</p><p>&nbsp; \draw[line=black] (n6.north) -- (n2.south);</p><p>&nbsp; \draw[line=black] (n7.north) -- (n3.south);</p><p>&nbsp; \draw[line=black] (n8.north) -- (n4.south);</p><p>&nbsp; \draw[line=black] (n9.north) to[out=160, in = -90] (n5.south);</p><p>&nbsp; \draw[line=black] (n9.north) to[out=100, in = -80] (n6.south);</p><p>&nbsp; \draw[line=black] (n9.north) to[out=60, in = -145] (n7.south);</p><p>&nbsp; \draw[line=black] (n9.north) to[out=30, in = -160] (n8.south);</p><p>\end{tikzpicture}</p><p>\end{document}</p><p><br/></p><p>%%% Local Variables:</p><p>%%% mode: latex</p><p>%%% TeX-master: t</p><p>%%% End:</p><p>```</p><p>结果如下:</p><p><img src="/data/ueditor/php/upload/image/20200421/1587479950828691.png" title="1587479950828691.png" alt="main-1.png" style="max-width:650px"/></p><p><br/></p>
  • 非常感谢! – wgqhandsome 2020-04-28 14:31 回复
  • 厉害,非常感谢 – wgqhandsome 2020-04-21 22:41 回复

你的回答

请登录后回答

你的回答将会帮助更多人,请务必认真回答问题。