neated 1.0.2 neated: ^1.0.2 copied to clipboard
NeuroEvolution of Augmenting Topologies Expressed in Dart!
NeuroEvolution of Augmenting Topologies Expressed in Dart! Create and evolve a neural net for solving all (or at least some) of life's hard problems.
Features #
- Serialize your neural net to save and restore
- Doesn't require the tracking of innovation numbers, meaning you can run disconnected and still crossover later
- Includes the mutation of activation functions
Getting started #
- Create a Neural Network with a certain number of inputs/outputs
- Generate a new generation
- Iterate through each genome of the generation
- Set the inputs and call update, then get the outputs
- Set the fitness of each genome and set it's fitness
- Go back to Step 2 and continue until the fitness is good enough
Usage #
Here's an example of teaching a network to count from 0 to 9
var nn = NeuralNet(0, 1);
nn.createNextGeneration();
num currentFitness = 0;
for (int i=0; i<100; i++) {
for (var g in nn.currentGeneration) {
num fitness = 0;
for (int i=0;i<10;i++) {
var target = i;
g.update();
var result = g.getOutputs().toList().single;
fitness += Activation.gaussian(result - target);
}
g.fitness = fitness;
}
nn.createNextGeneration();
}