这个图怎么画呢

2020-04-21 21:08发布

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

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

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

1条回答
registor
2020-04-21 22:39 .采纳回答

简单实现了一下,具体形状、颜色等根据需要调整。

```

\documentclass[margin=3pt,

  12pt,

  border = 8pt,

  convert,

  convert={

    outext=.png,

    command=\unexpanded{

      pdftocairo -r 300 -png \infile % 将生成的pdf文件转换为png图像

    }

  }

  ]{standalone}


\usepackage{tikz}

\usetikzlibrary{positioning}

\usetikzlibrary{calc}

\usetikzlibrary{arrows.meta}

\usetikzlibrary{shadows}


\begin{document}

\begin{tikzpicture}[

  %node distance = 5mm and 7mm,

  MN/.style args = {#1/#2}{

    draw=#1,% line color

    top color=#2!10,

    bottom color=#2!80,

    rounded corners,

    thick,

    text width=9em,

    minimum height=15mm,

    inner sep=1mm,

    align=flush center

  },

  line/.style = {

    thick,

    draw=#1,%line color

    -{Stealth[scale=1.0]},

    shorten >=1mm,

    shorten <=1mm

  },

  ds/.style = {drop shadow}%drop shadow

  ]

  % 布置结点

  \node[MN=black/red, ds](n1){Filter\\concatenation};

  \node[MN=black/cyan,ds, below=1.0 of n1, shift={(-1.5cm, 0cm)}] (n2){$3\times{}3$ convolutions};

  \node[MN=black/green,ds,right=of n2] (n3)  {$5\times{}5$ convolutions};

  \node[MN=black/yellow,ds,right=of n3] (n4) {$1\times{}1$ convolutions};

  \node[MN=black/yellow,ds,left=1.5 of n2, shift={(0.0cm, -1.5cm)}] (n5) {$1\times{}1$ convolutions};

  \node[MN=black/yellow,ds,below=1.0 of n2] (n6) {$1\times{}1$ convolutions};

  \node[MN=black/yellow,ds,right=of n6] (n7) {$1\times{}1$ convolutions};

  \node[MN=black/yellow,ds,right=of n7] (n8) {$3\times{}3$ max pooling};

  \node[MN=black/yellow,ds,below=1.0 of n6, shift={(0.5cm, 0cm)}] (n9) {Previous layer};


  % 绘制连线

  \draw[line=black] (n5.north) to[out=90, in = -160] (n1.south);

  \draw[line=black] (n2.north) to[out=90, in = -100] (n1.south);

  \draw[line=black] (n3.north) to[out=145, in = -45] (n1.south);

  \draw[line=black] (n4.north) to[out=165, in = -20] (n1.south);

  \draw[line=black] (n6.north) -- (n2.south);

  \draw[line=black] (n7.north) -- (n3.south);

  \draw[line=black] (n8.north) -- (n4.south);

  \draw[line=black] (n9.north) to[out=160, in = -90] (n5.south);

  \draw[line=black] (n9.north) to[out=100, in = -80] (n6.south);

  \draw[line=black] (n9.north) to[out=60, in = -145] (n7.south);

  \draw[line=black] (n9.north) to[out=30, in = -160] (n8.south);

\end{tikzpicture}

\end{document}


%%% Local Variables:

%%% mode: latex

%%% TeX-master: t

%%% End:

```

结果如下:

main-1.png


一周热门 更多>