You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+130-9
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,21 @@
1
1
# neat-ml
2
2
An implementation of the NEAT (Neuroevolution through augmenting topologies) algorithm in Java. Originally found at http://nn.cs.utexas.edu/downloads/papers/stanley.ec02.pdf
3
3
4
+
## Features
5
+
**Fully* documented code base ideal for learning and people new to the subject
6
+
* Super friendly highly abstracated interfaces that hide the implementation details so you can focus on your use case
7
+
* Friendly implementations of both genotypes and phenotypes
8
+
* All you need to worry about is inputs, outputs and fitness!
9
+
* Multi-threading support for concurrent genotype evaluation just by specifying the number of worker threads
10
+
* Neural network visualiser to create images so you can see what networks are being created
11
+
* Full serializing and deserializing support using [google's protobuf](https://developers.google.com/protocol-buffers), allowing you to save interesting genotypes (networks) or even save your training progress to disk!
12
+
4
13
## Quick start
5
14
This library has been built with the intention of making it as easy as possible to add NEAT to any project - without the need for deep understanding of how NEAT works.
6
15
7
16
Take the following quick example that shows how to use this library to learn the XOR function:
8
17
9
-
**TLDR**
18
+
**TLDR**
10
19
* a little bit of config
11
20
* create evolution (all the hard work has been done for you!)
12
21
* Write the evaluator for a genotype
@@ -34,17 +43,17 @@ public class LearnXor {
34
43
finalint populationSize =100;
35
44
finalint targetNumSpecies =5;
36
45
finalint numProcessingThreads =8;
37
-
46
+
38
47
// Create a new optimisation with 2 inputs and 1 output
You are then free to handle the standard java `BufferedImage` as you see fit. However, if you want to write the image to you disk you can utilise this library's function:
You can save a particular network genotype for later use. This could be so that you can keep track of the best/most interesting individuals and have them evaluate without the need for training. This is a great utility that has many uses: for example embedding in games as the AI!
Note that these networks are genotypes, not phenotypes. You will need to create them *in the same way as you did when training* before you can use them:
With this library comes the very powerful ability to stop training (evolving), save your progress and resume training again at a later date without losing progress.
This does actually give you the ability to define a new Evaluator (and the other params passed into `evolutionFromFile`) midway through training. This is normally not recommended, but can actually be very useful for some incremental learning techniques.
<li><ahref="jwblangley/neat/phenotype/Activation.html" title="enum in jwblangley.neat.phenotype" target="classFrame">Activation</a></li>
16
+
<li><ahref="jwblangley/neat/genotype/ConnectionGenotype.html" title="class in jwblangley.neat.genotype" target="classFrame">ConnectionGenotype</a></li>
17
+
<li><ahref="jwblangley/neat/util/DisjointExcess.html" title="class in jwblangley.neat.util" target="classFrame">DisjointExcess</a></li>
18
+
<li><ahref="jwblangley/neat/evolution/Evaluator.html" title="interface in jwblangley.neat.evolution" target="classFrame"><spanclass="interfaceName">Evaluator</span></a></li>
19
+
<li><ahref="jwblangley/neat/evolution/Evolution.html" title="class in jwblangley.neat.evolution" target="classFrame">Evolution</a></li>
20
+
<li><ahref="jwblangley/neat/evolution/EvolutionFactory.html" title="class in jwblangley.neat.evolution" target="classFrame">EvolutionFactory</a></li>
21
+
<li><ahref="jwblangley/neat/util/ImmutableHomogeneousPair.html" title="class in jwblangley.neat.util" target="classFrame">ImmutableHomogeneousPair</a></li>
22
+
<li><ahref="jwblangley/neat/evolution/InnovationGenerator.html" title="class in jwblangley.neat.evolution" target="classFrame">InnovationGenerator</a></li>
23
+
<li><ahref="jwblangley/neat/phenotype/InputNeuron.html" title="class in jwblangley.neat.phenotype" target="classFrame">InputNeuron</a></li>
24
+
<li><ahref="jwblangley/neat/phenotype/Network.html" title="class in jwblangley.neat.phenotype" target="classFrame">Network</a></li>
25
+
<li><ahref="jwblangley/neat/genotype/NetworkGenotype.html" title="class in jwblangley.neat.genotype" target="classFrame">NetworkGenotype</a></li>
26
+
<li><ahref="jwblangley/neat/phenotype/Neuron.html" title="class in jwblangley.neat.phenotype" target="classFrame">Neuron</a></li>
27
+
<li><ahref="jwblangley/neat/genotype/NeuronGenotype.html" title="class in jwblangley.neat.genotype" target="classFrame">NeuronGenotype</a></li>
28
+
<li><ahref="jwblangley/neat/genotype/NeuronLayer.html" title="enum in jwblangley.neat.genotype" target="classFrame">NeuronLayer</a></li>
29
+
<li><ahref="jwblangley/neat/proto/ProtoEquivalent.html" title="interface in jwblangley.neat.proto" target="classFrame"><spanclass="interfaceName">ProtoEquivalent</span></a></li>
30
+
<li><ahref="jwblangley/neat/proto/ProtoIO.html" title="class in jwblangley.neat.proto" target="classFrame">ProtoIO</a></li>
31
+
<li><ahref="jwblangley/neat/evolution/Species.html" title="class in jwblangley.neat.evolution" target="classFrame">Species</a></li>
32
+
<li><ahref="jwblangley/neat/visualiser/Visualiser.html" title="class in jwblangley.neat.visualiser" target="classFrame">Visualiser</a></li>
<li><ahref="jwblangley/neat/phenotype/Activation.html" title="enum in jwblangley.neat.phenotype">Activation</a></li>
16
+
<li><ahref="jwblangley/neat/genotype/ConnectionGenotype.html" title="class in jwblangley.neat.genotype">ConnectionGenotype</a></li>
17
+
<li><ahref="jwblangley/neat/util/DisjointExcess.html" title="class in jwblangley.neat.util">DisjointExcess</a></li>
18
+
<li><ahref="jwblangley/neat/evolution/Evaluator.html" title="interface in jwblangley.neat.evolution"><spanclass="interfaceName">Evaluator</span></a></li>
19
+
<li><ahref="jwblangley/neat/evolution/Evolution.html" title="class in jwblangley.neat.evolution">Evolution</a></li>
20
+
<li><ahref="jwblangley/neat/evolution/EvolutionFactory.html" title="class in jwblangley.neat.evolution">EvolutionFactory</a></li>
21
+
<li><ahref="jwblangley/neat/util/ImmutableHomogeneousPair.html" title="class in jwblangley.neat.util">ImmutableHomogeneousPair</a></li>
22
+
<li><ahref="jwblangley/neat/evolution/InnovationGenerator.html" title="class in jwblangley.neat.evolution">InnovationGenerator</a></li>
23
+
<li><ahref="jwblangley/neat/phenotype/InputNeuron.html" title="class in jwblangley.neat.phenotype">InputNeuron</a></li>
24
+
<li><ahref="jwblangley/neat/phenotype/Network.html" title="class in jwblangley.neat.phenotype">Network</a></li>
25
+
<li><ahref="jwblangley/neat/genotype/NetworkGenotype.html" title="class in jwblangley.neat.genotype">NetworkGenotype</a></li>
26
+
<li><ahref="jwblangley/neat/phenotype/Neuron.html" title="class in jwblangley.neat.phenotype">Neuron</a></li>
27
+
<li><ahref="jwblangley/neat/genotype/NeuronGenotype.html" title="class in jwblangley.neat.genotype">NeuronGenotype</a></li>
28
+
<li><ahref="jwblangley/neat/genotype/NeuronLayer.html" title="enum in jwblangley.neat.genotype">NeuronLayer</a></li>
29
+
<li><ahref="jwblangley/neat/proto/ProtoEquivalent.html" title="interface in jwblangley.neat.proto"><spanclass="interfaceName">ProtoEquivalent</span></a></li>
30
+
<li><ahref="jwblangley/neat/proto/ProtoIO.html" title="class in jwblangley.neat.proto">ProtoIO</a></li>
31
+
<li><ahref="jwblangley/neat/evolution/Species.html" title="class in jwblangley.neat.evolution">Species</a></li>
32
+
<li><ahref="jwblangley/neat/visualiser/Visualiser.html" title="class in jwblangley.neat.visualiser">Visualiser</a></li>
0 commit comments