<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\chapter{Creating a Neural Network for playing GO}
\label{ch:creation}
After discussing work which already has been done, we will go on creating a network
for playing GO. We will start coding an input layer, go on defining rules for hidden layers,
and an output layer.

\section{Coding an input layer structure}
In our given papers the simplest form of coding could be found. Every intersection
could be found in the input layer, which blew up the input sets. Therefore we wanted
to find better possibilities for coding the input layer. Also we want to find out if this takes
affect in the net performance. We do not include the simplest form of coding in the final
net, but we will use it as reference later. \\ \\
The simplest form of coding would just take every intersection, calculate a value for it, and
give the whole set to the net. The value could be everything, what identicates correctly the
different possibilities (emtpy, black, white) for an intersection.

\subsection{First possibility}
Divide the board into a number of pieces of equal size. E.g. a 9x9 board
could be split up into nine parts of 3x3 or 27 parts of 3x1.

For each board sector a value is calculated depending on where black or white
stones can be found. E.g. in a 3x1 sector there are $3^{3}=27$ possibilities
of placing stones. Set EMPTY = 0, BLACK = 1, WHITE = 2 and calculate the
value by converting the resulting base-three-number into decimal system. In our
3x1 sector [EMPTY, WHITE, WHITE] means $220_{3} = 24_{10}$.

As can be seen, larger
sectors may be inefficient, as the neural network believes completely different
patterns to be quite similar. So in a 3x3 there are $3^{9} = 19683$ possible patterns. Assuming that
the lower right corner of the sector is valued by $3^{0}$, the patterns value in decimal System varies
only by a maximum of two - no matter if the position in question is EMPTY, BLACK or WHITE.
\vspace{.75cm}
\newline
Example:

\begin{verbatim}

Pattern 1

[BLACK,BLACK,WHITE,
 EMPTY,WHITE,WHITE,
 BLACK,EMPTY,WHITE]

\end{verbatim}
means $112022102_{3} = 10433_{10}$

\begin{verbatim}

Pattern 2

[BLACK,BLACK,WHITE,
 EMPTY,WHITE,WHITE,
 BLACK,EMPTY,BLACK]

\end{verbatim}
means $112022101_{3} = 10432_{10}$
\vspace{.5cm}

As easily can be seen two quite different patterns result in nearly equal
decimal values. The network will hardly be able to distinguish between the
two samples.
\subsection{Second possibility}
In order to develop a go program based on neural networks that plays at a reasonable level,
it seems necessary to provide additional data to the input layer, than simply supplying the
position of each stone on the board.
Therefore each piece could be assigned a sphere of influence. Instead of just marking the
particular board position with either 1 or -1 (depending on the player) , a higher value
like +/-50 would be used and radiated to surrounding fields in a decreasing manner.
The representation of a single white stone at position c3 is shown in picture
\ref{img:singlewhitestone}
\begin{figure}[!h]
	\label{img:singlewhitestone}
	\begin{center}
		\includegraphics[width=7cm]{stone-board_c3.eps}
		\includegraphics[width=7cm]{inf-board_c3.eps}
	\end{center}
	\caption[Input Layer coding situation two]{Representation of a single white stone}
\end{figure}
If black moves to b2, we get the situation shown in picture \ref{img:blackwhitestone}
\begin{figure}[!h]
	\label{img:blackwhitestone}
	\begin{center}
		\includegraphics[width=7cm]{stone-board_c3_b2.eps}
		\includegraphics[width=7cm]{inf-board_c3_b2.eps}
	\end{center}
	\caption[Input Layer coding situation two]{Black stone set to b2}
\end{figure}
Now let's suppose white places its stone at c2, this would result in the situation shown
in picture \ref{img:whiteblackwhitestone}
\begin{figure}[!h]
	\label{img:whiteblackwhitestone}
	\begin{center}
		\includegraphics[width=7cm]{stone-board_c3_b2_c2.eps}
		\includegraphics[width=7cm]{inf-board_c3_b2_c2.eps}
	\end{center}
	\caption[Input Layer coding situation two]{White stone set to c2}
