Giter Site home page Giter Site logo

gneat's Introduction

gneat - a NEAT algorithm implementation in Go

About the project

This is my personal hobby project, an attempt to implement the NEAT algorithm based on the research paper published by Kenneth Stanley and Risto Miikkulainen. This project does not directly reference or link to any C++ code in the original implementation but some inspiration will be drawn from it and other NEAT implementations.

Changelog

Released and released changes and features are listed in the CHANGELOG.md file. For more information: see https://keepachangelog.com/en/1.1.0/

Original NEAT implementation and research paper

The research paper: https://nn.cs.utexas.edu/downloads/papers/stanley.ec02.pdf

Neural networks research group: https://nn.cs.utexas.edu/?neat

License

This work is licensed under Mozilla Public License Version 2.0.

gneat's People

Contributors

trashed avatar

Watchers

 avatar

gneat's Issues

Nodes (genotype and phenotype)

Node gene is a basic struct that has

  • an ID
  • a type (input, output, hidden)

The nodes used in genotype and phenotype could probably be implemented using a single Node struct. For example:

// Phenotype node
type NNode struct {
  Id uint
  Type NodeType
  Inputs []*Gene  // incoming connection genes
  Outputs []*Gene // outgoing connection genes
  ActivationFn ActivationFunc
  // ... other possibly necessary fields
}

Mutation interface (suggestion):

type NodeMutation interface {
  MutateActivationFn(*NNode, ActivationFunc)
}

Define later where the above-mentioned interface should be implemented.

Neural node

Implement nodes for the neural network

OR

use the same node types used in Genome implementations.

Connection gene

Connection gene connects two node genes together. Each connection has

  • Input node
  • Output node
  • Weight
  • Status (enabled/disabled)
  • Innovation number

Innovation number is an identifier for keeping track of connection innovation; we don't want the evolution create the same connections but instead reuse existing ones. If a truly unique connections is created, it is added to a list of connections and the innovation number is incremented.

Innovation record

Innovation record is a struct for storing unique connections and their innovation number. If an existing connection is tried to be added, an existing innovation number is returned.

Neural links

Neural links connect two nodes together.

Implement a new Link type for representing the neural connection between nodes.

Genetic mutations

Mutations to be implemented:

  • add a new node
    • get a random connection, split it and insert a new node
    • disabled the original connection and creates two new ones
  • add a new connection
    • if possible, add a new connection between two nodes
    • check innovation!
    • allow recurrent connections but check that there aren't any existing recurrent connections
  • mutate connection weights
  • disable/enable a connection
  • change activation type

Organism

Organism consists of at least following fields

  • genotype (genome)
  • species
  • phenotype (neural network)

NEAT configuration

Create a struct containing all the configuration parameters for setting and controlling the NEAT environment.
In the same configuration file should also be the started genome.

Genome

Genome is the genotype of the organism, a blueprint for building the phenotype (neural network).

Genome consists of

  • node genes
  • connection genes

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.