-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathfigure5-11-dropout.tex
More file actions
111 lines (95 loc) · 3.09 KB
/
figure5-11-dropout.tex
File metadata and controls
111 lines (95 loc) · 3.09 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
\documentclass[tikz, border=50pt]{standalone}
\usepackage{tikz}
\usepackage{medl_colors}
\usepackage{amsmath,xstring}
\usepackage{ifthen}
\usetikzlibrary{shapes.multipart, shapes.geometric, arrows.meta}
\usetikzlibrary{matrix, calc, positioning,fit}
\begin {document}
\begin{tikzpicture}
% type of circles in every node
\def\circleorder{{{1,3,4,0},{2,4,3,0},{2,3,4,5},{1,3,3,0},{1,4,4,0}}}
\def\circleAorder{{{1,4,4,0},{1,4,4,0},{1,4,4,5},{1,4,4,0},{1,4,4,0}}}
\newcommand\circlecolor[5]
{
\node[#5, circle, minimum size = .7cm] (#4) at (#2,#3) {#1};
}
\newcommand\circlecross[4]
{
\node[thickline, circle, minimum size = .7cm] (#4) at (#2,#3) {#1};
\begin{scope}
\clip(#2, #3) circle(.5cm);
\draw[draw=border-red, ultra thick] (#2-1/2, #3+1/2) -- (#2+1/2, #3-1/2);
\draw[draw=border-red, ultra thick] (#2+1/2, #3+1/2) -- (#2-1/2, #3-1/2);
\end{scope}
}
\foreach \i in {0,1,2,3,4}
{
\foreach \j in {0,1,2,3}
{
\pgfmathparse{int(\i+1)} \edef\pval{\pgfmathresult};
%First set on the left
\pgfmathparse{int(\circleAorder[\i][\j])} \edef\acase{\pgfmathresult};
\IfEq{\acase}{1}%
{
\circlecolor{\Large $x_\pval$}{\j*2}{-\i*2}{A\i\j}{greenshape};
}{}
\IfEq{\acase}{4}%
{
\circlecolor{}{\j*2}{-\i*2}{A\i\j}{blueshape};
}{}
\IfEq{\acase}{5}%
{
\circlecolor{}{\j*2}{-\i*2}{A\i\j}{redshape};
}{}
%second set - on the right
\pgfmathparse{int(\circleorder[\i][\j])} \edef\pcase{\pgfmathresult};
\IfEq{\pcase}{1}%
{
\circlecolor{\Large $x_\pval$}{10+\j*2}{-\i*2}{B\i\j}{greenshape};
}{}
\IfEq{\pcase}{2}%
{
\circlecross{\Large $x_\pval$}{10+\j*2}{-\i*2}{B\i\j};
}{}
\IfEq{\pcase}{3}%
{
\circlecross{}{10+\j*2}{-\i*2}{B\i\j};
}{}
\IfEq{\pcase}{4}%
{
\circlecolor{}{10+\j*2}{-\i*2}{B\i\j}{blueshape};
}{}
\IfEq{\pcase}{5}%
{
\circlecolor{}{10+\j*2}{-\i*2}{B\i\j}{redshape};
}{}
}
}
\foreach \i in {0,1,2,3,4}
{
\foreach \j in {1,2,3}
{
\foreach \k in {0,1,2,3,4}
{
\pgfmathparse{int(\j-1)} \edef\in{\pgfmathresult};
%arrows for left set
\pgfmathparse{int(\circleAorder[\k][\j])} \edef\acp{\pgfmathresult};
\ifthenelse{\acp=0}{}
{
\draw[-Triangle, line] (A\i\in) -- (A\k\j);
}
%arrows for right set
\pgfmathparse{int(\circleorder[\i][\in])} \edef\cr{\pgfmathresult};
\pgfmathparse{int(\circleorder[\k][\j])} \edef\cp{\pgfmathresult};
\ifthenelse{\cr=1 \OR \cr=4 \OR \cr=5}{
\ifthenelse{\cp=1 \OR \cp=4 \OR \cp=5}{
\draw[-Triangle, line] (B\i\in) -- (B\k\j);
}{}
}{}
}
}
}
\draw [-Triangle,line, double] ([xshift=.3cm]A23.east) -- ([xshift=-.3cm]B20.west) node[pos=.5, above] {\Large dropout};
\end{tikzpicture}
\end {document}