\end{figure}

You can see that the influence and probable territory in the second situation is well
balanced, but as soon as white moves to c2 to threaten the opponent's stone, black's
control is driven back to the upper left corner.
As a result the net should be able to extract more information from a given game situation.

This method was first outlined 1971 by Jon Ryder, though as basis for an expert system
rather than a neural network.

Another issue of evolving a go playing neural network is the bad scalability of this
approach to larger boards such as 19x19. To circumvent this problem, small groups
of 2x2 or 3x3 fields could be represented by a weighted value. This scaled down version
of the board would be presented to an evolved network, which should then indicate
which group yields the greatest potential for a good move.
Each field in the proposed area is further investigated by a second, standard feedforward
net that is specialised on guessing how clever a move to a specific position would be
considering only the near environment. In contrast to the  first network, the input units
are fed with a subset of the game board (for example 5x5 fields with the centre being the
position that is to be investigated), but therefore in full detail. The input is then projected
onto only one output unit indicating the strength of this particular move. Training could be
accomplished with a set of recorded go matches from professional players by a
backpropagation algorithm.

Using a 2x2 field subdivision and a weighting function that simply calculates the mean
value of each group could give the representation in picture \ref{img:groupboard}
containing the situation shown in picture \ref{img:blackwhitestone}
\begin{figure}[!h]
	\label{img:groupboard}
	\begin{center}
		\includegraphics[width=7cm]{group-board_c3_b2.eps}
	\end{center}
	\caption[Input Layer coding situation two]{Grouping the board situation}
\end{figure}
If the first net suggested a move to quadrant B1, the fields c1, d1, c2, d2 and their
surroundings are  subsequently presented to the second network for evaluation. In case
position c2 is being considered as in picture \ref{img:subblackwhitestone}.
\begin{figure}[!h]
	\label{img:subblackwhitestone}
	\begin{center}
		\includegraphics[width=7cm]{stone-board_c3_b2.eps}
		\includegraphics[width=7cm]{inf-board_sub_c3_b2_c2.eps}
	\end{center}
	\caption[Input Layer coding situation two]{c2 is being considered for move}
\end{figure}
The fields marked "OB" in the above illustration denote that they are off the board.
This procedure yields four values, from which the highest will be picked for the next move
(ideally this should be the one representing c2).

\subsection{Third possibility}
\begin{figure}[!h]
	\label{img:inputselection}
		\begin{center}
		\includegraphics[width=9cm]{input_selection.eps}
	\end{center}
	\caption[Input Selection]{How to transform an uneval board situation to a correct section}
\end{figure}
Another possibility to code a given board situation is,  to divide the board in 4 sections. Then
you will have to find the section where the most actions takes place. By this, I mean the
section which contains the biggest variety of black, white and blank setted intersections. We calculate
a value for the remaining three sections, by just representing a value for the difference
between the possible stones and including a factor for free fields. We could take, for example
one of the above possibilities. So we get a blurred view over the three sections.
With the remaining fourth section we do not calculate at all, but set every stone into the resulting
input set. One problem will gather when the board length is not eval. For example if we have
a 9x9 board we have to ensure, that every section has the same size.
See \ref{img:inputselection} for an example how to do this. \\ \\
Also if we have similair activity in 2 sections, we will have to choose one randomly.
By doing this, we want to focuss the \ANN \ to play an aggressive game. We just assume, that
most points can be achieved in the section were the most action takes place, instead of setting
stones in the-middle-of-nowhere. In a second stage we could just set a magnifying glass on
the board situation with the most action. For example, we focuss the input data on the last
stone position of out opponent. We just want to keep secured the fact, that the board doesn't
calculate board positions which would led to a defeat.
</pre></body></html>