figure-use-cnn-in-nmt.tex 3.81 KB
Newer Older
zengxin committed
1 2
%\newlength{\bcc}
\setlength{\bcc}{0.4cm}
zengxin committed
3 4 5 6 7

\begin{tikzpicture}
\begin{scope}
	%\tikzstyle{every node}=[scale=0.8]
	\tikzstyle{line} = [dash pattern=on 2pt off 1pt,line width=0.5pt]
zengxin committed
8
	\tikzstyle{cir} = [thin,fill=blue!15,draw,circle,minimum size =0.5em,drop shadow={shadow xshift=0.15em, shadow yshift=-0.1em}]
zengxin committed
9
	\tikzstyle{word} = [inner sep=0pt, font=\scriptsize,minimum height=\bcc]
zengxin committed
10
	
zengxin committed
11 12 13
	\draw[fill=red!15,line width=0.2pt] (0cm,0cm+1*\bcc) rectangle (0cm+4*\bcc,0cm+7*\bcc);
	\draw[fill=cyan!20,line width=0.2pt] (0cm,0cm) rectangle (0cm+4*\bcc,0cm+1*\bcc);
	\draw[fill=cyan!20,line width=0.2pt] (0cm,0cm+7*\bcc) rectangle (0cm+4*\bcc,0cm+8*\bcc);
zengxin committed
14 15
	\draw[step=\bcc] (0cm,0cm) grid (0cm+4*\bcc,0cm+8*\bcc); 
	%\draw[line width=0.7pt] (0cm,0cm) rectangle (0cm+4*\bcc,0cm+8*\bcc);
zengxin committed
16 17
	\draw[red!70,line width=1.8pt] (0cm,0cm+5*\bcc) rectangle (0cm+4*\bcc,0cm+8*\bcc);
	\draw[ugreen!70,line width=1.8pt] (0cm,0cm+1*\bcc) rectangle (0cm+4*\bcc,0cm+4*\bcc);
zengxin committed
18 19

	
zengxin committed
20
	\draw[fill=blue!15,xshift=5.0cm,yshift=1.0cm,line width=0.2pt] (0cm,0cm) rectangle (0cm+1*\bcc,0cm+6*\bcc);
zengxin committed
21 22
	\draw[step=\bcc,xshift=5.0cm,yshift=1.0cm] (0cm,0cm) grid (0cm+1*\bcc,0cm+6*\bcc);
	%\draw[line width=0.7pt,xshift=5.0cm,yshift=1.0cm] (0cm,0cm) rectangle (0cm+1*\bcc,0cm+6*\bcc);
zengxin committed
23
	
zengxin committed
24
	\draw[fill=blue!15,xshift=5.2cm,yshift=0.8cm,line width=0.2pt] (0cm,0cm) rectangle (0cm+1*\bcc,0cm+6*\bcc);
zengxin committed
25 26
	\draw[step=\bcc,xshift=5.2cm,yshift=0.8cm] (0cm,0cm) grid (0cm+1*\bcc,0cm+6*\bcc); 
	%\draw[line width=0.7pt,xshift=5.2cm,yshift=0.8cm] (0cm,0cm) rectangle (0cm+1*\bcc,0cm+6*\bcc);
zengxin committed
27
	\draw[ugreen!70,line width=2pt,xshift=5.2cm,yshift=0.8cm] (0cm,0cm+1*\bcc) rectangle (0cm+1*\bcc,0cm+2*\bcc);
zengxin committed
28
	
zengxin committed
29
	\draw[fill=blue!15,xshift=5.4cm,yshift=0.6cm,line width=0.2pt] (0cm,0cm) rectangle (0cm+1*\bcc,0cm+6*\bcc);
zengxin committed
30 31
	\draw[step=\bcc,xshift=5.4cm,yshift=0.6cm] (0cm,0cm) grid (0cm+1*\bcc,0cm+6*\bcc);
	%\draw[line width=0.7pt,xshift=5.4cm,yshift=0.6cm] (0cm,0cm) rectangle (0cm+1*\bcc,0cm+6*\bcc); 
