I want to make a Connect 4 AI using machine learning, but I'm a complete beginner to the topic. From what I've seen, an ANN is a way to go. Some phrases I've heard are "neuroevolution" and the acronym NEAT. I'm very confused.

How do you choose the number of neurons, synapses, and hidden layers of an ANN (in NEAT)?


To find the number of neurons and layers that you will use is not that straightforward. The best way to do this is through experimentation however you will be able to better estimate the number of layers and neurons needed through experience. One of the common rules is that more neurons are better for more complex datasets. However, you do not want too many or you will get an overfitted model.

As for NEAT, that stands for neuron evolution of augmenting topologies. This is a genetic algorithm that works fairly well, however, I would recommend that you use a different algorithm like Q-learning. If you wish to learn more about Q-learning, then I would definitely recommend that you check out Google's DeepMind research on training deep neural networks to play the game of Go using Q-learning.


I agree with Aiden Grossman that perhaps you should try another algorithm before messing with NEAT, as NEAT is fairly complex. However, I thought I might explain the benefits of NEAT as they pertain to the second part of your question.

The NEAT method is from a paper written by Kenneth O. Stanley and Risto Miikkulainen titled Evolving Neural Networks through Augmenting Topologies. NEAT is interesting for a number of reasons, but one of the biggest advantages of it is that the topology is dynamic. What this means is that the number of neurons in each layer and the number of layers changes as we move through generations. We do not even choose an original number of hidden layers and neurons as we want to start with a minimal topology to avoid having portions of our neural network that haven't had to withstand any testing.

Again, I don't believe NEAT is a great starting point for understanding machine learning. Perhaps you might want to look at binary classifiers, decision trees, or the perceptron to gain a general understanding of the field before progressing to more complex methods.

  • $\begingroup$ Wonderful answer--really appreciate the perspective and explanation of the dynamic topology. Thanks for contributing! $\endgroup$ – DukeZhou Mar 6 '18 at 17:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.