figure-increase-the-encoder.tex 3.57 KB
Newer Older
曹润柘 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

	\begin{tikzpicture}
		\setlength{\base}{1.2em}
		\tikzstyle{node} = [rounded corners=1pt,minimum width=1.2em,minimum height=1.2em,draw,fill=green!30!white]
		\tikzstyle{node2} = [rounded corners=1pt,minimum width=1.2em,minimum height=1.2em,draw,fill=blue!30!white]
		\node[node] (enc1) at (0,0) {};
		\node[node] (enc2) at ([xshift = \base]enc1.east) {};
		\node[node] (enc3) at ([xshift = \base]enc2.east) {};
		\node[node] (enc4) at ([xshift = \base]enc3.east) {};
		\node[node] (enc5) at ([xshift = \base]enc4.east) {};
		\node[node] (enc6) at ([xshift = \base]enc5.east) {};
		\node[] (enc7) at ([xshift = \base]enc6.east) {...};
		\node[node] (enc8) at ([xshift = \base]enc7.east) {};
		\node[node] (enc9) at ([xshift = \base]enc8.east) {};
		\node[node] (enc10) at ([xshift = \base]enc9.east) {};
		\node[font=\scriptsize,rotate=270] (src) at ([xshift = -\base]enc1.west) {src};
		\draw [->] ([xshift=-0.75em]enc1.west) -- (enc1.west);
xiaotong committed
18
		\draw [decorate,decoration={brace}] ([yshift=0.3em]enc1.north west) to node [auto,anchor=south,font=\scriptsize] {$N$x} ([yshift=0.3em]enc10.north east);
曹润柘 committed
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
		\draw [->] (enc1.east) -- (enc2.west);
		\draw [->] (enc2.east) -- (enc3.west);
		\draw [->] (enc3.east) -- (enc4.west);
		\draw [->] (enc4.east) -- (enc5.west);
		\draw [->] (enc5.east) -- (enc6.west);
		\draw [->] (enc8.east) -- (enc9.west);
		\draw [->] (enc9.east) -- (enc10.west);

		\node[node2,anchor=north] (dec1) at ([yshift=-2em]enc1.south) {};
		\node[node2,anchor=north] (dec2) at ([yshift=-2em]enc2.south) {};
		\node[node2,anchor=north] (dec3) at ([yshift=-2em]enc3.south) {};
		\node[node2,anchor=north] (dec4) at ([yshift=-2em]enc4.south) {};
		\node[node2,anchor=north] (dec5) at ([yshift=-2em]enc5.south) {};
		\node[node2,anchor=north] (dec6) at ([yshift=-2em]enc6.south) {};
		\node[font=\scriptsize,rotate=270] (tgt) at ([xshift = -\base]dec1.west) {tgt};
		\node[font=\scriptsize,rotate=270] (tgt) at ([xshift = \base]dec6.east) {out};
		\draw [->] ([xshift=-0.75em]dec1.west) -- (dec1.west);
		\draw [->] (dec6.east) -- ([xshift=0.75em]dec6.east);
		\draw [decorate,decoration={brace,mirror}] ([yshift=-0.3em]dec1.south west) to node [auto,anchor=north,font=\scriptsize] {6x} ([yshift=-0.3em]dec6.south east);
		\draw [->] (dec1.east) -- (dec2.west);
		\draw [->] (dec2.east) -- (dec3.west);
		\draw [->] (dec3.east) -- (dec4.west);
		\draw [->] (dec4.east) -- (dec5.west);
		\draw [->] (dec5.east) -- (dec6.west);

		\node[node] (enc_legend) at ([xshift = 2\base]enc10.east) {};
		\node[node2,anchor=north] (dec_legend) at ([yshift = -\base]enc_legend.south) {};
		\node[font=\scriptsize,anchor=west] (line1) at (enc_legend.east) {:编码层};
		\node[font=\scriptsize,anchor=west] (line1) at (dec_legend.east) {:解码层};
		%\node[node] (dec1) at ([xshift=4em]enc1.east) {Decoder};

		%\node[node2] (enc2) at ([xshift=4em]dec1.east) {Encoder};
		%\node[node] (dec2) at ([xshift=4em]enc2.east) {Decoder};
		\coordinate (c1) at ([xshift=1em]enc10.east);
		\coordinate (c2) at ([yshift=-1.6em]c1.south);
		\draw [->,rounded corners] (enc10.east) -- (c1) -- (c2)--([yshift=1em]dec1.north) -- (dec1.north);
		\draw [->,rounded corners] (enc10.east) -- (c1) -- (c2)--([yshift=1em]dec2.north) -- (dec2.north);
		\draw [->,rounded corners] (enc10.east) -- (c1) -- (c2)--([yshift=1em]dec3.north) -- (dec3.north);
		\draw [->,rounded corners] (enc10.east) -- (c1) -- (c2)--([yshift=1em]dec4.north) -- (dec4.north);
		\draw [->,rounded corners] (enc10.east) -- (c1) -- (c2)--([yshift=1em]dec5.north) -- (dec5.north);
		\draw [->,rounded corners] (enc10.east) -- (c1) -- (c2)--([yshift=1em]dec6.north) -- (dec6.north);
	\end{tikzpicture}