vgg-16.tex 4.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. \documentclass{article}
  2. \usepackage[pdftex,active,tightpage]{preview}
  3. \setlength\PreviewBorder{2mm}
  4. \usepackage{amsmath}
  5. \usepackage{tikz}
  6. \usetikzlibrary{shapes, calc, shapes, arrows, snakes}
  7. \newcommand{\width}{0.2}
  8. \begin{document}
  9. \begin{preview}
  10. \tikzstyle{input}=[draw,fill=red!50]
  11. \tikzstyle{conv}=[draw,fill=black!20]
  12. \tikzstyle{max}=[draw,dashed,fill=black!10]
  13. \tikzstyle{dropout}=[draw,dashed,fill=blue!10]
  14. \tikzstyle{fc}=[draw,fill=green!10]
  15. \tikzstyle{output}=[draw,fill=red!50]
  16. \def \coldist {2.5}
  17. \def \widthb {2}
  18. \tikzstyle{stateTransition}=[->, very thick]
  19. \begin{tikzpicture}[scale=2]
  20. \draw[->, line width=5pt]
  21. (1.0+0*\coldist, 0.5) --(1.0+0*\coldist, -2.2) --(2.1+0*\coldist, -2.2) --(2.5+0*\coldist, 0.5)
  22. -- (1.0+1*\coldist, 0.5) --(1.0+1*\coldist, -2.2) --(2.1+1*\coldist, -2.2) --(2.5+1*\coldist, 0.5)
  23. -- (1.0+2*\coldist, 0.5) --(1.0+2*\coldist, -2.9) --(2.1+2*\coldist, -2.9) --(2.5+2*\coldist, 0.5)
  24. -- (1.0+3*\coldist, 0.5) --(1.0+3*\coldist, -2.9) --(2.1+3*\coldist, -2.9) --(2.5+3*\coldist, 0.5)
  25. -- (1.0+4*\coldist, 0.5) --(1.0+4*\coldist, -2.9) --(2.1+4*\coldist, -2.9) --(2.5+4*\coldist, 0.5)
  26. -- (1.0+5*\coldist, 0.5) --(1.0+5*\coldist, -4.5);
  27. % \draw[->, line width=5pt] (6.5, -2.8)
  28. % -- (1.0, -2.8) -- (1.0, -6.5) -- (2.0, -6.5) -- (3.0, -3.0)
  29. % -- (4.0, -3.0) -- (4.0, -6.5) -- (5.0, -6.5) -- (6.0, -3.0)
  30. % -- (7.0, -3.0) -- (7.0, -7.0);
  31. \draw[draw=none] (0*\coldist,-0.5) rectangle (1.0,-0.7) node[pos=.5] {$224 \times 224$};
  32. \draw[input] (0*\coldist, 0.0) rectangle (2.0,-0.5) node[pos=.5] {Input};
  33. \draw[conv] (0*\coldist,-0.7) rectangle (2.0,-1.2) node[pos=.5] {C $64@3 \times 3 / 1$};
  34. \draw[conv] (0*\coldist,-1.4) rectangle (2.0,-1.9) node[pos=.5] {C $64@3 \times 3 / 1$};
  35. \draw[draw=none] (1*\coldist,-0.5) rectangle (1*\coldist+\widthb/2,-0.7) node[pos=.5] {$112 \times 112$};
  36. \draw[max] (1*\coldist, 0.0) rectangle (1*\coldist+\widthb,-0.5) node[pos=.5] {max pooling $2\times 2 / 1$};
  37. \draw[conv] (1*\coldist,-0.7) rectangle (1*\coldist+\widthb,-1.2) node[pos=.5] {C $128@3 \times 3 / 1$};
  38. \draw[conv] (1*\coldist,-1.4) rectangle (1*\coldist+\widthb,-1.9) node[pos=.5] {C $128@3 \times 3 / 1$};
  39. \draw[draw=none] (2*\coldist,-0.5) rectangle (2*\coldist+\widthb/2,-0.7) node[pos=.5] {$56 \times 56$};
  40. \draw[max] (2*\coldist, 0.0) rectangle (2*\coldist+\widthb,-0.5) node[pos=.5] {max pooling $2\times 2 / 1$};
  41. \draw[conv] (2*\coldist,-0.7) rectangle (2*\coldist+\widthb,-1.2) node[pos=.5] {C $256@3 \times 3 / 1$};
  42. \draw[conv] (2*\coldist,-1.4) rectangle (2*\coldist+\widthb,-1.9) node[pos=.5] {C $256@3 \times 3 / 1$};
  43. \draw[conv] (2*\coldist,-2.1) rectangle (2*\coldist+\widthb,-2.6) node[pos=.5] {C $256@3 \times 3 / 1$};
  44. % second line
  45. \draw[draw=none] (3*\coldist,-0.5) rectangle (3*\coldist+\widthb/2,-0.7) node[pos=.5] {$28 \times 28$};
  46. \draw[max] (3*\coldist,-0.0) rectangle (3*\coldist+\widthb,-0.5) node[pos=.5] {max pooling $2\times 2 / 1$};
  47. \draw[conv] (3*\coldist,-0.7) rectangle (3*\coldist+\widthb,-1.2) node[pos=.5] {C $512@3 \times 3 / 1$};
  48. \draw[conv] (3*\coldist,-1.4) rectangle (3*\coldist+\widthb,-1.9) node[pos=.5] {C $512@3 \times 3 / 1$};
  49. \draw[conv] (3*\coldist,-2.1) rectangle (3*\coldist+\widthb,-2.6) node[pos=.5] {C $512@3 \times 3 / 1$};
  50. \draw[draw=none] (4*\coldist,-0.5) rectangle (4*\coldist+\widthb/2,-0.7) node[pos=.5] {$14 \times 14$};
  51. \draw[max] (4*\coldist,-0.0) rectangle (4*\coldist+\widthb,-0.5) node[pos=.5] {max pooling $2\times 2 / 1$};
  52. \draw[conv] (4*\coldist,-0.7) rectangle (4*\coldist+\widthb,-1.2) node[pos=.5] {C $512@3 \times 3 / 1$};
  53. \draw[conv] (4*\coldist,-1.4) rectangle (4*\coldist+\widthb,-1.9) node[pos=.5] {C $512@3 \times 3 / 1$};
  54. \draw[conv] (4*\coldist,-2.1) rectangle (4*\coldist+\widthb,-2.6) node[pos=.5] {C $512@3 \times 3 / 1$};
  55. \draw[draw=none] (5*\coldist,-0.5) rectangle (5*\coldist+\widthb/2,-0.7) node[pos=.5] {$7 \times 7$};
  56. \draw[max] (5*\coldist,-0.0) rectangle (5*\coldist+\widthb,-0.5) node[pos=.5] {max pooling $2\times 2 / 1$};
  57. \draw[fc] (5*\coldist,-0.7) rectangle (5*\coldist+\widthb,-1.2) node[pos=.5] {Fully Connected 4096};
  58. \draw[dropout] (5*\coldist,-1.4) rectangle (5*\coldist+\widthb,-1.9) node[pos=.5] {Dropout $0.5$};
  59. \draw[fc] (5*\coldist,-2.1) rectangle (5*\coldist+\widthb,-2.6) node[pos=.5] {Fully Connected 4096};
  60. \draw[dropout] (5*\coldist,-2.8) rectangle (5*\coldist+\widthb,-3.3) node[pos=.5] {Dropout $0.5$};
  61. \draw[output] (5*\coldist,-3.5) rectangle (5*\coldist+\widthb,-4.0) node[pos=.5] {Fully Connected 1000};
  62. \end{tikzpicture}
  63. \end{preview}
  64. \end{document}