-
Notifications
You must be signed in to change notification settings - Fork 84
Expand file tree
/
Copy pathfigure6-14-resnet.tex
More file actions
51 lines (41 loc) · 2.32 KB
/
figure6-14-resnet.tex
File metadata and controls
51 lines (41 loc) · 2.32 KB
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
\documentclass[tikz, border=50pt]{standalone}
\usepackage{tikz}
\usepackage{medl_colors}
\usepackage{amsmath,xstring}
\usepackage{ifthen}
\usetikzlibrary{shapes.multipart, shapes.geometric, arrows.meta, decorations.pathreplacing, calligraphy}
\usetikzlibrary{matrix, calc, positioning,fit, backgrounds, shapes}
\tikzstyle{yellow_rect} = [yellowshape,text = black, minimum width=3cm, ultra thick, align=center]
\tikzstyle{blue_rect} = [blueshape, text = black, minimum width=3cm, ultra thick, align=center]
\tikzstyle{green_rect} = [greenshape, ultra thick, text = black, minimum width=3cm, align=center]
\begin {document}
\newcommand\flow[2]{
\node[blue_rect] (node#1-1) at (#2, 0) {ReLU};
\node[circle, blueshape, text = white, align=center, below of = node#1-1] (node#1-2) {+};
\node[green_rect, below of = node#1-2] (node#1-3) {Convolution};
\node[below of = node#1-2, node distance=2.2cm] (node#1-3-1) {};
\node[below of = node#1-2, node distance=3.2cm] (node#1-3-2) {};
\node[blue_rect, below of = node#1-3, node distance=3cm] (node#1-4) {ReLU};
\node[green_rect, below of = node#1-4, node distance=0.54cm] (node#1-5) {Convolution};
\node[below of = node#1-5, node distance=1.5cm] (node#1-6) {\Large $u = a^{[\ell]}$};
\node[above of = node#1-1, node distance=1cm] (node#1-7) {\Large $a^{[\ell + \tilde{\ell}]}$};
\node[left of = node#1-3-2, node distance=3cm] (node#1-7) {\Large $r(u)$};
\draw[-Triangle, uthickline] (node#1-1) -- ++(0, .7);
\draw[-Triangle, uthickline] (node#1-2) -- (node#1-1);
\draw[-Triangle, uthickline] (node#1-3) -- (node#1-2);
\draw[-Triangle, dashed, uthickline] (node#1-4) -- (node#1-3);
\draw[-Triangle, uthickline] (node#1-3-1) -- (node#1-3);
\draw[-Triangle, uthickline] (node#1-4) -- (node#1-3-2);
\draw[-Triangle, uthickline] (node#1-6) -- (node#1-5);
\draw[decorate, decoration={calligraphic brace,amplitude=5pt}, pen colour={black!50}, ultra thick, rotate=0] (-1.7,-6.5) -- (-1.7,-2) node[above left =.25cm and .7cm]{};
}
\begin{tikzpicture}[node distance=1.2cm]
\sffamily
\flow{1}{0}
%\flow{2}{8}
%\node[green_rect, right of = node2-5, node distance=4cm] (node3-5) {1 x 1 Conv};
%\draw[-Triangle, uthickline] ([yshift=3mm]node2-8.north) -| (node3-5);
%\draw[-Triangle, uthickline] (node3-5) |- (node2-2);
\draw[-Triangle, uthickline] ([yshift=3mm]node1-6.north) -| ++(2.5cm, 0) |- (node1-2);
\end{tikzpicture}
\end{document}