NeuroEvolution¶
Neuroevolution, is a form of artificial intelligence that uses evolutionary algorithms to generate artificial neural networks (ANN), parameters, topology and rules.
Encoding the Neural Network¶
Evolutionary algorithms operate on a population of genotypes (also referred to as genomes). In neuroevolution, a genotype is mapped to a neural network phenotype. This process called "Encoding".
Direct Encoding¶
A direct encoding will explicitly specify everything about an individual. If it represents a neural network this means that each gene will directly be linked to some node, connection, or property of the network. This can be a binary encoding of 1s and 0s, a graph encoding (linking various nodes by weighted connections), or something even more complex. The point is that there will always be a direct connection between genotype and phenotype that is very obvious and readable. Examples :
- Connection Matrix
- Node based encoding
- Schiffmann node-based encoding
- Koza node-based encoding
- Pathway based encoding
- Neuroevolution of augmenting topologies (NEAT)
- Simple feedforward network encoding
- Layer based encoding
InDirect Encoding¶
An indirect encoding is the exact opposite. Instead of directly specifying what a structure may look like, indirect encodings tends to specify rules or parameters of processes for creating an individual. As a result, indirect encodings are much more compact. Examples :
- Lindenmayer systems
- Matrix rewriting
- Cellular encoding
- Cellular graph grammars
Note
each encoding type is useful for a type of GANN (Genetic Algorithm Neural Network) problem such us finding best weights, train the NN, update the architecture, etc ...
Basic algorithm¶
- Initialize N random networks to create our population (The encoding problem).
- Train all the NNs simultaneously or one by one.
- Calculate the “fitness” (how well it did in that iteration) of each NN. Fitness will be used to increase the chances of a NN “reproducing.” Higher the fitness, higher is its chance of reproducing (example of fitness : the training cost of NN → lowest cost is better).
- if the optimization criterion is not reached , make a new population
- Select 2 NN
- Crossover on them (depending on Encoding)
- Mutate on them (depending on encoding)
- go to step 2