卷积网络示例

卷积网络示例

在此处输入图片描述

你能帮忙画一下上面的图吗?

这是我迄今为止尝试过的代码:

\documentclass{article}
\usepackage{tikz}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{calc,shapes, positioning}
\usetikzlibrary{arrows}
\usetikzlibrary{decorations.text}
\usetikzlibrary{matrix,chains,positioning,decorations.pathreplacing,arrows}

\begin{document}


\begin{tikzpicture}[
init/.style={
    draw,
    circle,
    inner sep=2pt,
    font=\Huge,
    join = by -latex
},
squa/.style={
    draw,
    inner sep=2pt,
    font=\Large,
    join = by -latex
},
start chain=2,node distance=13mm
]

\node[on chain=2,init] (sigma) 
    {$\displaystyle\Sigma$};
\node[on chain=2,squa,label=above:{\parbox{2cm}}]   
    {$+$};
\node[on chain=2,squa,label=above:,join=by -latex] 
    {$y$};

\node[label=above:\parbox{2cm}{\centering Bias \\ $$}] at (sigma|-w1) (b) {};

\end{tikzpicture}

\end{document}

答案1

可能的解决方案

    \documentclass[border={10pt}]{standalone}

\usepackage{tikz}
\usetikzlibrary{arrows, decorations.pathmorphing, backgrounds, positioning,fit,petri}
\usetikzlibrary{calc}
\begin{document}

\begin{tikzpicture}
    [%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    node distance=2cm, >=stealth', very thick,
    cross/.style={path picture={ \draw[black]
                   (path picture bounding box.south east) -- (path picture bounding box.north west) 
                   (path picture bounding box.south west) -- (path picture bounding box.north east);
                  }},
    %---------------                  
    BigRectangle/.style={rectangle,draw=black,fill=white,thick,
                              inner sep=0pt,minimum size=2cm},
    %---------------
    SmallRectangle/.style={rectangle,draw=black,fill=white,thick,
                              inner sep=0pt,minimum size=.7cm},
    %---------------       
    Circle/.style={circle,draw=black,fill=white,thick,
                              inner sep=0pt,minimum size=6mm},                                             
    ]%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     \node[BigRectangle]   (A)               {} node[yshift=15mm,align=center] {Input feature \\ maps};
     \node[BigRectangle]   (B) [right=of A]  {};
     \node[Circle,cross,yshift=7mm] (C)  at (barycentric cs:A=0.5,B=0.5)  {};
     \node[SmallRectangle,yshift=17mm] (D) [below=of C]  {};
     %\node[BigRectangle] (D) [left=of  C]  {D};

     \draw[<-] (C) -- (C -| A.east);
     \draw[->] (C) -- (C -| B.west);
     \draw[<-] (C) -- (D);


     \node[BigRectangle]   (E) [below=of A]  {};
     \node[BigRectangle]   (F) [right=of E]  {} node[below=of F,xshift=-8mm, yshift=14mm,align=center] {Conv. kernel  \qquad Conv. ouput };;
     \node[Circle,cross,yshift=7mm] (G)  at (barycentric cs:E=0.5,F=0.5)  {};
     \node[SmallRectangle,yshift=17mm] (H) [below=of G]  {};

     \draw[<-] (G) -- (G -| E.east);
     \draw[->] (G) -- (G -| F.west);
     \draw[<-] (G) -- (H);

     \node[Circle,xshift=2cm] (I)  at (barycentric cs:B=0.5,F=0.5)  {$\sum$};
     \draw[->] (B) -| (I);
     \draw[->] (F) -| (I);

     \node[Circle,node distance=.5cm] (J) [right=of I] {+};
     \node[Circle,node distance=.5cm] (K) [right=of J] {$\phi$}  node[left=of J,xshift=9mm,align=center] {Conv. kernel  \qquad Conv. ouput };
     \node[BigRectangle,node distance=.5cm]   (L) [right=of K]  {} node[above=of L,yshift=-20mm,align=center] {Output feature \\ maps};

     \draw[->] (I) -- (J);
     \draw[->] (J) -- (K);
     \draw[->] (K) -- (L);

     \node[node distance=.5cm] (M)  [above=of J]  {Bias};
     \draw[->] (M) -- (J);

     \node[fill,circle,node distance=.5cm,minimum size=.2cm,inner sep=0pt] (N)  [below=of L]  {};
     \node[fill,circle,node distance=.5cm,minimum size=.2cm,inner sep=0pt] (Q)  [below=of N]  {};
     \node[fill,circle,node distance=.5cm,minimum size=.2cm,inner sep=0pt] (Z)  [below=of Q]  {};

\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容