Guest User

Untitled

a guest
Oct 20th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.87 KB | None | 0 0
  1. % System Combination
  2. % Harish K Krishnamurthy <www.ece.neu.edu/~hkashyap/>
  3. documentclass{article}
  4.  
  5. usepackage{tikz}
  6. usetikzlibrary{shapes,arrows,shadows}
  7. usepackage{amsmath,bm,times}
  8. %%%<
  9. usepackage{verbatim}
  10. usepackage[active,tightpage]{preview}
  11. PreviewEnvironment{tikzpicture}
  12. setlengthPreviewBorder{5pt}%
  13. %%%>
  14.  
  15. begin{comment}
  16. :Title: System Combination
  17. :Author: Harish K Krishnamurthy
  18.  
  19. A block diagram of system combination technique of combining several Automatic Speech Recognition Systems (ASRs) to determine best word sequence outputs is shown here. The training and validation phase are the important phases.
  20.  
  21. end{comment}
  22.  
  23. newcommand{mx}[1]{mathbf{bm{#1}}} % Matrix command
  24. newcommand{vc}[1]{mathbf{bm{#1}}} % Vector command
  25.  
  26. begin{document}
  27. % Define the layers to draw the diagram
  28. pgfdeclarelayer{background}
  29. pgfdeclarelayer{foreground}
  30. pgfsetlayers{background,main,foreground}
  31.  
  32. % Define block styles used later
  33.  
  34. tikzstyle{sensor}=[draw, fill=blue!20, text width=5em,
  35. text centered, minimum height=2.5em,drop shadow]
  36. tikzstyle{ann} = [above, text width=5em, text centered]
  37. tikzstyle{wa} = [sensor, text width=10em, fill=red!20,
  38. minimum height=6em, rounded corners, drop shadow]
  39. tikzstyle{sc} = [sensor, text width=13em, fill=red!20,
  40. minimum height=10em, rounded corners, drop shadow]
  41.  
  42. % Define distances for bordering
  43. defblockdist{2.3}
  44. defedgedist{2.5}
  45.  
  46. begin{tikzpicture}[
  47. hid/.style 2 args={
  48. rectangle split,
  49. rectangle split horizontal,
  50. draw=#2,
  51. rectangle split parts=#1,
  52. fill=#2!20,
  53. outer sep=1mm}]
  54. % draw input nodes
  55. foreach i [count=step from 1] in {the,blue,house,{{$<$eos$>$}}}
  56. node (istep) at (2*step, -2) {i};
  57. % draw output nodes
  58. foreach t [count=step from 4] in {la,casa,azul,{{$<$eos$>$}}} {
  59. node[align=center] (ostep) at (2*step, +2.75) {t};
  60. }
  61. % draw embedding and hidden layers for text input
  62. foreach step in {1,...,3} {
  63. node[hid={3}{red}] (hstep) at (2*step, 0) {};
  64. node[hid={3}{red}] (estep) at (2*step, -1) {};
  65. draw[->] (istep.north) -> (estep.south);
  66. draw[->] (estep.north) -> (hstep.south);
  67. }
  68. % draw embedding and hidden layers for label input
  69. foreach step in {4,...,7} {
  70. node[hid={3}{yellow}] (sstep) at (2*step, 1.25) {};
  71. node[hid={3}{blue}] (hstep) at (2*step, 0) {};
  72. node[hid={3}{blue}] (estep) at (2*step, -1) {};
  73. draw[->] (estep.north) -> (hstep.south);
  74. draw[->] (hstep.north) -> (sstep.south);
  75. draw[->] (sstep.north) -> (ostep.south);
  76. }
  77. % edge case: draw edge for special input token
  78. draw[->] (i4.north) -> (e4.south);
  79. % draw recurrent links
  80. foreach step in {1,...,6} {
  81. pgfmathtruncatemacro{next}{add(step,1)}
  82. draw[->] (hstep.east) -> (hnext.west);
  83. }
  84. % draw predicted-labels-as-inputs links
  85. foreach step in {4,...,6} {
  86. pgfmathtruncatemacro{next}{add(step,1)}
  87. path (ostep.north) edge[->,out=45,in=225] (enext.south);
  88. }
  89. end{tikzpicture}
  90. end{document}
Add Comment
Please, Sign In to add comment