Commit a08501d2 by zengxin

合并分支 'caorunzhe' 到 'zengxin'

Caorunzhe

查看合并请求 !747
parents 897b7cc7 b8b4ee7a
......@@ -21,7 +21,7 @@
\node[node,font=\scriptsize,anchor = north,fill=ugreen!5,drop shadow] (dict) at ([xshift = 5em,yshift = -5em]node6.south){\begin{tabular}{llllll}
\multirow{3}{*}{符号合并表:} & ('e','s') & ('es','t') & ('est','$<$e$>$') & ('l','o') & ('lo','w') \\
& ('n','e') & ('ne','w') & ('new','est$<$e$>$') & ('low','$<$e$>$') & 'w','i') \\
& ('low','$<$e$>$') & ('n','e') & ('ne','w') & ('new','est$<$e$>$') & ('w','i') \\
& ('wi','d') & ('wid','est$<$e$>$') & ('low','e') & ('lowe','r') & ('lower','$<$e$>$')
\end{tabular}};
......
......@@ -60,12 +60,12 @@
%equ
\node [anchor=west,inner sep = 2pt] (line1) at (9*\nodespace,0) {未应用Dropout:};
\node [anchor=north west,inner sep = 2pt] (line2) at (line1.south west) {$z_{i}^{l+1}=\mathbf{w}_{i}^{l} \mathbf{x}+b_{i}^{l}$};
\node [anchor=north west,inner sep = 2pt] (line3) at (line2.south west) {$x_{i}^{l+1}=f\left(x_{i}^{l}\right)$};
\node [anchor=north west,inner sep = 2pt] (line2) at (line1.south west) {$z_{i}^{l+1}=\mathbf{w}^{l} \mathbf{x}^{l} + b_{i}^{l}$};
\node [anchor=north west,inner sep = 2pt] (line3) at (line2.south west) {$x_{i}^{l+1}=f\left(z_{i}^{l+1}\right)$};
\node [anchor=north west,inner sep = 2pt] (line4) at (line3.south west) {应用Dropout:};
\node [anchor=north west,inner sep = 2pt] (line5) at (line4.south west) {$r_{j}^{l} \sim$ Bernoulli $(1-p)$};
\node [anchor=north west,inner sep = 2pt] (line6) at (line5.south west) {$\tilde{\mathbf{x}}=\mathbf{r} * \mathbf{x}$};
\node [anchor=north west,inner sep = 2pt] (line7) at (line6.south west) {$z_{i}^{l+1}=\mathbf{w}_{i}^{l} \widetilde{\mathbf{x}}+b_{i}^{l}$};
\node [anchor=north west,inner sep = 2pt] (line8) at (line7.south west) {$x_{i}^{l+1}=f\left(z_{i}^{l}\right)$};
\node [anchor=north west,inner sep = 2pt] (line7) at (line6.south west) {$z_{i}^{l+1}=\mathbf{w}^{l} \widetilde{\mathbf{x}}^{l} + b_{i}^{l}$};
\node [anchor=north west,inner sep = 2pt] (line8) at (line7.south west) {$x_{i}^{l+1}=f\left(z_{i}^{l+1}\right)$};
\end{tikzpicture}
\ No newline at end of file
......@@ -2,17 +2,17 @@
\begin{tikzpicture}
\node[] (do) at (0,0) {{\red do}};
\node[anchor = west] (does) at ([xshift = 1em]do.east) {{\red do}es};
\node[anchor = west] (doing) at ([xshift = 0.7em]does.east) {{\red do}ing};
\node[anchor = west] (doing) at ([xshift = 0.7em,yshift = -0.1em]does.east) {{\red do}ing};
\node[anchor = north] (do_root) at ([yshift = -1.5em]does.south) {do};
\node[anchor = west] (new) at ([xshift = 2em]doing.east) {{\red new}};
\node[anchor = west] (newer) at ([xshift = 1em]new.east) {{\red new}er};
\node[anchor = west] (newest) at ([xshift = 0.7em]newer.east) {{\red new}est};
\node[anchor = west] (newest) at ([xshift = 0.7em,yshift = 0.08em]newer.east) {{\red new}est};
\node[anchor = north] (new_root) at ([yshift = -1.5em]newer.south) {new};
\draw [->] ([yshift=0.2em]do_root.north) .. controls +(north:0.4) and +(south:0.6) ..(do.south);
\draw [->] (do_root.north) -- (does.south);
\draw [->] ([yshift=0.2em]do_root.north) .. controls +(north:0.4) and +(south:0.6) ..(doing.south);
\draw [->] ([yshift=0.2em]do_root.north) .. controls +(north:0.4) and +(south:0.6) ..([yshift=0.1em]doing.south);
\draw [->] ([yshift=0.2em]new_root.north) .. controls +(north:0.4) and +(south:0.6) ..(new.south);
\draw [->] (new_root.north) -- (newer.south);
\draw [->] ([yshift=0.2em]new_root.north) .. controls +(north:0.4) and +(south:0.6) ..(newest.south);
\draw [->] ([yshift=0.2em]new_root.north) .. controls +(north:0.4) and +(south:0.6) ..([yshift=0.08em]newest.south);
\end{tikzpicture}
\ No newline at end of file
\definecolor{taupegray}{rgb}{0.55, 0.52, 0.54}
\definecolor{bananamania}{rgb}{0.98, 0.91, 0.71}
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
\tikzstyle{every node}=[scale=0.7]
\tikzstyle{layer} = [draw=black!70,thick, minimum width=7.5em,rounded corners=2pt,inner ysep=6pt,font=\footnotesize,align=center]
\tikzstyle{line} = [line width=1pt,->]
\tikzstyle{cir} = [draw,circle,minimum size=1em, thick,inner sep=0pt]
%encoder
\node[layer,fill=red!15] (src_emb) at (0,0){\scriptsize\textbf{Input Embedding}};
\node[anchor=south,layer,fill=yellow!20] (src_sa) at ([yshift=2.8em]src_emb.north){\scriptsize\textbf{Self-Attention}};
\node[anchor=south,layer,fill=gray!20] (src_norm1) at ([yshift=0.6em]src_sa.north){\scriptsize\textbf{Add \& LayerNorm}};
\node[anchor=south,layer,fill=orange!20] (src_ff) at ([yshift=0.6em]src_norm1.north){\scriptsize\textbf{Feed Forward}\\ \scriptsize\textbf{Network}};
\node[anchor=south,layer,fill=gray!20] (src_norm2) at ([yshift=0.6em]src_ff.north){\scriptsize\textbf{Add \& LayerNorm}};
\node[anchor=south,layer,fill=blue!20] (src_sf) at ([yshift=1.6em]src_norm2.north){\scriptsize\textbf{Softmax}};
%decoder
\node[anchor=west,layer,fill=red!15] (tgt_emb) at ([xshift=4.4em]src_emb.east){\scriptsize\textbf{Output Embedding}};
\node[anchor=south,layer,fill=yellow!20] (tgt_sa) at ([yshift=2.8em]tgt_emb.north){\scriptsize\textbf{Self-Attention}};
\node[anchor=south,layer,fill=yellow!20] (tgt_pa) at ([yshift=1.4em]tgt_sa.north){\scriptsize\textbf{Positional Attention}};
\node[anchor=south,layer,fill=gray!20] (tgt_norm1) at ([yshift=0.6em]tgt_pa.north){\scriptsize\textbf{Add \& LayerNorm}};
\node[anchor=south,layer,fill=yellow!20] (tgt_eda) at ([yshift=1.4em]tgt_norm1.north){\scriptsize\textbf{Encoder-Decoder} \\ \scriptsize\textbf{Attention}};
\node[anchor=south,layer,fill=gray!20] (tgt_norm2) at ([yshift=0.6em]tgt_eda.north){\scriptsize\textbf{Add \& LayerNorm}};
\node[anchor=south,layer,fill=orange!20] (tgt_ff) at ([yshift=0.6em]tgt_norm2.north){\scriptsize\textbf{Feed Forward}\\ \scriptsize\textbf{Network}};
\node[anchor=south,layer,fill=gray!20] (tgt_norm3) at ([yshift=0.6em]tgt_ff.north){\scriptsize\textbf{Add \& LayerNorm}};
\node[anchor=south,layer,fill=green!20] (tgt_linear) at ([yshift=1.1em]tgt_norm3.north){\scriptsize\textbf{Linear}};
\node[anchor=south,layer,fill=blue!20] (tgt_sf) at ([yshift=0.6em]tgt_linear.north){\scriptsize\textbf{Softmax}};
\node[font=\footnotesize,anchor=south] (w3) at ([yshift=0.8em]src_sf.north){\scriptsize\textbf{2}};
\node[font=\footnotesize,anchor=east] (w2) at ([xshift=-0.5em]w3.west){\scriptsize\textbf{1}};
\node[font=\footnotesize,anchor=east] (w1) at ([xshift=-0.5em]w2.west){\scriptsize\textbf{1}};
\node[font=\footnotesize,anchor=west] (w4) at ([xshift=0.5em]w3.east){\scriptsize\textbf{0}};
\node[font=\footnotesize,anchor=west] (w5) at ([xshift=0.5em]w4.east){\scriptsize\textbf{1}};
\node[font=\footnotesize,anchor=south] (output) at ([yshift=0.8em]tgt_sf.north){\scriptsize\sffamily\bfseries{我们\quad 完全\quad 接受\quad\quad}};
\node[font=\footnotesize,anchor=north] (src) at ([yshift=-0.8em]src_emb.south){\scriptsize\textbf{We totally accept it .}};
\node[font=\footnotesize,anchor=north] (tgt) at ([yshift=-0.8em]tgt_emb.south){\scriptsize\textbf{We totally accept accept .}};
\node[cir] (src_add) at (0,1.6em) {};
\node[cir,fill=orange!7] (src_pos) at (-2.5em,1.6em) {};
\node[cir] (tgt_add) at (9.7em,1.6em) {};
\node[cir,fill=orange!7] (tgt_pos) at (12.2em,1.6em) {};
\node[cir,fill=orange!7] (tgt_pos2) at ([xshift=3em,yshift=-1.74em]tgt_pa.north) {};
\draw[line] (tgt_pos2.180) -- ([yshift=-0.6em]tgt_pa.south) -- (tgt_pa.south);
\draw[line] (tgt_pos2.180) -- ([xshift=1.8em,yshift=-0.6em]tgt_pa.south) -- ([xshift=1.8em]tgt_pa.south);
\draw[-,thick] (src_add.90) -- (src_add.-90);
\draw[-,thick] (src_add.0) -- (src_add.180);
\draw[-,thick,] (src_pos.180) .. controls ([xshift=0.8em,yshift=0.8em]src_pos.180) and ([xshift=-0.8em,yshift=-0.8em]src_pos.0) ..(src_pos.0);
\draw[-,thick] (tgt_add.90) -- (tgt_add.-90);
\draw[-,thick] (tgt_add.0) -- (tgt_add.180);
\draw[-,thick,] (tgt_pos.180) .. controls ([xshift=0.8em,yshift=0.8em]tgt_pos.180) and ([xshift=-0.8em,yshift=-0.8em]tgt_pos.0) ..(tgt_pos.0);
\draw[-,thick,] (tgt_pos2.180) .. controls ([xshift=0.8em,yshift=0.8em]tgt_pos2.180) and ([xshift=-0.8em,yshift=-0.8em]tgt_pos2.0) ..(tgt_pos2.0);
\draw[line] (src_emb.north) -- (src_add.south);
\draw[line] (src_add.north) -- (src_sa.south);
\draw[line] (src_sa.north) -- (src_norm1.south);
\draw[line] (src_norm1.north) -- (src_ff.south);
\draw[line] (src_ff.north) -- (src_norm2.south);
\draw[line] (src_norm2.north) -- (src_sf.south);
\draw[line] (tgt_emb.north) -- (tgt_add.south);
\draw[line] (tgt_add.north) -- (tgt_sa.south);
\draw[line] (tgt_sa.north) -- ([yshift=0.5em]tgt_sa.north) -- ([xshift=-1.8em,yshift=0.5em]tgt_sa.north)--([xshift=-1.8em]tgt_pa.south);
\draw[line] (tgt_pa.north) -- (tgt_norm1.south);
\draw[line] (tgt_eda.north) -- (tgt_norm2.south);
\draw[line] (tgt_norm2.north) -- (tgt_ff.south);
\draw[line] (tgt_ff.north) -- (tgt_norm3.south);
\draw[line] (tgt_norm3.north) -- (tgt_linear.south);
\draw[line] (src_pos.0) -- (src_add.180);
\draw[line] (tgt_pos.180) -- (tgt_add.0);
\draw[line] (src_sf.north) -- (w3.south);
\draw[line] (tgt_sf.north) -- (output.south);
\draw[line] (src.north) -- (src_emb.south);
\draw[line,<->,out=-25,in=-155] ([xshift=-2em]src_sa.south) to ([xshift=2em]src_sa.south);
\draw[line] (src_norm2.north) -- ([yshift=0.5em]src_norm2.north) -- ([xshift=4em,yshift=0.5em]src_norm2.north) -- ([xshift=4em,yshift=-0.95em]src_norm2.north) -- ([xshift=-1.8em,yshift=-0.6em]tgt_eda.south) -- ([xshift=-1.8em]tgt_eda.south);
\draw[line] (src_norm2.north) -- ([yshift=0.5em]src_norm2.north) -- ([xshift=4em,yshift=0.5em]src_norm2.north) -- ([xshift=4em,yshift=-0.95em]src_norm2.north)-- ([yshift=-0.6em]tgt_eda.south) -- (tgt_eda.south);
\draw[line,] (tgt_norm1.north) -- ([yshift=0.5em]tgt_norm1.north) -- ([yshift=0.5em,xshift=1.8em]tgt_norm1.north) -- ([xshift=1.8em]tgt_eda.south);
\draw[line,<->,out=-25,in=-155] ([xshift=-2em]tgt_sa.south) to ([xshift=2em]tgt_sa.south);
\begin{pgfonlayer}{background}
{
\node[draw=taupegray,thick,fill=ugreen!10,inner sep=0pt,minimum height=13em,minimum width=9.5em,rounded corners=4pt,drop shadow] (box1) at (0em,7em){};
\node[draw=taupegray,thick,fill=yellow!10,inner sep=0pt,minimum height=4.7em,minimum width=9.5em,rounded corners=4pt,drop shadow] (box2) at (0em,13.6em){};
\node[draw=taupegray,thick,fill=blue!7,inner sep=0pt,minimum height=23.6em,minimum width=10.5em,rounded corners=4pt,drop shadow] (box3) at (9.7em,10.7em){};
}
\end{pgfonlayer}
\node[] at ([yshift=1.5em]box2.north){\normalsize{译文长度:5}};
\node[] at ([xshift=-2em,yshift=0.5em]box2.west){\normalsize{繁衍率}};
\node[] at ([xshift=-2em,yshift=-0.5em]box2.west){\normalsize{预测器}};
\node[] at ([xshift=-2em]box1.west){\normalsize{编码器}};
\node[] at ([xshift=-1em,yshift=-3.8em]box1.west){{$M \times$}};
\node[] at ([xshift=2em]box3.east){\normalsize{解码器}};
\node[] at ([xshift=1em,yshift=-7.5em]box3.east){{$\times N$}};
\draw[line,dotted,violet] (box2.north) -- ([yshift=1em]box2.north) -- ([yshift=1em,xshift=4.7em]box2.north) -- ([xshift=-2.4em]tgt_emb.west) -- (tgt_emb.west);
\draw[line,-,dotted,violet,] (src_emb.east) -- ([xshift=-2em]tgt_emb.west);
\end{tikzpicture}
\begin{tikzpicture}
\begin{scope}
\tikzstyle{hnode}=[rectangle,inner sep=0mm,minimum height=2em,minimum width=3em,rounded corners=5pt,fill=ugreen!20]
\tikzstyle{tnode}=[rectangle,inner sep=0mm,minimum height=2em,minimum width=3em,rounded corners=5pt,fill=red!20]
\tikzstyle{fnoder}=[rectangle,inner sep=0mm,minimum height=2.4em,minimum width=6.8em,draw,dashed,very thick,rounded corners=5pt,red!40]
\tikzstyle{fnodeg}=[rectangle,inner sep=0mm,minimum height=2.4em,minimum width=6.8em,draw,dashed,very thick,rounded corners=5pt,ugreen!40]
\node [anchor=south west,fnodeg] (f1) at (0,0) {};
\node [anchor=west,hnode] (n1) at ([xshift=0.2em,yshift=0em]f1.west) {$\mathbi{h}_1^{\textrm{up}}$};
\node [anchor=east,hnode] (n2) at ([xshift=-0.2em,yshift=0em]f1.east) {$\mathbi{h}_1^{\textrm{down}}$};
\node [anchor=west,fnodeg] (f2) at ([xshift=0.6em,yshift=0em]f1.east) {};
\node [anchor=west,hnode] (n3) at ([xshift=0.2em,yshift=0em]f2.west) {$\mathbi{h}_2^{\textrm{up}}$};
\node [anchor=east,hnode] (n4) at ([xshift=-0.2em,yshift=0em]f2.east) {$\mathbi{h}_2^{\textrm{down}}$};
\node [anchor=west,fnodeg] (f3) at ([xshift=0.6em,yshift=0em]f2.east) {};
\node [anchor=west,hnode] (n5) at ([xshift=0.2em,yshift=0em]f3.west) {$\mathbi{h}_3^{\textrm{up}}$};
\node [anchor=east,hnode] (n6) at ([xshift=-0.2em,yshift=0em]f3.east) {$\mathbi{h}_3^{\textrm{down}}$};
\node [anchor=west,fnodeg] (f4) at ([xshift=0.6em,yshift=0em]f3.east) {};
\node [anchor=west,hnode] (n7) at ([xshift=0.2em,yshift=0em]f4.west) {$\cdots$};
\node [anchor=east,hnode] (n8) at ([xshift=-0.2em,yshift=0em]f4.east) {$\cdots$};
\node [anchor=west,fnodeg] (f5) at ([xshift=0.6em,yshift=0em]f4.east) {};
\node [anchor=west,hnode] (n9) at ([xshift=0.2em,yshift=0em]f5.west) {$\mathbi{h}_n^{\textrm{up}}$};
\node [anchor=east,hnode] (n10) at ([xshift=-0.2em,yshift=0em]f5.east) {$\mathbi{h}_n^{\textrm{down}}$};
\node [anchor=south,fnoder] (f6) at ([xshift=3.7em,yshift=1em]f1.north) {};
\node [anchor=west,tnode] (n11) at ([xshift=0.2em,yshift=0em]f6.west) {$\mathbi{h}_{n+1}^{\textrm{up}}$};
\node [anchor=east,tnode] (n12) at ([xshift=-0.2em,yshift=0em]f6.east) {$\mathbi{h}_{n+1}^{\textrm{down}}$};
\node [anchor=south,fnoder] (f7) at ([xshift=3.7em,yshift=1em]f6.north) {};
\node [anchor=west,tnode] (n13) at ([xshift=0.2em,yshift=0em]f7.west) {$\mathbi{h}_{n+2}^{\textrm{up}}$};
\node [anchor=east,tnode] (n14) at ([xshift=-0.2em,yshift=0em]f7.east) {$\mathbi{h}_{n+2}^{\textrm{down}}$};
\node [anchor=south,fnoder] (f8) at ([xshift=3.7em,yshift=1em]f7.north) {};
\node [anchor=west,tnode] (n15) at ([xshift=0.2em,yshift=0em]f8.west) {$\cdots$};
\node [anchor=east,tnode] (n16) at ([xshift=-0.2em,yshift=0em]f8.east) {$\cdots$};
\node [anchor=south,fnoder] (f9) at ([xshift=3.7em,yshift=1em]f8.north) {};
\node [anchor=west,tnode] (n17) at ([xshift=0.2em,yshift=0em]f9.west) {$\mathbi{h}_{2n-1}^{\textrm{up}}$};
\node [anchor=east,tnode] (n18) at ([xshift=-0.2em,yshift=0em]f9.east) {$\mathbi{h}_{2n-1}^{\textrm{down}}$};
\draw [->,thick] ([xshift=0em,yshift=0em]n11.east) -- ([xshift=0em,yshift=0em]n12.west);
\draw [->,thick] ([xshift=0em,yshift=0em]n13.east) -- ([xshift=0em,yshift=0em]n14.west);
\draw [->,thick] ([xshift=0em,yshift=0em]n15.east) -- ([xshift=0em,yshift=0em]n16.west);
\draw [->,thick] ([xshift=0em,yshift=0em]n17.east) -- ([xshift=0em,yshift=0em]n18.west);
\draw [->,thick] ([xshift=0em,yshift=0em]n1.north) -- ([xshift=0em,yshift=0em]n11.south);
\draw [->,thick] ([xshift=0em,yshift=0em]n3.north) -- ([xshift=0em,yshift=0em]n11.south);
\draw [->,thick] ([xshift=0em,yshift=0em]n12.south) -- ([xshift=0em,yshift=0em]n4.north);
\draw [->,thick] ([xshift=0em,yshift=0em]n12.south) -- ([xshift=0em,yshift=0em]n2.north);
\draw [->,thick] ([xshift=0em,yshift=0em]n11.north) -- ([xshift=0em,yshift=0em]n13.south);
\draw [->,thick] ([xshift=0em,yshift=0em]n5.north) -- ([xshift=0em,yshift=0em]n13.south);
\draw [->,thick] ([xshift=0em,yshift=0em]n14.south) -- ([xshift=0em,yshift=0em]n12.north);
\draw [->,thick] ([xshift=0em,yshift=0em]n14.south) -- ([xshift=0em,yshift=0em]n6.north);
\draw [->,thick] ([xshift=0em,yshift=0em]n13.north) -- ([xshift=0em,yshift=0em]n15.south);
\draw [->,thick] ([xshift=0em,yshift=0em]n7.north) -- ([xshift=0em,yshift=0em]n15.south);
\draw [->,thick] ([xshift=0em,yshift=0em]n16.south) -- ([xshift=0em,yshift=0em]n14.north);
\draw [->,thick] ([xshift=0em,yshift=0em]n16.south) -- ([xshift=0em,yshift=0em]n8.north);
\draw [->,thick] ([xshift=0em,yshift=0em]n15.north) -- ([xshift=0em,yshift=0em]n17.south);
\draw [->,thick] ([xshift=0em,yshift=0em]n9.north) -- ([xshift=0em,yshift=0em]n17.south);
\draw [->,thick] ([xshift=0em,yshift=0em]n18.south) -- ([xshift=0em,yshift=0em]n16.north);
\draw [->,thick] ([xshift=0em,yshift=0em]n18.south) -- ([xshift=0em,yshift=0em]n10.north);
\end{scope}
\end{tikzpicture}
\ No newline at end of file
\begin{tikzpicture}
\begin{scope}
\tikzstyle{enode}=[rectangle,inner sep=0mm,minimum height=5em,minimum width=5em,rounded corners=7pt,fill=ugreen!30]
\tikzstyle{dnode}=[rectangle,inner sep=0mm,minimum height=2em,minimum width=6.5em,rounded corners=5pt,fill=red!30]
\tikzstyle{wnode}=[inner sep=0mm,minimum height=2em,minimum width=4em]
\node [anchor=south west] (w1) at (0,0) {汉语(源语言)};
\node [anchor=west,enode] (e1) at ([xshift=1.5em,yshift=0em]w1.east) {编码器};
\node [anchor=west,dnode] (d1) at ([xshift=3em,yshift=6em]e1.east) {翻译任务};
\node [anchor=north,dnode] (d2) at ([xshift=0em,yshift=-2em]d1.south) {文本处理任务};
\node [anchor=north,dnode] (d3) at ([xshift=0em,yshift=-2em]d2.south) {语言理解};
\node [anchor=north,dnode] (d4) at ([xshift=0em,yshift=-2em]d3.south) {其他任务};
\node [anchor=west] (w2) at ([xshift=2em,yshift=0em]d1.east) {英语(目标语言)};
\node [anchor=west] (w3) at ([xshift=2em,yshift=0em]d2.east) {汉语句法标签};
\node [anchor=west] (w4) at ([xshift=2em,yshift=0em]d3.east) {汉语上下文};
\draw [->,thick] ([xshift=0em,yshift=0em]w1.east) -- ([xshift=0em,yshift=0em]e1.west);
\draw[->,thick] ([xshift=0em,yshift=0em]e1.east) .. controls +(east:2em) and +(west:2em) .. (d1.west);
\draw[->,thick] ([xshift=0em,yshift=0em]e1.east) .. controls +(east:2em) and +(west:2em) .. (d2.west);
\draw[->,thick] ([xshift=0em,yshift=0em]e1.east) .. controls +(east:2em) and +(west:2em) .. (d3.west);
\draw[->,thick] ([xshift=0em,yshift=0em]e1.east) .. controls +(east:2em) and +(west:2em) .. (d4.west);
\draw [->,thick] ([xshift=0em,yshift=0em]d1.east) -- ([xshift=0em,yshift=0em]w2.west);
\draw [->,thick] ([xshift=0em,yshift=0em]d2.east) -- ([xshift=0em,yshift=0em]w3.west);
\draw [->,thick] ([xshift=0em,yshift=0em]d3.east) -- ([xshift=0em,yshift=0em]w4.west);
\end{scope}
\end{tikzpicture}
\ No newline at end of file
......@@ -5,7 +5,7 @@
\tikzstyle{node}=[minimum height=2em,minimum width=5em,draw,rounded corners=2pt,thick,drop shadow]
\node[node,fill=red!20] (n1) at (0,0){\small\bfnew{环境}};
\node[anchor=south,node,fill=blue!20] (n2) at ([yshift=5em]n1.north){\small\bfnew{}};
\node[anchor=south,node,fill=blue!20] (n2) at ([yshift=5em]n1.north){\small\bfnew{智能}};
\node[anchor=north,font=\footnotesize] at ([yshift=-0.2em]n1.south){(结构所应用于的任务)};
\node[anchor=south,font=\footnotesize] at ([yshift=0.2em]n2.north){(结构生成器)};
......
\begin{tikzpicture}
\tikzstyle{word} = [font=\scriptsize,minimum height=1.4em]
\tikzstyle{model} = [rectangle,line width=0.7pt,draw,minimum height=3em,minimum width=13em,rounded corners=4pt,fill=red!20]
\tikzstyle{model} = [rectangle,line width=0.7pt,draw,minimum height=2.2em,minimum width=13em,rounded corners=4pt,fill=red!20]
\node [anchor=center] (ate) at (0,0) {};
%decoder
\node [anchor=center,model,fill=blue!20] (decoder) at ([xshift=7.5em]ate.east) {解码器};
\node [anchor=center,model,fill=blue!20] (decoder) at ([xshift=7.5em]ate.east) {\small{解码器}};
\node [anchor=north,word] (w1) at ([yshift=-1.5em,xshift=0em]decoder.south) {\small{$x_3$}};
\node [anchor=west,word] (w2) at ([xshift=0em]w1.east) {\small{$x_4$}};
\node [anchor=west,word] (w3) at ([xshift=0em]w2.east) {[M]};
......@@ -31,7 +31,7 @@
\draw [->,thick] ([yshift=-1.4em]w10.south) -- (w10.south);
%encoder
\node [model] (encoder) at ([xshift=-7.5em]ate.west) {编码器};
\node [model] (encoder) at ([xshift=-7.5em]ate.west) {\small{编码器}};
\node [anchor=north,word] (we1) at ([yshift=-1.5em,xshift=0em]encoder.south) {[M]};
\node [anchor=west,word] (we2) at ([xshift=0em]we1.east) {[M]};
......
......@@ -632,16 +632,7 @@
\parinterval\ref{unsupervised-dictionary-induction}节所述,无监督词典归纳的方法依赖于词的分布式表示,也就是词嵌入。因此当把无监督词典归纳拓展到短语上时,首先需要获得短语的分布式表示。比较简单的方法是把词换成短语,然后借助与无监督词典归纳相同的算法得到短语的分布式表示。最后直接应用无监督词典归纳方法,得到源语言短语与目标语言短语之间的对应。
\parinterval 尽管已经得到了短语的翻译,短语表的另外一个重要的组成部分,也就是短语对的得分(概率)无法由词典归纳方法直接给出,而这些得分在统计机器翻译模型中非常重要。在无监督词典归纳中,在推断词典的时候会为一对源语言单词和目标语言单词打分(词嵌入之间的相似度),再根据打分来决定哪一个目标语言单词更有可能是当前源语言单词的翻译。在无监督短语归纳中,这样一个打分已经提供了对短语对质量的度量,因此经过适当的归一化处理后就可以得到短语对的得分:
\begin{eqnarray}
P(\mathbi{y}|\mathbi{x}) & = & \frac{\mathrm{cos}(\mathbi{x},\mathbi{y})/\tau}{\sum_{\mathbi{y}^{'}}\mathrm{cos}(\mathbi{x},\mathbi{y}^{'})/\tau}
\label{eq:16-11}
\end{eqnarray}
\noindent 其中,$\mathrm{cos}$是余弦相似度,$\mathbi{x}$是经过无监督词典归纳里$\mathbi{W}$转换的源语言短语嵌入,$\mathbi{y}$是目标语言短语嵌入,$\tau$是控制分布尖锐程度的一个超参数。
\parinterval 一个问题是在无监督的情景下没有任何双语数据,那么如何得到最优的$\tau$?这里,可以寻找一个$\tau$使得所有$P(\mathbi{y}|\mathbi{x})$ 最大\upcite{DBLP:conf/emnlp/ArtetxeLA18}。通常,选取与一个给定的$\mathbi{y}$最接近的$\mathbi{x}$ 而不是选取与一个给定的$\mathbi{x}$最接近的$\mathbi{y}$来计算$P(\mathbi{y}|\mathbi{x})$,因为选取与一个给定的$\mathbi{x}$最接近的$\mathbi{y}$总是$P(\mathbi{y}|\mathbi{x})$里概率最大的元素,这时候总是可以调整$\tau$使得所有$P$的取值都接近1。实际中为了选取最优$\tau$会为$P(\mathbi{y}|\mathbi{x})$$P(\mathbi{x}|\mathbi{y})$ 同时优化$\tau$
\parinterval 尽管已经得到了短语的翻译,短语表的另外一个重要的组成部分,也就是短语对的得分(概率)无法由词典归纳方法直接给出,而这些得分在统计机器翻译模型中非常重要。在无监督词典归纳中,在推断词典的时候会为一对源语言单词和目标语言单词打分(词嵌入之间的相似度),再根据打分来决定哪一个目标语言单词更有可能是当前源语言单词的翻译。在无监督短语归纳中,这样一个打分已经提供了对短语对质量的度量,因此经过适当的归一化处理后就可以得到短语对的得分。
%----------------------------------------------------------------------------------------
% NEW SUB-SUB-SECTION
......
\begin{tikzpicture}
%\tikzstyle{every node}=[scale=0.8]
\tikzstyle{prob}=[minimum width=0.4em, fill=blue!15,inner sep=0pt]
\node[draw,fill=red!20,inner sep=0pt,minimum width=3em,minimum height=5em](key) at (0,0){};
\node[draw,fill=yellow!15,inner sep=0pt,minimum width=3em,minimum height=5em](key) at (0,0){};
\draw[] ([yshift=0.5em]key.180) -- ([yshift=0.5em]key.0);
\draw[] ([yshift=1.5em]key.180) -- ([yshift=1.5em]key.0);
\draw[] ([yshift=-0.5em]key.180) -- ([yshift=-0.5em]key.0);
\draw[] ([yshift=-1.5em]key.180) -- ([yshift=-1.5em]key.0);
\node[draw,fill=blue!20,inner sep=0pt,minimum width=3em,minimum height=5em](value) at (3em,0){};
\node[draw,fill=ugreen!15,inner sep=0pt,minimum width=3em,minimum height=5em](value) at (3em,0){};
\draw[] ([yshift=0.5em]value.180) -- ([yshift=0.5em]value.0);
\draw[] ([yshift=1.5em]value.180) -- ([yshift=1.5em]value.0);
\draw[] ([yshift=-0.5em]value.180) -- ([yshift=-0.5em]value.0);
......@@ -16,36 +17,42 @@
\node[anchor=south,font=\footnotesize,inner sep=0pt] at ([yshift=0.2em]value.north){value};
\node[anchor=south,font=\footnotesize,inner sep=0pt] (cache)at ([yshift=2em,xshift=1.5em]key.north){\small\bfnew{Cache}};
\node[draw,anchor=east,minimum size=2.4em] (dt) at ([yshift=1.4em,xshift=-4em]key.west){$\mathbi{d}_\mathbi{t}$};
\node[draw,anchor=east,minimum size=2.4em] (st) at ([xshift=-4em]dt.west){$\mathbi{s}_\mathbi{t}$};
\node[draw,anchor=east,minimum size=2.4em] (st2) at ([xshift=-0.8em,yshift=4em]dt.west){$ \widetilde{\mathbi{s}}_\mathbi{t}$};
\node[draw,anchor=east,minimum size=1.8em,fill=orange!15] (dt) at ([yshift=2.1em,xshift=-4em]key.west){${\mathbi{d}}_{t}$};
\node[anchor=north,font=\footnotesize] (readlab) at ([xshift=2.8em,yshift=0.3em]dt.north){\red{reading}};
\node[draw,anchor=east,minimum size=1.8em,fill=ugreen!15] (st) at ([xshift=-3.7em]dt.west){${\mathbi{s}}_{t}$};
\node[draw,anchor=east,minimum size=1.8em,fill=red!15] (st2) at ([xshift=-0.85em,yshift=3.5em]dt.west){$ \widetilde{\mathbi{s}}_{t}$};
\node[draw,anchor=north,circle,inner sep=0pt, minimum size=1.2em,fill=yellow] (add) at ([yshift=-1em]st2.south){+};
%\node[draw,anchor=north,circle,inner sep=0pt, minimum size=1.2em,fill=yellow] (add) at ([yshift=-1em]st2.south){+};
\node[draw,thick,inner sep=0pt, minimum size=1.1em, circle] (add) at ([yshift=-1.5em]st2.south){};
\draw[-,thick] (add.0) -- (add.180);
\draw[-,thick] (add.90) -- (add.-90);
\node[anchor=north,inner sep=0pt,font=\footnotesize,text=red] at ([yshift=-1em]add.south){combining};
\node[anchor=north,inner sep=0pt,font=\footnotesize,text=red] at ([xshift=-0.08em,yshift=-1em]add.south){combining};
\node[draw,anchor=east,minimum size=2.4em] (ct) at ([xshift=-3em,yshift=-3.5em]st.west){$ \widetilde{\mathbi{C}}_\mathbi{t}$};
\node[draw,anchor=east,minimum size=1.8em,fill=yellow!15] (ct) at ([xshift=-2em,yshift=-3.5em]st.west){$ {\mathbi{C}}_{t}$};
\node[anchor=north,font=\footnotesize] (matchlab) at ([xshift=6.7em,yshift=-0.1em]ct.north){\red{mathching}};
\node[anchor=east] (y) at ([xshift=-6em,yshift=1em]st.west){$\mathbi{y}_{\mathbi{t}-\mathbi{1}}$};
\node[anchor=east] (y) at ([xshift=-6em,yshift=1em]st.west){$\mathbi{y}_{t-1}$};
\node[draw,anchor=east,minimum width=8em,minimum height=1.6em,fill=blue!20] (output) at ([xshift=-2.6em,yshift=2.6em]st2.west){};
\node[draw,anchor=east,minimum width=7em,minimum height=1.4em,fill=blue!20] (output) at ([xshift=-2.6em,yshift=2.6em]st2.west){};
\node[anchor=south] (yt) at ([yshift=5em]output.north){$\mathbi{y}_{\mathbi{t}}$};
\draw[] ([xshift=-0.8em]output.90) -- ([xshift=-0.8em]output.-90);
\draw[] ([xshift=-2.4em]output.90) -- ([xshift=-2.4em]output.-90);
\draw[] ([xshift=0.8em]output.90) -- ([xshift=0.8em]output.-90);
\draw[] ([xshift=2.4em]output.90) -- ([xshift=2.4em]output.-90);
\node[anchor=south] (yt) at ([yshift=4.2em]output.north){$\mathbi{y}_{t}$};
\draw[] ([xshift=-0.7em]output.90) -- ([xshift=-0.7em]output.-90);
\draw[] ([xshift=-2.1em]output.90) -- ([xshift=-2.1em]output.-90);
\draw[] ([xshift=0.7em]output.90) -- ([xshift=0.7em]output.-90);
\draw[] ([xshift=2.1em]output.90) -- ([xshift=2.1em]output.-90);
\foreach \x/\y in {1/2,2/1,3/5,4/1,5/1,6/1,7/3,8/4,9/2,10/3,11/5,12/5,13/2,14/5,15/5,16/5,17/13,18/2,19/4,20/1}
\node[draw=blue!20,anchor=south,prob,minimum height=0.2em*\y] at ([yshift=1em,xshift=-4.2em+0.4em*\x]output.north){};
\foreach \x/\y in {1/2,2/1,3/5,4/1,5/1,6/1,7/3,8/4,9/2,10/3,11/5,12/10,13/2,14/5,15/5,16/5,17/5}
\node[draw=blue!25,anchor=south,prob,minimum height=0.2em*\y] at ([yshift=1em,xshift=-3.65em+0.4em*\x]output.north){};
\begin{pgfonlayer}{background}
\node[inner sep=3pt,draw,dotted,rounded corners=2pt,very thick][fit=(key)(value)(cache)](box){};
\end{pgfonlayer}
\draw[-latex,dashed,very thick,out=-145,in=10] ([yshift=1.6em]box.180) to node[above,font=\footnotesize,text=red,rotate=25]{reading}(dt.0);
\draw[-latex,dashed,very thick,out=-5,in=-170] (ct.0) to node[above,font=\footnotesize,text=red,pos=0.7,rotate=8]{matching}([yshift=-2.5em]box.180);
\draw[-latex,dashed,very thick,out=-145,in=10] ([yshift=1em]box.180) to (dt.0);
%node[above,font=\footnotesize,text=red,rotate=25]{reading}
\draw[-latex,dashed,very thick,out=-5,in=-170] (ct.0) to ([yshift=-2.5em]box.180);
%node[above,font=\footnotesize,text=red,pos=0.7,rotate=8]{matching}
\draw[-,very thick,out=0,in=-135](st.0) to (add.-135);
\draw[-,very thick,out=180,in=-45](dt.180) to (add.-45);
\draw[-latex,very thick] (add.90) -- (st2.-90);
......@@ -53,5 +60,5 @@
\draw[-latex,very thick,out=180,in=-100] (st2.180) to (output.-90);
\draw[-latex,very thick,out=80,in=-100] (y.90) to (output.-90);
\draw[-latex,very thick] (output.90) -- ([yshift=1em]output.90);
\draw[-latex,very thick] ([yshift=-1em]yt.-90) -- (yt.-90);
\draw[-latex,very thick] ([yshift=-1.2em]yt.-90) -- (yt.-90);
\end{tikzpicture}
\ No newline at end of file
......@@ -4,10 +4,10 @@
\foreach \x in {1,2,3,4}
\node[draw,inner sep=0pt,minimum height=1em,minimum width=1.6em,fill=red!30,rounded corners=1pt] (c1_\x) at (0em+2em*\x, 0em){};
\node[anchor=north] (hpre) at ([yshift=1.8em]c1_1.north) {${\mathbi{h}}^ {\textrm{pre}j}$};
\foreach \x in {1,2,3}
\node[draw,inner sep=0pt,minimum height=1em,minimum width=1.6em,fill=red!30,rounded corners=1pt] (c2_\x) at (11em+2em*\x, 0em){};
\node[anchor=north] (hpre) at ([yshift=1.8em]c2_1.north) {${\mathbi{h}}^ {\textrm{pre}1}$};
\foreach \x in {1,2,3,4,5}
\node[draw,inner sep=0pt,minimum height=1em,minimum width=1.6em,fill=red!30,rounded corners=1pt] (c3_\x) at (18.4em+2em*\x, 0em){};,minimum width=1em
......@@ -17,6 +17,8 @@
%\node[inner sep=0pt,minimum size=1em,fill=ugreen,circle] (c5) at (9em, 7em){};
\node[draw,inner sep=0pt,minimum size=1.2em,fill=green!20,circle] (qs) at (18.6em, 6.4em){};
\node[draw,inner sep=0pt,minimum size=1.2em,fill=green!20,circle] (qw) at (18.6em, 4.4em){};
\node[anchor=north] (qslab) at ([xshift=-0.8em,yshift=1em]qs.north) {${\mathbi{q}}^s$};
\node[anchor=north] (qwlab) at ([xshift=-0.8em,yshift=1em]qw.north) {${\mathbi{q}}^w$};
\node[draw,thick,inner sep=0pt, minimum size=1.2em, circle] (sigma) at (24.4em, 8em){};
\draw[-,thick] (sigma.0) -- (sigma.180);
......@@ -25,6 +27,9 @@
\node[draw,fill=orange!30,inner sep=0pt, minimum size=1.2em, circle] (add1) at (5em, 3em){};
\node[draw,fill=orange!30,inner sep=0pt, minimum size=1.2em, circle] (add2) at (15em, 3em){};
\node[draw,fill=orange!30,inner sep=0pt, minimum size=1.2em, circle] (add3) at (10em, 5.2em){};
\node[anchor=north] (cond) at ([xshift=-1em,yshift=0.5em]add3.north) {${\mathbi{d}}$};
\node[anchor=north] (cons1) at ([xshift=-1em,yshift=0.5em]add2.north) {${\mathbi{s}}^1$};
\node[anchor=north] (consj) at ([xshift=-1em,yshift=0.5em]add1.north) {${\mathbi{s}}^j$};
\begin{pgfonlayer}{background}
\node[draw,rounded corners=2pt,drop shadow,fill=white, minimum width=8.3em][fit=(c1_1)(c1_4)](box1){};
\node[draw,rounded corners=2pt,drop shadow,fill=white,minimum width=6.4em][fit=(c2_1)(c2_3)](box2){};
......@@ -35,10 +40,12 @@
\node[draw=violet,densely dotted,minimum width=1.9em, minimum height=2.1em,very thick] (n1) at (24.4em,0em){};
\node[draw=violet,densely dotted,minimum width=1.8em, minimum height=2em,very thick] (n2) at (24.4em,10.4em){};
\node[] at (24.4em, -1.5em){$\mathbi{x}_\mathbi{t}$};
%\node[] at (24.4em, -1.5em){$\mathbi{x}_\mathbi{t}$};
\node[text=ublue] at (10.5em, 0em) {\small\bfnew{...}};
\node[text=ublue] (hh) at (-0.8em, 0em) {\small\bfnew{...}};
\draw[->,thick, out=70, in=-120] ([yshift=0.1em]c1_1.90) node[xshift=-0.4em,yshift=1.2em]{$ \mathbi{h}_ \mathbi{i}^ \mathbi{j}$}to ([yshift=-0.1em]add1.-90);
\draw[->,thick, out=70, in=-120] ([yshift=0.1em]c1_1.90) to ([yshift=-0.1em]add1.-90);
%node[xshift=-0.4em,yshift=1.2em]{$ \mathbi{h}^ {\textrm j}$}
\draw[->,thick, out=80, in=-100] ([yshift=0.1em]c1_2.90) to ([yshift=-0.1em]add1.-90);
\draw[->,thick, out=100, in=-80] ([yshift=0.1em]c1_3.90) to ([yshift=-0.1em]add1.-90);
\draw[->,thick, out=110, in=-60] ([yshift=0.1em]c1_4.90) to ([yshift=-0.1em]add1.-90);
......@@ -48,19 +55,19 @@
\draw[->,thick, out=110, in=-70] ([yshift=0.1em]c2_3.90) to ([yshift=-0.1em]add2.-90);
\draw[->,thick, out=30, in=-130] ([yshift=0.1em]add1.90) node[xshift=-0.4em,yshift=1.1em]{$ \mathbi{s}^ \mathbi{j}$} to ([yshift=-0.1em]add3.-120);
\draw[->,thick, out=30, in=-130] ([yshift=0.1em]add1.90) to ([yshift=-0.1em]add3.-120);
\draw[->,thick, out=150, in=-50] ([yshift=0.1em]add2.90) to ([yshift=-0.1em]add3.-70);
\draw[->,thick, ugreen!60,out=160,in=-10] ([xshift=-0.1em]qs.160) node[xshift=-0.3em,yshift=0.1em,above,text=black]{$ \mathbi{q}_\mathbi{s}$} to ([xshift=0.1em]add3.0);
\draw[->,thick, ugreen!60,out=180,in=0] ([xshift=-0.1em]qw.180) node[xshift=-0.3em,yshift=0.4em,above,text=black]{$ \mathbi{q}_\mathbi{w}$} to ([xshift=0.1em]add2.0);
\draw[->,thick, ugreen!60,out=160,in=-10] ([xshift=-0.1em]qs.160) to ([xshift=0.1em]add3.0);
\draw[->,thick, ugreen!60,out=180,in=0] ([xshift=-0.1em]qw.180) to ([xshift=0.1em]add2.0);
\draw[->,thick, ugreen!60,out=170,in=-10] ([xshift=-0.1em]qw.160) to ([xshift=0.1em]add1.0);
\draw[->,thick] ([yshift=0.1em]n1.135) .. controls ([xshift=-2em]n1.130) and ([xshift=2em]qw.0) .. ([xshift=0.1em]qw.0);
\draw[->,thick] ([yshift=0.1em]n1.120) .. controls ([xshift=-2em,yshift=1em]n1.120) and ([xshift=3em]qs.0) .. ([xshift=0.1em]qs.0);
\draw[->,thick] ([yshift=0.1em]n1.90) node[yshift=1em,right]{$ \mathbi{h}_\mathbi{t}$}-- ([yshift=-0.1em]sigma.-90);
\draw[->,thick] ([yshift=0.1em]n1.90) node[yshift=0.5em,right]{$ {\mathbi{h}}_{\textrm{t}}$}-- ([yshift=-0.1em]sigma.-90);
\draw[->,thick] ([yshift=0.1em]sigma.90) -- ([yshift=-0.1em]n2.-90);
\draw[->,thick] ([yshift=0.1em]n2.90) -- node[right]{$ \widetilde{\mathbi{h}}_\mathbi{t}$}([yshift=2em]n2.90);
\draw[->,thick] ([yshift=0.1em]n2.90) -- node[right]{$ \widetilde{\mathbi{h}}_{\textrm{t}}$}([yshift=2em]n2.90);
\draw[decorate,decoration={brace, mirror},gray, thick] ([yshift=-2em]box1.-180) -- node[font=\scriptsize,text=black,below]{前几句}([yshift=-2em]box2.0);
\draw[decorate,decoration={brace, mirror},gray, thick] ([yshift=-2em]hh.-180) -- node[font=\scriptsize,text=black,below]{前几句}([yshift=-2em]box2.0);
\draw[decorate,decoration={brace, mirror},gray, thick] ([yshift=-2em]box3.-180) -- node[font=\scriptsize,text=black,below]{当前句}([yshift=-2em]box3.0);
\draw[->, thick, rounded corners=2pt] ([yshift=0.1em]add3.90) -- ([yshift=2.1em]add3.90) -- ([xshift=-0.1em]sigma.180);
......
......@@ -24,7 +24,7 @@
\draw[-, very thick,fill=black] ([xshift=-0.6em,yshift=-1.2em]B\x) -- ([xshift=-0.3em,yshift=-1em]B\x) -- ([yshift=-1.2em]B\x) --([xshift=0.3em,yshift=-1em]B\x) -- ([xshift=0.6em,yshift=-1.2em]B\x) -- (D\x) -- (C\x) -- ([xshift=-0.6em,yshift=-1.2em]B\x);
\draw[-, very thick,fill=black] (E\x) -- ([xshift=0.2em,yshift=0.3em]E\x) -- ([xshift=0.33em]F\x) -- (F\x) -- (E\x);
\node[circle,inner sep=0pt,minimum size=0.4em,fill=black] at ([xshift=-0.7em,yshift=-0.2em]B\x){};
\node[draw,rounded corners=2pt,fill=yellow!20,minimum width=2.3cm,minimum height=2.2em](cnn\x) at ([xshift=1.8em,yshift=3.6em]A\x){CNN};
\node[draw,rounded corners=2pt,fill=yellow!20,minimum width=4.3em,minimum height=2.2em](cnn\x) at ([xshift=1.8em,yshift=3.6em]A\x){CNN};
}
\node[draw,anchor=south,rounded corners=2pt,minimum width=4.0cm,minimum height=2.2em,fill=red!20](encoder) at ([yshift=2.6em,xshift=2.2em]cnn1.north){编码器};
\node[anchor=north,font=\Large](x) at ([xshift=2.5em,yshift=-3.4em]encoder.south){$\seq{x}$};
......
......@@ -2,15 +2,15 @@
\tikzstyle{every node}=[scale=0.9]
\begin {scope}
\node[draw=white,scale=0.6] (input) at (0,0){\includegraphics[width=0.62\textwidth]{./Chapter17/Figures/figure-bank-without-attention.png}};(1.9,-1.4);
\node[anchor=south] (english1) at ([xshift=0em,yshift=-2.5em]input.south) {\begin{tabular}{l}{\large\bfnew{英语}}{\Large{:A medium sized child}}\end{tabular}};
\node[anchor=south] (english2) at ([xshift=1.9em,yshift=-1.2em]english1.south) {\begin{tabular}{l}{\Large{jumps off a dusty {\red{\underline{bank}}}.}} \end{tabular}};
\end {scope}
\node[draw,thick,inner sep=0pt,minimum height=16em,minimum width=19em,rounded corners=8pt][fit = (input) (english1)(english2)] (box1) at (0em,-1.5em){};
\begin {scope}[xshift=1.45in,yshift=-0.2in]
\draw[-,thick] (0,0.2) -- (1,0.2) -- (1,0.4) --(1.5,0) -- (1,-0.4) -- (1,-0.2) -- (0,-0.2) -- (0,0.2);
\end {scope}
\begin {scope}[xshift=4.4in,yshift=-0.2in]
\node[anchor=east] (de1) {\begin{tabular}{l}{\large\bfnew{汉语}}{\Large{:一个半大孩子从尘土}}\end{tabular}};
\node[anchor=south] (de2) at ([xshift=2em,yshift=-1.5em]de1.south) {\begin{tabular}{l}{\Large{飞扬{\red{\underline{河床}}}上跳下来。}} \end{tabular}};
\node[anchor=south] (english1) at ([xshift=-0.4em,yshift=-3.5em]input.south) {\begin{tabular}{l}{\normalsize\bfnew{英语}}{\large{:A medium sized child}}\end{tabular}};
\node[anchor=south] (english2) at ([xshift=1.8em,yshift=-1.2em]english1.south) {\begin{tabular}{l}{\large{jumps off a dusty {\red{\underline{bank}}}.}} \end{tabular}};
\draw[decorate,decoration={brace,amplitude=4mm},very thick] ([xshift=7em]input.90) -- ([xshift=5.7em,yshift=0.5em]english2.270);
\node[anchor=east,rectangle,thick,rounded corners,minimum width=3.5em,minimum height=2.5em,text centered,draw=black!70,fill=red!25](trans)at ([xshift=8em,yshift=5.3em]english1.east){\normalsize{翻译模型}};
\draw[->,very thick]([xshift=-1.65em]trans.west) to (trans.west);
\draw[->,very thick](trans.east) to ([xshift=1.65em]trans.east);
\node[anchor=east] (de1) at ([xshift=5.85cm,yshift=-0.1em]trans.east) {\begin{tabular}{l}{\normalsize\bfnew{汉语}}{\normalsize{:一个半大孩子从尘土飞扬}}\end{tabular}};
\node[anchor=south] (de2) at ([xshift=0em,yshift=-1.5em]de1.south) {\begin{tabular}{l}{\normalsize{{\red{\underline{河床}}}上跳下来。}} \end{tabular}};
\end {scope}
\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]
\tikzstyle{encoder} = [rectangle,thick,rounded corners,minimum width=4.3em,minimum height=2.2em,text centered,draw=black!70,fill=red!25]
\tikzstyle{decoder} = [rectangle,thick,rounded corners,minimum width=4.3em,minimum height=2.2em,text centered,draw=black!70,fill=blue!15]
\tikzstyle{attention} = [rectangle,thick,rounded corners,minimum width=2.6cm,minimum height=2.2em,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{前馈神经网络}};
\begin{tikzpicture}[node distance = 0,scale = 0.75]
\tikzstyle{every node}=[scale=0.75]
\node(decoder_left)[decoder]{\normalsize{码器}};
\node(decoder_right)[decoder, right of = decoder_left, xshift=2.2cm]{\normalsize{码器}};
\node(encoder_left)[encoder, above of = decoder_left, yshift=1.6cm]{\normalsize{码器}};
\node(encoder_right)[encoder, above of = decoder_right, yshift=1.6cm]{\normalsize{码器}};
\node(text_left)[below of = encoder_left, yshift=1.5cm]{\normalsize{前文}};
\node(text_right)[below of = encoder_right, yshift=1.5cm]{\normalsize{源语}};
\node(text_top)[above of = decoder_right, yshift=-1.6cm]{\normalsize{句子级翻译结果}};
\node(title_1)[above of = text_left, xshift=1.1cm, yshift=3cm]{\large\bfnew{一阶段解码}};
\node(ground2)[rectangle,very thick,rounded corners,minimum width=5cm,minimum height=5.8cm,right of = decoder_right,xshift=5.3cm,yshift=1.6cm,draw=black,dashed]{};
\node(ground1)[rectangle,thick,rounded corners,minimum width=3.3cm,minimum height=5cm,right of = decoder_right,xshift=4.8cm,yshift=1.58cm,draw=black,fill=yellow!15]{};
\node(attention_below)[attention, right of = decoder_right, xshift=4.8cm]{\normalsize{注意力机制}};
\node(attention_above)[attention, above of = attention_below, yshift=1.6cm]{\normalsize{注意力机制}};
\node(ffn)[attention, above of = attention_above, yshift=1.6cm, fill=blue!8]{\normalsize{前馈神经网络}};
\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{句子级翻译结果}};
\node(text_2)[above of = ffn, yshift=1.9cm]{\normalsize{上下文修正结果}};
\node(title_2)[right of = title_1, xshift=6.3cm]{\large\bfnew{二阶段解码}};
%\node(text_rright)[right of = text_right, xshift=5.5cm]{\normalsize{句子级翻译结果}};
\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]([yshift=-0.1cm]text_left.south)to(encoder_left.north);
\draw[->,very thick]([yshift=-0.1cm]text_right.south)to(encoder_right.north);
\draw[->,very thick](encoder_left.south)to(decoder_left.north);
\draw[->,very thick](encoder_right.south)to(decoder_right.north);
\draw[->,very thick](decoder_right.south)to([yshift=0.1cm]text_top.north);
%\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);
\draw[->,very thick]([yshift=-0.05em]text_top.south) -- ([yshift=-4.8em]decoder_right.south) -- ([yshift=-4.78em]attention_below.south) --(attention_below.south);
\draw[-,very thick,dashed]([xshift=1.25cm,yshift=-3cm]decoder_right.east)to([xshift=1.25cm,yshift=6.5cm]decoder_right.east);
\draw[->,very thick,draw=gray,rounded corners=2pt] (encoder_left.south)--([yshift=-0.3cm]encoder_left.south)--([yshift=-0.3cm,xshift=3.42cm]encoder_left.south)--([xshift=-2.25cm]attention_above.west)--(attention_above.west);
\draw[->,very thick,draw=gray,rounded corners=2pt] (encoder_right.south)--([yshift=-0.3cm]encoder_right.south)--([yshift=-0.3cm,xshift=3.42cm]encoder_left.south)--([xshift=-2.25cm]attention_above.west)--(attention_above.west);
\draw[->,very thick,draw=gray,rounded corners=2pt](decoder_left.south)--([yshift=-0.3cm]decoder_left.south)--([yshift=-0.3cm,xshift=3.42cm]decoder_left.south)--([xshift=-2.25cm]attention_below.west)--(attention_below.west);
\draw[->,very thick,draw=gray,rounded corners=2pt](decoder_right.south)--([yshift=-0.3cm]decoder_right.south)--([yshift=-0.3cm,xshift=3.42cm]decoder_left.south)--([xshift=-2.25cm]attention_below.west)--(attention_below.west);
\end{tikzpicture}
\ No newline at end of file
......@@ -6929,6 +6929,25 @@ year={2012}
publisher={Conference on Empirical Methods in Natural Language Processing},
year={2020}
}
@inproceedings{DBLP:conf/coling/ZhuWH08,
author = {Jingbo Zhu and
Huizhen Wang and
Eduard H. Hovy},
title = {Multi-Criteria-Based Strategy to Stop Active Learning for Data Annotation},
publisher = {International Conference on Computational Linguistics},
pages = {1129--1136},
year = {2008}
}
@inproceedings{DBLP:conf/iccv/TrikiABT17,
author = {Amal Rannen Triki and
Rahaf Aljundi and
Matthew B. Blaschko and
Tinne Tuytelaars},
title = {Encoder Based Lifelong Learning},
pages = {1329--1337},
publisher = {{IEEE} International Conference on Computer Vision},
year = {2017}
}
%%%%% chapter 13------------------------------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论