Skip to content

NaniteFactory/naneat

Repository files navigation

NaNEAT?

GoDoc Build Status

삿대질

NaNEAT is a NEAT library made from scratch that's mostly for my own use. It is multi-threaded, and designed that way to become one day to be extended to a horizontally scalable microservice.

NEAT

NEAT (Neuro-Evolution of Augmenting Topologies) is a genetic algorithm developed by Dr. Kenneth O. Stanley in 2002. Being based on the neuroevolution technique which evolves both topology and weights of an artificial neural network, NEAT starts out with a population of minimal structures and adds structure as necessary in order to minimize the number of parameters being searched. This allows the network topology to grow only as it benefits the solution, and through its learning process the structure of the neural network complexifies.

Installation

go get -v github.com/nanitefactory/naneat

Empirical Proofs

Learns to play Metal Slug 3

Metal Slug 3

Video: https://www.youtube.com/watch?v=rjrheRsWXR4

Solves XOR Problem

XOR-Test

Example

In order to conduct the XOR test implemented in this package, test run func naneat.TestMain(*testing.M).

go test -run TestMain

And the code below initiates a NEAT context that runs with 3 agents.

conf := naneat.NewConfigurationSimple(1, 2, 1)
experimenter := naneat.New(conf)

agent1, agent2, agent3 := naneat.NewAgent(), naneat.NewAgent(), naneat.NewAgent()
experimenter.RegisterMeasurer(agent1)
experimenter.RegisterMeasurer(agent2)
experimenter.RegisterMeasurer(agent3)

go experimenter.Run()

(Further detail of that sample is included in the standard test code in this package.)

Features

  • Cross-platform throughout desktop environments; Windows, Linux and macOS.
  • The library may not depend on a particular programming language to use.
  • Entire codebase is written in Go which makes it lightweight and easier to maintain.
  • The experiment process is fully visualizable with faiface/pixel.
  • Can save/load the state serialized in JSON.
  • Offers a plain easy interface designed to be multi-threaded and may be said, horizontally scalable.

Todo

  • Performance evaluations
  • More tests and benchmarks
  • Documentation

References

License

MIT