-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathfigure6-6-padding.tex
More file actions
58 lines (49 loc) · 1.97 KB
/
figure6-6-padding.tex
File metadata and controls
58 lines (49 loc) · 1.97 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
52
53
54
55
56
57
58
\documentclass[tikz, border=50pt]{standalone}
\usepackage{tikz}
\usepackage{medl_colors}
\usepackage{amsmath,xstring}
\usepackage{ifthen}
\usepackage{moresize}
\usetikzlibrary{shapes.multipart, shapes.geometric, arrows.meta}
\usetikzlibrary{matrix, calc, positioning,fit, backgrounds}
\begin {document}
\begin{tikzpicture}[every node/.style={minimum size=1cm},on grid]
\begin{scope}%[every node/.append style={yslant=0.3},yslant=0.3]
\newcommand\slantarray[7]{
\foreach \i in {1,...,#3}{
\foreach \j in {1,...,#4}{
\IfEq{#5}{0}
{
\ifthenelse{\j=#4 \OR \i=#3 \OR \j=1 \OR \i=1 }
{
\node (node-#7\i\j) at (#1+\i-.5, #2-\j+.5) {\large $#5$};
}
{
}
}
{
\node (node-#7\i\j) at (#1+\i-.5, #2-\j+.5) {\large $#5_{\j,\i}$};
}
}
}
\draw[#6, ultra thick] (#1,#2) grid[step=1] (#1+#3, #2-#4) ;
}
\begin{scope}[yshift=.5cm]
\slantarray{2}{2}{3}{3}{w}{border-grey}{1};
\end{scope}
\slantarray{0}{-3}{7}{6}{x}{border-grey}{2};
\slantarray{10}{-2}{9}{8}{0}{border-red}{3};
\slantarray{11}{-3}{7}{6}{x}{border-grey}{4};
\slantarray{21}{4}{7}{6}{z}{border-grey}{5};
\node at (3.5,-1.5) {\Huge $W$};
\node at (3.5,-10) {\Huge $x$};
\node at (15,-11) {\Huge $x$ with padding};
\node at (24.5,-3) {\Huge $z$};
\node [thickline, circle] at (14.5,1) (circle) {\Huge $\star$};
\draw[-Triangle, thickline, line width=.7mm] (node-273)+(7mm,-5mm) -- ([xshift=-2mm, yshift=-5mm]node-314.west) node[pos=.5, below] {\Large Padding};
\draw[-Triangle, thickline, line width=.7mm] (node-132)+(7mm,0mm) -- ([xshift=-2mm]circle.west) {};
\draw[Triangle-, thickline, line width=.7mm] (node-513)+(-7mm,-5mm) -- ([xshift=2mm]circle.east) {};
\draw[-Triangle, thickline, thick, line width=.7mm] (node-351)+(0mm, 7mm) -- ([yshift=-2mm]circle.south) {};
\end{scope}
\end{tikzpicture}
\end{document}