-
Notifications
You must be signed in to change notification settings - Fork 117
/
attention_distribution.tex
62 lines (52 loc) · 2.71 KB
/
attention_distribution.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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
61
62
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{xeCJK}
\definecolor{tiffanyblue}{RGB}{129,216,208}
\definecolor{bangdiblue}{RGB}{0,149,182}
\definecolor{kleinblue}{RGB}{0,47,167}
\definecolor{kabuliblue}{RGB}{26,85,153}
\definecolor{purple}{RGB}{138,43,226}
\definecolor{upink}{RGB}{255,150,128}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\tikzstyle{elementnode} = [rectangle,text=white,anchor=center]
\tikzstyle{srcnode} = [rotate=45,font=\small,anchor=south west]
\tikzstyle{tgtnode} = [left,font=\small,anchor=north east]
\tikzstyle{alignmentnode} = [rectangle,draw,minimum height=3.6cm,minimum width=0.36cm]
\tikzstyle{probnode} = [fill=blue!30,minimum width=0.4cm]
\tikzstyle{labelnode} = [above]
% alignment matrix
\begin{scope}[scale=0.9,yshift=0.12in]
\foreach \i / \j / \c / \z in
{ 0/5/1/50, 1/5/1/30, 2/5/1/70, 3/5/1/50, 4/5/1/20, 5/5/1/90,
0/4/1/10, 1/4/1/60, 2/4/1/30, 3/4/1/40, 4/4/1/40, 5/4/1/40,
0/3/1/30, 1/3/1/20, 2/3/1/40, 3/3/1/40, 4/3/1/30, 5/3/1/50,
0/2/1/50, 1/2/1/90, 2/2/1/30, 3/2/1/70, 4/2/1/20, 5/2/1/40,
0/1/1/20, 1/1/1/10, 2/1/1/30, 3/1/1/40, 4/1/1/60, 5/1/1/40,
0/0/1/10, 1/0/1/20, 2/0/1/30, 3/0/1/40, 4/0/1/20, 5/0/1/80}
\node[elementnode,minimum size=0.6*1.2cm*\c,inner sep=0pt,fill=tiffanyblue!\z] (a\i\j) at (0.5*1.8cm*\i-3.8*0.5*1.8cm,0.5*1.8cm*\j-0.7*1.8cm) {};
% source
\node[srcnode] (src1) at (-3.9*0.5*1.8cm,-1.75*1.8cm+7.5*0.5*1.8cm) {\scriptsize{Have}};
\node[srcnode] (src2) at ([xshift=0.9cm]src1.south west) {\scriptsize{you}};
\node[srcnode] (src3) at ([xshift=0.9cm]src2.south west) {\scriptsize{learned}};
\node[srcnode] (src4) at ([xshift=0.9cm]src3.south west) {\scriptsize{nothing}};
\node[srcnode] (src5) at ([xshift=0.9cm]src4.south west) {\scriptsize{?}};
\node[srcnode] (src6) at ([xshift=0.9cm]src5.south west) {\scriptsize{$\langle$eos$\rangle$}};
% target
\node[tgtnode] (tgt1) at (-4.2*0.5*1.8cm,-1.35*1.8cm+7.5*0.5*1.8cm) {\scriptsize{你}};
\node[tgtnode] (tgt2) at ([yshift=-0.9cm]tgt1.north east) {\scriptsize{Have}};
\node[tgtnode] (tgt3) at ([yshift=-0.9cm]tgt2.north east) {\scriptsize{you}};
\node[tgtnode] (tgt4) at ([yshift=-0.9cm]tgt3.north east) {\scriptsize{learned}};
\node[tgtnode] (tgt5) at ([yshift=-0.9cm]tgt4.north east) {\scriptsize{nothing}};
\node[tgtnode] (tgt6) at ([yshift=-0.9cm]tgt5.north east) {\scriptsize{?}};
\node[tgtnode] (tgt7) at ([yshift=-0.9cm]tgt6.north east) {\scriptsize{$\langle$eos$\rangle$}};
\end{scope}
\end{tikzpicture}
\caption{Caption}
\label{fig:my_label}
\end{figure}
\end{document}