Commit 98598b4b by Lee

Add attention figure

parent 13865730
0 0 0.0015787
0 1 0.8981237
0 2 0.9941288
0 3 0.8358846
0 4 0.0249039
0 5 0.0011104
1 0 0.2266226
1 1 0.038062
1 2 0.0008284
1 3 0.1008646
1 4 0.3985066
1 5 0.6942891
2 0 0.7717987
2 1 0.0638143
2 2 0.0050428
2 3 0.0632507
2 4 0.5765896
2 5 0.3046004
\ No newline at end of file
0 0 0.6999553
0 1 0.016724
0 2 0.1645972
0 3 0.4247814
0 4 0.0393372
0 5 0.0368674
1 0 0.2473319
1 1 0.9409236
1 2 0.6279203
1 3 0.0196451
1 4 0.1238876
1 5 0.0633883
2 0 0.0441086
2 1 0.032901
2 2 0.1272134
2 3 0.0719068
2 4 0.1457271
2 5 0.2597517
3 0 0.0086041
3 1 0.0094513
3 2 0.0802692
3 3 0.4836667
3 4 0.6910481
3 5 0.6399926
\ No newline at end of file
......@@ -2517,9 +2517,76 @@ $\textrm{``you''} = \argmax_{y} \textrm{P}(y|\textbf{s}_1, \alert{\textbf{C}})$
%%%------------------------------------------------------------------------------------------------------------
%%% 注意力模型的效果 - 热图
\begin{frame}{真实的实例}
\begin{itemize}
\item 注意力的权重符合双语对应的规律
\end{itemize}
\begin{itemize}
\item 注意力的权重符合双语对应的规律
\begin{enumerate}
\item 翻译出``New York Times''的时候``纽约时报''的权重很大
\item 翻译出``I''的时候``我''的权重很大
\item 翻译出``came''的时候``来到''的权重很大
\item 翻译出``world''的时候``世界''的权重很大
\end{enumerate}
\item 互译的词通常都会产生较大的注意力权重
\item 注意力的权重包含了词对齐的信息
\end{itemize}
\begin{center}
\hspace*{\fill}
\begin{tikzpicture}
\begin{axis}[
width=0.4\linewidth,height=0.4\linewidth,
view={0}{90},
enlargelimits=false,
ymin=-0.5,ymax=5.5,
xmin=-0.5,xmax=2.5,
ytick={0,1,...,5},
yticklabels={The,New,York,Times,comments,EOS},
yticklabel style={font=\scriptsize},
xtick={0,1,2},
xticklabels={纽约时报,发表,评论},
xticklabel style={rotate=45,anchor=south west,font=\scriptsize,inner sep=0pt,outer sep=2pt},
xtick pos=upper,xticklabel pos=upper,
colormap={bluewhite}{color=(white) color=(blue)},
]
\addplot3[matrix plot] file [meta=index 2] {Figures/example1.dat};
\end{axis}
\draw [red,very thick] (0,0.9) rectangle (0.9,2.3);
\end{tikzpicture}
\hfill
\begin{tikzpicture}
\begin{axis}[
width=0.4\linewidth,height=0.4\linewidth,
view={0}{90},
enlargelimits=false,
ymin=-0.5,ymax=5.5,
xmin=-0.5,xmax=3.5,
ytick={0,1,...,5},
yticklabels={I,came,to,this,world,EOS},
yticklabel style={font=\scriptsize},
xtick={0,1,2,3},
xticklabels={我,来到,这个,世界},
xticklabel style={rotate=45,anchor=south west,font=\scriptsize,inner sep=0pt,outer sep=2pt},
xtick pos=upper,xticklabel pos=upper,
colormap={bluewhite}{color=(white) color=(blue)},
colorbar,
colorbar style={
font=\scriptsize,
title style={align=center},
title={注意力\\大小},
yticklabel style={
/pgf/number format/precision=1,
/pgf/number format/.cd,
fixed,
fixed zerofill
},
at={(1.2,1)},anchor=north west,
},
]
\addplot3[matrix plot] file [meta=index 2] {Figures/example2.dat};
\end{axis}
\draw [red,very thick] (0,2.3) rectangle (0.7,2.72);
\draw [red,very thick] (0.7,1.8) rectangle (1.35,2.3);
\draw [red,very thick] (2.05,0.45) rectangle (2.75,0.9);
\end{tikzpicture}
\end{center}
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论