Newer
Older
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
\subtitle{Artificial Intelligence}
\date{Monday, 21 May 2018}
\tikzset{
treenode/.style = {align=center, inner sep=0pt, text centered,
font=\sffamily},
arn_n/.style = {treenode, circle, white, font=\sffamily\bfseries, draw=black,
fill=black, text width=1.5em},% arbre rouge noir, noeud noir
arn_r/.style = {treenode, circle, red, draw=red,
text width=1.5em, very thick},% arbre rouge noir, noeud rouge
arn_x/.style = {treenode, rectangle, draw=black,
minimum width=0.5em, minimum height=0.5em},% arbre rouge noir, nil
box/.style = {draw, align=center, text centered, rectangle, draw=black, minimum height=1.25cm, minimum width=2cm}
}
\DeclareMathOperator*{\argmax}{arg\,max}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}{Artificial Intelligence}
\begin{itemize}
\item Production Rule Agents
\item Monte-Carlo Tree Search
\item Genetic Algorithms
\item Neural Networks
\end{itemize}
\end{frame}
\begin{frame}[fragile]{Production Rule Agents}
\begin{minted}[breaklines,tabsize=2,fontsize=\footnotesize]{Java}
@FunctionalInterface
public interface Rule
{
default boolean canFire(int playerID, GameState state)
{
return execute(playerID, state) != null;
}
Action execute(int playerID, GameState state);
}
\end{minted}
\end{frame}
\begin{frame}{Production Rule Agents}
\begin{tikzpicture}[]
\node[state,initial] (0) {\tiny Pop next rule};
\node[state] (1) [above right=of 0] {\tiny Check if fires};
\node[state,accepting] (1y) [above =of 1]{\tiny Return action};
\node[state] (2) [below right=of 1] {\tiny Rule Remaining};
\node[state, accepting] (3) [right= of 2] {\tiny Return null};
\path[->]
(0) edge [bend left] node [ above] {} (1)
(1) edge node [left] {\tiny Yes} (1y)
(1) edge [bend left] node [ below] {\tiny No} (2)
(2) edge [bend left] node [ below] {\tiny Yes} (0)
(2) edge [bend left] node [ below] {\tiny No} (3);
\end{tikzpicture}
\end{frame}
\begin{frame}{Production Rule Agents}
\begin{center}
\includegraphics[scale=0.175]{hanabiBuilder}
\end{center}
\begin{block}{Exercise}
\href{http://hanabi.fosslab.uk/builder.html}{Try it out!}
\note{
Do live demo -
First Agent
\begin{enumerate}
\item Play If Certain
\item Tell Randomly
\item Discard Randomly
\end{enumerate}
Second Agent
\begin{enumerate}
\item Play Probably Safe Card: 0.8
\item Tell Randomly
\item Discard Randomly
\end{enumerate}
Place Discard at top of order and run. Order of rules important
}
\end{block}
\end{frame}
\begin{frame}[fragile]{Monte-Carlo Tree Search}
\begin{center}
\begin{tikzpicture}[->,>=stealth',level/.style={sibling distance = 5cm/#1,
level distance = 1.5cm},scale=1,every node/.style={transform shape}]
\node [arn_n] {0}
child{
node [arn_r] (c1) {0}
child{ node [arn_n] (c) {0} edge from parent node[above left] {Tell 1}}
child{ node [arn_n] (d) {1} edge from parent node[above right] {Play 1}}
edge from parent node[above left] {Tell 1}
}
child{ node [arn_r] {0}
child{ node [arn_n] (a) {0} edge from parent node[above left] {Tell 1}}
child{ node [arn_n] (b) {1} edge from parent node [above right] {Play 1}
}
edge from parent node [above right]{Discard 1}
}
;
\path (a) -- (b) node [midway] {$\cdots$};
\path (c) -- (d) node [midway] {$\cdots$};
\end{tikzpicture}
\end{center}
\end{frame}
\begin{frame}{Monte-Carlo Tree Search}
\begin{itemize}
\item Selection
\begin{itemize}
\item $\argmax_i f(i) = \frac{w_i}{n_i} + c\sqrt{\frac{\ln N_i}{n_i}} $
\end{itemize}
\item Expansion
\item Simulation
\item Back-propagation
\end{itemize}
\end{frame}
\begin{frame}{Genetic Algorithms}
\begin{tikzpicture}
\node[box](init) at (-1, 0){Initial \\ Population};
\node[box](decode) at (2, 0){Decode \\ Population};
\node[box](fitness) at (5, 0){Calculate \\ Fitness};
\node[box](selection) at (8, 0){Selection};
\node[box](cross) at (8, -2.5){Crossover};
\node[box](mutate) at (8, -5){Mutation};
\node[box](newPop) at (2, -5){New Population};
\path[->]
(init) edge [] node [] {} (decode)
(decode) edge [] node [] {} (fitness)
(fitness) edge [] node [] {} (selection)
(selection) edge [] node [] {} (cross)
(cross) edge [] node [] {} (mutate)
(mutate) edge [] node [] {} (newPop)
(newPop) edge [] node [] {} (decode)
;
\end{tikzpicture}
\end{frame}
\end{document}