zengxin committed
32
	
zengxin committed
33
	\draw[fill=blue!15,xshift=5.6cm,yshift=0.4cm,line width=0.2pt] (0cm,0cm) rectangle (0cm+1*\bcc,0cm+6*\bcc);
zengxin committed
34 35
	\draw[step=\bcc,xshift=5.6cm,yshift=0.4cm] (0cm,0cm) grid (0cm+1*\bcc,0cm+6*\bcc); 
	%\draw[line width=0.7pt,xshift=5.6cm,yshift=0.4cm] (0cm,0cm) rectangle (0cm+1*\bcc,0cm+6*\bcc);
zengxin committed
36
	\draw[red!70,line width=2pt,xshift=5.6cm,yshift=0.4cm] (0cm,0cm+5*\bcc) rectangle (0cm+1*\bcc,0cm+6*\bcc);
zengxin committed
37

zengxin committed
38 39
	\draw[red!70,line width=0.5pt] (0cm+4*\bcc,0cm+8*\bcc) -- ([xshift=5.6cm,yshift=0.4cm]0cm,0cm+6*\bcc);
	\draw[red!70,line width=0.5pt] (0cm+4*\bcc,0cm+5*\bcc) -- ([xshift=5.6cm,yshift=0.4cm]0cm,0cm+5*\bcc);
zengxin committed
40

zengxin committed
41 42
	\draw[ugreen!70,line width=0.5pt] (0cm+4*\bcc,0cm+4*\bcc) -- ([xshift=5.2cm,yshift=0.8cm]0cm,0cm+2*\bcc);
	\draw[ugreen!70,line width=0.5pt] (0cm+4*\bcc,0cm+1*\bcc) -- ([xshift=5.2cm,yshift=0.8cm]0cm,0cm+1*\bcc);
zengxin committed
43 44

	\node[word] (w1) at (-0.5cm, 3.0cm) {$<$p$>$};
zengxin committed
45 46 47 48 49 50 51
	\node[word] (w2) at ([yshift=-\bcc]w1) {今天};
	\node[word] (w3) at ([yshift=-\bcc]w2) {};
	\node[word] (w4) at ([yshift=-\bcc]w3) {};
	\node[word] (w5) at ([yshift=-\bcc]w4) {};
	\node[word] (w6) at ([yshift=-\bcc]w5) {日子};
	\node[word] (w7) at ([yshift=-\bcc]w6) {};
	\node[word] (w8) at ([yshift=-\bcc]w7) {$<$p$>$};
zengxin committed
52 53 54 55 56 57 58 59 60 61
	
	\node[inner xsep=2pt,inner ysep=0pt,font=\footnotesize] (c1) at (0.8cm, 3.5cm) {$O$};
	\draw[-latex] (c1.west) -- ([xshift=-0.4cm]c1.west);
	\draw[-latex] (c1.east) -- ([xshift=0.4cm]c1.east);
	
	\node[inner xsep=2pt,inner ysep=0pt,font=\footnotesize, rotate=-45] (c2) at (5.06cm, 0.5cm) {$N$};
	\draw[-latex] (c2.west) -- ([xshift=-0.2cm,yshift=0.2cm]c2.west);
	\draw[-latex] (c2.east) -- ([xshift=0.2cm, yshift=-0.2cm]c2.east);

%%%%%%%%%%%%%%%%%%%%%
zengxin committed
62 63 64
	\node[word] (sub) at ([xshift=9.5*\bcc,yshift=3.5*\bcc]w1) {$O$\ \ :输入通道数};
	\node[word] (sub2) at ([yshift=-0.5*\bcc]sub.south) {$N$\ \ :卷积核数量};
	\node[word] (sub3) at ([xshift=-1.35em,yshift=-0.5*\bcc]sub2.south) {$<$p$>$:填充};
zengxin committed
65 66 67 68
	
\end{scope}

\end{tikzpicture}