NEAT-JS
NeuroEvolution of Augmenting Topologies (NEAT) is a genetic algorithm (GA) for the generation of evolving artificial neural networks.
Getting Started:
Setting up the library:
If you are using Node.js you can import this library like so:
let NEAT activation crossover mutate = ;
If you are planning to use this library on the browser:
Basic Usage:
The basic usage of this library is as follows.
let config = model: nodeCount: 5 type: "input" nodeCount: 1 type: "output" activationfunc: activationRELU mutationRate: 005 crossoverMethod: crossoverRANDOM mutationMethod: mutateRANDOM populationSize: 10; let neat = config;
Config parameters:
model: Defines the model your creatures are going to usemutationRate: Sets the mutation chance of the creatures Default: 005crossoverMethod: Sets the crossover method crossoverRANDOM or crossoverSLICE Default: crossoverRANDOMmutationMethod: Sets the mutation method only mutateRANDOM for now Default: mutateRANDOMpopulationSize: Sets the population size Default: 500
Functions:
neat; // Does one generation with mutation and crossover.
neat; // Sets a creature's score. This will then be normalized for actual fitness value.
neat; // Returns the best creature from the last generation.
neat; // Sets the inputs of the creature indexed as "index".
neat; // Returns every creature's desicion in an array.
neat; // Feeds forward every creatıre's neural network.
neat; // Exports all creatures for later training (See import() below) You can also pass an index to this function.
neat; // Imports creature(s) previously exported.
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.