This repository contains a basic neuroevolution that evolves the weights of a multi-layer perceptron (MLP) using a genetic algorithm. This solution utilises DEAP, a novel evolutionary computation framework for rapid prototyping and testing of ideas.
The final algorithm proposed is a conventional neuroevolutionary algorithm (CNE). The topology of the network is fixed in nature and only the weights of the network are evolved in the algorithm.
The network used is a fully-connected multi-layer perceptron with 2 hidden layers. The input layer has 10 nodes that represent local searches for food & obstacles in the cells immediately above, below, left, and right of the snake, as well as the direction of the food in the x & y axis
Before deciding on the final algorithm two different experiments were run to determine the most successful variants of the algorithm. One experiment looked at different combinations of inputs to the neural network, and the other looked at modifying the probabilities of crossover and mutation.
Due to the stochastic nature of genetic algorithms, each algorithm variant was run multiple times and the statistics averaged. This produced more rigorous results so that reliable and informed decisions could be made. Each experiment had 2 stages, the exploration stage, and a final stage. The exploration stage used 5 iterations of each algorithm to explore a wide range of alterations. The final stage used 15 iterations of each algorithm to analyse the best two variants found in the exploration stage.
All code submitted as part of the first assessment in the module Evolutionary and Adaptive Computing (EVAC) at the University of York.