How Genetic Algorithms Can Compete with Gradient Descent and Backprop
Too Long; Didn't Read
Evolutionary Algorithms are mimicking biological evolution and can be used for non-differentiable functions. When you are using a genetic algorithm, you need DNA that describes an instance and a fitness function that shows how close a given solution is to achieving the set aims. In this article, we will train a simple neural network to solve the OpenAI CartPole game. In the first row, we disable gradient calculation, because we don’t need gradients. The fitness function evaluates the solution, and the return value can be any number. We are generating an initial population with random DNAs with 10 initial solutions.