Neural Network Design

sumedhs 101 Nov 02, 2004 at 04:14

Hello to a wonderful forum.
I want to design a NN for a game 3D Tic Tac Toe & I was looking for some help.

The specs of the game are:
1] 3*3*3 cube which makes 27 places for either players (Human or NN) to put a Cross (X) or a Zero (0)
2] As contrast to 2D Tic Tac Toe, the game does not stop when the first line is made. The winner is the one who makes the most lines of his own (X or O).

I was thinking of an input layer with 27 input neurons (Input Board state) where {X, O , Empty} are equal to {1,-1,0}. And the output layer is again 27 neurons. At the out put if we want to determine the move for “O” we take the least value from the outputs & if we want to take the output for “X” we take the most +ve value.
Any thoughts or even a new design is appreciated.

4 Replies

Please log in or register to post a reply.

NomadRock 101 Nov 02, 2004 at 04:31

It’s worth a shot. At minimum it should provide some good experience for you.

I remember that one can use a magic square to evaluate tic tac toe boards, but is there such a think as a magic cube for 3d games?

ShadowHawk 101 Nov 02, 2004 at 08:28

Well it is not the best problem for a NN since u have a 3 state for input. A field can be either X || O || empty. So u need at least 2 neurons per input i dont think that neural nets work correclty with states that are not boolean but that is just my experience with them.
The ouput of 27 is good enough btw. The problem here is how many hidden layers do u expect that u need and how many neurons will be in each of these layers.
That is the hard part and can be solved only by some good guessing or the NEAT genome approch which will generate the net for you ( and is somewhat harder to implement )
I tried it for a simple 3X3 game and only to determine it there was a winner but that is of course a lot easier.
Just dont do this project as your first NN project it is to complex imo to start with. It would be wiser if it was your first project to do something simpler like the project i did 3X3 only determine who has won. Since the number of hiddel layers and hidden neurons is a lot smaller and u have the chance to debug your neural network code that way.

NomadRock 101 Nov 02, 2004 at 11:45

Shadow hawk is right in saying that you should start with something smaller. I assume you had already made a neural net yes? If not, you should start with something extremely simple that makes debugging easy as ShadowHawk said. That way you can make sure your code is good.

Generally you will want to limit yourself to boolean inputs and outputs as this makes things easier, but this is not the only way. For example People have trained a network with inputs matching outputs for words, and used a very small hidden layer. Then after the network was trained, they could use the output of the hidden layer directly resulting in having a very small encoded version of the word. It was shown that this version could be manipulated by other neural nets for example finding the plural version of an english word, and then it could be decoded with the last half of the origional neural net with successful results. Obviously the input to and output from these secondary manipulating nets was not boolean in any way. This experiment showed that data in the human brain may easily be encoded to minimize the required ammount of neurons.

Ok, I really should write up an article on this stuff.

sumedhs 101 Nov 13, 2004 at 05:37

Ah… well this is not my first project on NN & certainly not my first project in AI. Been doing this in Graduation & Post Graduation.
I agree that its a good idea to keep the NN inputs as Boolean, but as NomadRock says, if we increase the design complexity & number of hidden Layers, this does work. I have myself used NN in classifier networks which takes integer values, but ofcourse it took a whole lot of time to train & it had a much more complex Hidden Layer. In fact it took us 3 days of server CPU time for the NN to converge & data set more than 10,00,000 entries, but yes it did converge & it did give results.
Here I dont to keep it that complex. But I want to stick to the game.
2D tic tac toe is fairly easy game, in fact some of its inherent problems itself make it a bad choice, like the game is biased towards the first player & so on.
I had heard about evolving NNs or NNs that can modify their own topology as the input biases change. Anybody having any idea about that?