Commit ab3bed66 by 曹润柘

update

parent 91a42306
\definecolor{color1}{rgb}{1,0.725,0.058}
\tikzstyle{coder} = [rectangle,thick,rounded corners,minimum width=2.8cm,minimum height=1.1cm,text centered,draw=black!70,fill=blue!10]
\tikzstyle{attention} = [rectangle,thick,rounded corners,minimum width=2.6cm,minimum height=0.9cm,text centered,draw=black!70,fill=green!25]
\begin{tikzpicture}[node distance = 0,scale = 1]
\tikzstyle{every node}=[scale=1]
\node(encoder_c)[coder]{\large{编码器}};
\node(encoder_s)[coder, right of = encoder_c, xshift=3.5cm, fill=red!25]{\large{编码器}};
\node(h_pre)[above of = encoder_c, yshift=1.3cm,scale=1.3]{${\mathbi{h}}_{pre}$};
\node(h)[above of = encoder_s, yshift=1.3cm,scale=1.3]{$\mathbi{h}$};
\node(cir)[circle,very thick, right of = h, draw=black!90,minimum width=0.5cm,xshift=1.1cm]{};
\draw[-,very thick,draw=black!90]([xshift=0.04cm]cir.west)--([xshift=-0.04cm]cir.east);
\draw[-,very thick,draw=black!90]([yshift=-0.04cm]cir.north)--([yshift=0.04cm]cir.south);
\node(last)[below of = encoder_c, yshift=-1.3cm]{\large{前一句}};
\node(current)[below of = encoder_s, yshift=-1.3cm]{\large{当前句}};
\node(attention_left)[attention, above of = encoder_c, xshift=2.4cm,yshift=3.1cm]{\large{注意力机制}};
\node(d)[above of = attention_left, yshift=1.1cm,scale=1.3]{$\mathbi{d}$};
\node(ground)[rectangle, thick, rounded corners, minimum width=5cm, minimum height=5.5cm, right of = encoder_s, xshift=4.4cm,yshift=2.2cm, draw=black!70, fill=gray!30]{};
\node(decoder)[above of = encoder_s, xshift=3.1cm]{\large{解码器}};
\node(attention_right)[attention, right of = attention_left, xshift=5.4cm,yshift=-0.4cm]{\large{注意力机制}};
\node(target)[right of = current, xshift=5.3cm]{\large{目标句}};
\node(point_below)[right of = encoder_s, xshift=5.3cm]{\Huge{...}};
\node(point_above)[above of = attention_right, yshift=1.8cm]{\Huge{...}};
\draw[->, very thick](last)to([yshift=-0.05cm]encoder_c.south);
\draw[->, very thick](current)to([yshift=-0.05cm]encoder_s.south);
\draw[->, very thick](target.north)to([yshift=-0.05cm]point_below.south);
\draw[->, very thick]([yshift=0.05cm]encoder_c.north)to([yshift=0.03cm]h_pre.south);
\draw[->, very thick]([yshift=0.05cm]encoder_s.north)to(h.south);
\draw[->, very thick]([yshift=0cm]h.north)to([yshift=0.95cm]h.north);
\draw[->, very thick,in=270,out=90]([yshift=-0.15cm]h_pre.north)to([xshift=1.25cm,yshift=0.9cm]h_pre.north);
\draw[->, very thick,in=270,out=80]([yshift=-0.15cm]h_pre.north)to([xshift=2.4cm,yshift=0.9cm]h_pre.north);
\draw[->, very thick]([yshift=0.03cm]attention_left.north)to([yshift=0.1cm]d.south);
\draw[->, very thick]([xshift=-0.03cm]h.east)to([xshift=-0.03cm]cir.west);
\draw[->, very thick](point_below.north)to([yshift=2.03cm]point_below.north);
\draw[->, very thick](attention_right.north)to([yshift=-0.03cm]point_above.south);
\draw[->, very thick](point_above.north)to([yshift=0.83cm]point_above.north);
\draw[->, very thick, in=270,out=0]([xshift=0.2cm]cir.east)to([xshift=3cm,yshift=0.88cm]cir.east);
\draw[->, very thick, in=270,out=0]([xshift=0.2cm]cir.east)to([xshift=2cm,yshift=0.88cm]cir.east);
\draw[->,very thick,]([xshift=0.1cm]d.east)to([xshift=1.92cm]d.east)to([yshift=0.03cm]cir.north);
\end{tikzpicture}
\ No newline at end of file
\tikzstyle{encoder} = [rectangle,thick,rounded corners,minimum width=2.3cm,minimum height=1.4cm,text centered,draw=black!70,fill=red!25]
\tikzstyle{decoder} = [rectangle,thick,rounded corners,minimum width=2.3cm,minimum height=1.4cm,text centered,draw=black!70,fill=blue!15]
\tikzstyle{attention} = [rectangle,thick,rounded corners,minimum width=2.6cm,minimum height=0.9cm,text centered,draw=black!70,fill=green!25]
\begin{tikzpicture}[node distance = 0,scale = 1]
\tikzstyle{every node}=[scale=1]
\node(encoder_left)[encoder]{\large{编码器}};
\node(encoder_right)[encoder, right of = encoder_left, xshift=3cm]{\large{编码器}};
\node(decoder_left)[decoder, above of = encoder_left, yshift=2.7cm]{\large{解码器}};
\node(decoder_right)[decoder, above of = encoder_right, yshift=2.7cm]{\large{解码器}};
\node(text_left)[below of = encoder_left, yshift=-2.2cm]{\large{前文}};
\node(text_right)[below of = encoder_right, yshift=-2.2cm]{\large{源语}};
\node(text_top)[above of = decoder_right, yshift=2cm]{\large{句子级翻译结果}};
\node(title_1)[above of = text_top, xshift=-1.5cm, yshift=1.3cm]{\large\bfnew{一阶段解码}};
\node(ground2)[rectangle,very thick,rounded corners,minimum width=5cm,minimum height=5.3cm,right of = encoder_right,xshift=6cm,yshift=1.4cm,draw=black,dashed]{};
\node(ground1)[rectangle,thick,rounded corners,minimum width=3.3cm,minimum height=4.5cm,right of = encoder_right,xshift=5.5cm,yshift=1.4cm,draw=black,fill=yellow!15]{};
\node(attention_below)[attention, right of = encoder_right, xshift=5.5cm]{\large{注意力机制}};
\node(attention_above)[attention, above of = attention_below, yshift=1.4cm]{\large{注意力机制}};
\node(ffn)[attention, above of = attention_above, yshift=1.4cm, fill=blue!8]{\large{前馈神经网络}};
\node(n)[right of = attention_above, xshift=2.4cm,scale=1.5]{$\times N$};
\node(text_2)[above of = ffn, yshift=1.9cm]{\large{上下文修正结果}};
\node(title_2)[above of = text_2, xshift=0.5cm,yshift=1.3cm]{\large\bfnew{二阶段解码}};
\node(text_rright)[right of = text_right, xshift=5.5cm]{\large{句子级翻译结果}};
\draw[->,very thick]([yshift=0.2cm]text_left.north)to(encoder_left.south);
\draw[->,very thick]([yshift=0.2cm]text_right.north)to(encoder_right.south);
\draw[->,very thick](encoder_left.north)to(decoder_left.south);
\draw[->,very thick](encoder_right.north)to(decoder_right.south);
\draw[->,very thick](decoder_right.north)to([yshift=-0.1cm]text_top.south);
\draw[->,very thick]([yshift=0.2cm]text_rright.north)to(attention_below.south);
\draw[->,very thick](attention_below.north)to(attention_above.south);
\draw[->,very thick](attention_above.north)to([yshift=-0.05cm]ffn.south);
\draw[->,very thick](ffn.north)to([yshift=-0.05cm]text_2.south);
\draw[-,very thick,dashed]([xshift=2cm,yshift=-0.2cm]text_right.east)to([xshift=2cm,yshift=9cm]text_right.east);
\draw[-,very thick]([yshift=0.5cm]encoder_left.north)--([yshift=0.5cm,xshift=4.5cm]encoder_left.north)--([xshift=-2.68cm]attention_below.west)--(attention_below.west);
\draw[-,very thick](decoder_left.north)--([yshift=0.5cm]decoder_left.north)--([yshift=0.5cm,xshift=4.7cm]decoder_left.north)--([xshift=-2.48cm]attention_above.west)--(attention_above.west);
\end{tikzpicture}
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论