6
$\begingroup$

I'm aiming to create a neural network that can learn to predict the next state of a board using the rules of Conway's Game of Life.

Technically, I have three questions, but I felt that they needed to be together to get the full picture.

My network will look at each cell individually (to reduce the computing power needed and to increase learning speed) and its surrounding cells. 9 input nodes for the network will go into one hidden layer. The output layer will be one node for the state of that cell in the next state of the game.

Nodes have two states (alive and dead) and connections between nodes can either transfer that value or invert it.

For the learning part, I was going to make use of mutation and natural selection. The starting network will have the input and output layers with no hidden layer and no connections. My idea was then to introduce mutation by randomly generating a number of new networks by adding nodes and randomly connecting them to inputs and to the output. The number of nodes in the middle layer will be limited to 512, since there are 512 possible inputs; however, I may reduce this if it is too slow.

Should I also have it randomly delete nodes and connections, in case they also make improvements?

Each network will be tested on the same board state, and their accuracy will be calculated by comparing their output to a correct output generated by a computer program. The most accurate network will then be used for the next generation.

My issue is that I don't know how to program the nodes. Should the nodes in the hidden layer perform a logical AND on all of their inputs or an OR?

I know that the network won't learn the rules within the first few turns, but how do I know if it will ever get above 90% accuracy, or even just 50%?

$\endgroup$
3
  • $\begingroup$ Since GOL is a deterministic model, is the purpose of this endeavor to predict future board states more efficiently? (i.e. running a GOL gametree is indistinguishable from running the game, in that there is a single node for each ply.) I ask because I find this question quite interesting, but wasn't sure if this process would be applied to GOL, or other models. Welcome to Stack AI! $\endgroup$
    – DukeZhou
    Aug 4, 2017 at 19:28
  • 1
    $\begingroup$ You can cut your maximum number of inputs down to 128 from 512 by recognizing that the rest of the inputs can be generated by rotating the input. [1,1,0] [1,0,1] [0,0,1] rotated 90 = [0,0,1] [1,0,1] [1,1,0] this will require a little preprocessing before the state is fed into the network but shouldn't be too hard to figure out. $\endgroup$ Aug 4, 2017 at 21:26
  • 1
    $\begingroup$ I think you may have a few too many things going on in the same project, I think you should focus on being able to predict the game of life and once you have a network that does this, you can explore natural selection methods. From your question, you want to use natural selection methods to solve this problem but I think you should make a network using other methods before trying the natural selection approach. I say this because it will help you design a network evaluation codebase and then you will have a benchmark to test against. $\endgroup$ Aug 4, 2017 at 21:35

1 Answer 1

2
$\begingroup$

Re: Should I also have it randomly delete nodes and connections, in case they also make improvements?
You may read about "dropout". In this case it's not preferred since overfitting is actually a benefit.

Re: Should the nodes in the hidden layer perform a logical AND on all of their inputs or an OR?
There are no logical operations in Neural Networks. You need to multiply the input by the weights. At the end you will arrive to a fraction number that you need to convert back to 1 or 0, here I suggest to look into "softmax" that is an activation function exactly for this.

Re:how do I know if it will ever get above 90% accuracy, or even just 50%?
As Jaden suggested you will need a benchmark. You may simply take my results from your other post. (i.e 100% in 20 epochs)

I agree with Jaden, you have a lot on your table. Perhaps it would make sense to first develop a DNN to learn the GOL, you will need the activations, the loss calculation and at least one optimizer. Once this is tested and working you could start with the second model for the genetic algorithm that will need a different loss function and also the genetic operations, population selection etc. Nice big project, good luck!

$\endgroup$
1
  • $\begingroup$ A big project yes, but one I have until christmas to complete and write up. $\endgroup$
    – Aric
    Aug 8, 2017 at 13:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .