Gargle Zndflxtzyh wrote:
> any ideas of what a good layout of neurons should be?
>
> my initial thought is:
> for each slot on the board have
> 1 neuron to represent empty,
> 1 neuron to represent 1 piece and
> 1 neuron to represent 23 and perhaps 1 neuron to represent 4+ pieces
>
> (the last one might not be necessary).
>
> is this way off?
Something about your answer makes me think there might be some
confusion as to what a neuron is, so I figured I should write
a note to define the terms. If you knew this all along, then
I figure that maybe someone else will benefit.
A neural network consists of 3 types of elements:
1) Inputs, which describe the state of a system (like the
board configuration in a backgammon application),
2) Outputs, which are trained to approximate some important
measure of the system (like winning and gammon chances in
a backgammon application), and
3) Neurons, which are computational elements. These transform
the inputs into the outputs by a form of magic that is rarely
humanly understandable.
I have one paragraph for the computationally inclined:
A neuron typically takes the form Logistic(Summation(Constant * Input)),
where Logistic is the function 1 / (1 + exp(x)). In words: a neuron
is a linear sum of inputs "squashed" by a function whose output is
bounded. If you want to generalize this concept, you can change the
squashing function to something else (tanh is equivalent to logistic,
but an interesting choice is erf(), the Gaussian error function), or
you can allow the linear sum to include the results of other neurons.
Now, the reason that I figure you misunderstand the term "neuron"
is that you are describing how to encode the board position, which
means that you are talking about Inputs, rather than Neurons.
To respond to your actual question about whether this is a good
encoding: Yes, it is. Gerald Tesauro published a paper quite a while
ago (I think it was in the journal "Artificial Intelligence" around
1989) about the precursor to TDGammon, named Neurogammon. The
Neurogammon feature set allocated inputs as follows:
1 boolean input, set if Black has a blot on this point,
1 boolean input, set if Black has a block (2 or more men),
1 boolean input, set if Black has exactly 3 men on this point,
1 boolean input, set if Black has exactly 4 men on this point,
1 integer input, set to the number of men beyond 4 on this point.
There are 5 inputs per side per point. There are 24 points, plus the
bar (one bar for each color). I don't remember how Tesauro handled
men borne off, nor how he handled the side to move.
Tesauro supported his method by comparing it to another system of
inputs. He also argued that this system contains a lot of semantic
content (the concepts Blot, Block, Builder, and Overloaded are
inherent in the inputs), and so neural network capacity does not
need to be devoted to identifying those features.
Note that this input set, by itself, is not sufficient to play a
strong game. Tesauro's best program using this feature set played at
a "strong intermediate" level. This basically means that the program
would clobber a novice, but it still makes lots of errors.
Tesauro's feature set for TDGammon has never been published, since
IBM regards it to be a trade secret. But you have to figure it
contains a few strategic concepts (e.g. the safeplayversusbold play
criteria from Magriel) and tactical factors (like counts of shots
or pointmaking rolls). There is a lot of scope for creativity here.
Best Wishes,
Brian
