|
3 Applications
There are many many different applications for ANNs. We will describe
only two: one about playing a game and one about controlling a vehicle.
3.1 Encoding the inputs and outputs
Before applying an ANN, some attention needs to paid to how the input
and outputs of the ANN are to be used. Note that both inputs and
outputs are real numbers, and that each output is limited to the
interval [0,1].
If the application requires the output to be a single integer, how are
the outputs of the ANN to be used? One possiblity is to round a single
output from the ANN to the nearest integer. However if the integer is
itself a code for a set of unorded values, then perhaps it is better
to have one output for each of these unordered values; the output of
the ANN is then interpreted as the output with the largest value.
As another example, the outputs can be intepreted as estimated
probabilities. If the probabilities must sum to one, then the outputs
from the MLP will require normalising. These probabilities may be used
as the basis for sampling from a set of disctinct objects (one per
output).
These issues surrounding the input and output coding of the ANN are
often key choices affecting the success of failure of its application.
3.2 The game of Nim
Nim is a simple game, trivial for a game theorist, but used here to
illustrate how an ANN may be used to play a game.
Two players begin the game with 15 "beans". They take turns removing
beans. On each turn a player may remove 1, 2 or 3 beans. He must
remove at least one, and may not take more than 3. The player
removing the last bean loses.
A player of Nim must be able to decide what to do when presented with
15, or 14, or 13, etc. beans down to two beans. This decision could
be in the form of a simple table, and in fact the following table
shows how to play the most perfect game possible:
| remainder: |
15 | 14 | 13 | 12 | 11 | 10 |
9 | 8 | 7 | 6 | 5 | 4 |
3 | 2 |
| take away: |
2 | 1 | x | 3 | 2 | 1 |
x | 3 | 2 | 1 | x | 3 |
2 | 1 |
A player following this strategy will always win if he has the first
move. If the opponent has the first move, and if the opponent deviates
from this table, then the player will also win. If both follow the
table exactly then the player who goes first always wins. The x means
that it doesn't matter; you will lose anyway. Actually this is true
only if the opponent plays perfectly. If the opponent does not follow
this table, then some values of x would be better than others, but
this would depend upon the opponent's behaviour.
To use an ANN to play Nim, we will need to encode the input to
represent the state of the game, and encode the output to represent
the desired move. One possibility is to encode the input as a single
neuron accepting an integer between 2 and 15 inclusive, and the output
as a single neuron interpreted as one of (1,2,3) depending upon the
closest of (0,0.5,1) respectively.
3.2 Robotic vehicle control
Another example is robotic vehicle control. Suppose there is some
kind of autonomous vehicle, like a mars lander, that has sensors to
measure its speed, direction, and distance from each of three radio
beacons. These 5 measurements could be the inputs to an ANN. The
outputs of the ANN could control the steering wheels and drive motors
of the vehicle in order to accomplish some type of pre-defined
objective, such as returning home to a recharging station.
Back to top. >>>
Continue with the tutorial. >>>
|