Giter Site home page Giter Site logo

yaricom / goneat Goto Github PK

View Code? Open in Web Editor NEW
75.0 7.0 19.0 3.6 MB

The GOLang implementation of NeuroEvolution of Augmented Topologies (NEAT) method to evolve and train Artificial Neural Networks without error back propagation

License: MIT License

Go 77.78% Makefile 0.37% Jupyter Notebook 21.85%
artificial-neural-networks neuroevolution neat augmenting-topologies unsupervised-learning unsupervised-machine-learning neural-network reinforcement-learning-algorithms reinforcement-learning

goneat's Introduction

Iaroslav Omelianenko's GitHub stats Top Langs

πŸ“– My Books

πŸ“‘ My Papers

  • Omelianenko, Iaroslav. Applying Deep Machine Learning for Psycho-Demographic Profiling of Internet Users Using O.C.E.A.N. Model of Personality. arXiv [Cs.LG], 2017. P. 1–24. DOI: https://doi.org/10.48550/arxiv.1703.06914.
  • Omelianenko, Iaroslav. Applying Advanced Machine Learning Models to Classify Electro-Physiological Activity of Human Brain for Use in Biometric Identification. arXiv [Cs.LG], 2017. P. 1–8. DOI: 10.48550/arxiv.1708.01167
  • Omelianenko, I. Creation of Autonomous Artificial Intelligent Agents using Novelty Search method of fitness function optimization. Hal.science, 2018. P. 1–7. URL: https://hal.science/hal-01868756
  • Omelianeko, I. Artificial Swarm Intelligence and Cooperative Robotic Systems. Preprints.org, 2019, P. 1–8. DOI: 10.20944/preprints201901.0282.v1
  • Omelianeko, I. Simulation of the autonomous maze navigation using the NEAT algorithm. Problems in programming, 2023. Vol. 4, P. 76–89. DOI: 10.15407/pp2023.04.076
  • Omelianenko, I. and Sinitsyn, I. Artificial swarm intelligence. International Scientific Technical Journal "Problems of Control and Informatics", 2024, Vol. 69. N 3. P. 91–103. DOI: 10.34229/1028-0979-2024-3-7

πŸ”­ Researcher Profiles

goneat's People

Contributors

yaricom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

goneat's Issues

Explore possibilities of saving genomes into directed graphs

Saving genome structure into directed graph provides ability to perform various kinds of analysis using graph theory. Also, it will allow us to create visualizations of genome structures. Similar to way we already done in the goNEAT_NS repository.

Update GenerationEvaluator to take context.Context as parameter

Currently we have *neat.Options as parameter which is not generalizable for different types of algorithms and experiments. We need to substitute it with context.Context holding specific options for each type of algorithm, including basic neat.Options

NewPopulationRandom does not assign random configured activatiors

Hi! Thanks for the awesome library. I'm not sure if this is incorrect behavior, but it was unexpected to me. I'm using v3.

When creating a population with NewRandomPopulation it initializes all activators in the initial genome (inputs, hidden, output) with SigmoidSteepenedActivation. I was expecting it to select from the random activations and weights used in the configuration passed in with the opts parameter.

In my use case this activation type doesn't work well on the output node when the network still lacks many hidden nodes. I'd like it to choose from a random as configured or minimally be able to select the default activation node to use for the first random genome.

Maybe a workaround is to tweak them myself after the initial population is created.

Not sure if this is an issue or a feature request. Thanks for your time!

Style not rendering from formats generated cytoscape json data.

While working on another issue I was attempting to visualize my networks to better demonstrate the results. I am using the formats WriteCryptoScapes function and using the Cryptoscape desktop app which I think the README.md is referring to as the Cryptoscape App.

The styles appear to be written to the JSON file (see attach, remove .txt extension required by github)
1-1-0.json.txt

However, no styles or formatting is shown at all. Perhaps I just don't know how to use the app correctly. I've tried 3.9.1 and a few older versions of the Cryptospace app with the same results. See the GIF to see how I'm importing the json file and the resulting default style:
cytoscape

I expect the style as in the file which seems to be the same formatting applied in the example shown in the README.md of this repository.

I'm using v3 of goNEAT. Perhaps there is a regression in the formater, it only works with a certain version of the Cryptospace app, or it is user error on my part that isn't obvious?

As always thanks for your time.

Remove nodes and links during mutations

I have a larger network with 18 inputs and 3 outputs, and I'm having trouble understanding how hidden nodes, biases, and genes get removed during the process. It seems like no matter what parameters I set for my context, my organisms eventually just expand infinitely with more and more nodes and links, getting slower and slower without making any real fitness improvements.

Digging around in the source code myself, I'm only seeing methods for adding links and nodes but not removing them. Now correct me if I'm wrong but shouldn't it be possible for nodes and links to get deleted during mutation to get rid of unneeded connections?

Automatically tune compatibility threshold for species when training

Hello!
While reading this cool documentation on the technicalities of NEAT, I stumbled upon a Q/A section named:

- Is there a way to automatically set the compatibility threshold for speciation?

image

In their implementation, there seems to be a way to edit the source code and to recompile the NEAT engine so that a certain amount of species is kept when training, so that the number of species does not "explode uncontrollably" when some kind of mutations happen, and even sometimes approach the number of organism in the population, which is by itself very weird (I am the only organism of my species, and so are you! and you.. and you! Is this what extinction feels like?)

I find myself tweaking my threshold beforehand a lot, so that the number of species does not go too high, but it feels like having a set number of species would be desirable.

Have you thought about implementing this in goNEAT? Thanks!

Log levels do not work properly

// InfoLog The logger to output messages with Info and up level
	InfoLog = func(message string) {
		if LogLevel <= LogLevelInfo {
			_ = loggerInfo.Output(2, message)
		}
	}

neat.InfoLog will log message even when neat.LogLevel = neat.LogLevelError because "error" <= "info" is true.
Please fix

Optimizing genomes before saving

Hello @yaricom , thanks for making such a nice library.

I think it provides lots of very interesting features, as I've used them in my https://github.com/qwertyuu/go-ur project, about trying to teach my computer to play The Royal Game of Ur for fun. I currently have a bot that's been trained using goNEAT in production here https://ur.whnet.ca/ under the name "Neato"

I've been enjoying the Cytoscape export feature, as I think it helps a lot to visualize the phenotype. I also found that some of my very good organisms had "dangling" links, that is, links that pointed to nodes that were not directed towards the output at all.. maybe after mutation, which I expect.

I was thinking, is there a plan to add some kind of tree-shaking to remove those links and nodes that are not in the path to the output?

More details on traits

Hello @yaricom

I like that you innovated in this version of NEAT by adding traits. Though, I think I would like a bit more explanation, as this seem not to be transferrable to other neat implementations.

How are they used in the phenotype?

How are they interpreted by someone exterior to the library for, say, graph visualization of the phenotype?

How are they initialized in the original starting structure for your organisms (the yml file)?

What are the parameters for?

This would be a nice addition to the NEAT world, but I think needs more details for us NEAT-neophytes

Thanks for taking time to make and maintain such a nice piece of lib!

Implement SIGTERM support for experiment runner

We need to implement the SIGTERM support for experiment runner by sharing the execution context and sending cancel signal to the experiment executor upon receiving SIGTERM or similar events from the underlying OS.

How to set up start genomes?

Hi,
The library looks really nice, but sadly it's missing a more idiot-proof type of documentation.
The executor and single pole example files were helpful in setting up something, but still contain tons of stuff
which are not so well documented.
Especially, setting up some custom own project is kinda hard. The simplicity of the linked blog post:
(https://maori.geek.nz/learning-to-play-asteroids-in-golang-with-neat-f44c3472938f) is quite nice to understand things better,
but it completely skips the part where you actually set up the project with start genome etc.
A really nice thing would be a minimal, complete example on how to setup everything for a random problem like the asteroids game.
so concrete question:

  • how do i create the proper start genome for my problem having x input variables and y output variables?
    i don't get the consturctor and docu is not existent. i saw randomGenome as private func, but it has no public c-tor

best regards

We need to extract Mutator and Reproducer.

Currently the mutation and reproduction logic encapsulated into Genome and Population. We need to extract it into Interfaces with concrete implementations to make code more clear.

How would one go about supporting recurrent graphs?

I would like to give you a hand, or at least try to, by beginning the implementation of recurrent networks in NEAT.

I love the idea of recurrent networks and their emergent properties. That said, have you thought about what steps would be needed for such an implementation? or if another implementation does it well, or if papers cite being able to generate recurrent networks with neat? I remember reading religiously the original NEAT paper and not finding much about the higher-level properties of the generated graphs that NEAT would create, so I am still wondering how one could bring this about (how are time steps counted, how is recurrent links represented, etc.)

Since you explicitly included paths of your code to enable recurrence, I wonder what were your plans about this.

Thanks again for your nice library!

Missing genome file documentation

hi @yaricom ,

I am trying to use this lib, but I did not find a documentation about how the genoma file is created.
I could guess some columns meaning, but not all of them.

Could we have short description of each column?

Thank you

Keep champions between generations

Suggestion in the title. Add a configuration to keep champions (N best of generation, or N best of each species) between generations, so we can keep the best organism and not lose their "winner" genome in breeding.

Random genomes and add link mutations will link output nodes to other nodes

Upon inspecting a new random population with a larger set of max nodes I discovered that links using output nodes as input nodes to any non sensor, including other output nodes, may occur. This can also occur as far as I can tell with the add link mutations.

In most topologies, including NEAT, I think an output node should be an end state unless it is a recurrent connection back to another non-output node and never with itself. If my assumption is incorrect could you point me to a paper that defines the expected constraints on the node types? What I have read so far seems to imply constraints but doesn't really speak about it or explores the benifits of such constraints on an output node.

These type of connections are likely weeded out in normal experiments but I speculate their existence very much complicated and increases the problem domain to search and degrades the quality or consistency of the network actions. Especially in cases that I've noticed where many outputs will directly activate into another output node. In my model of asexual reproduction it is much less likely to lose an output link like this once they occur and the initial populations will randomly have many of them.

I think it is an issue this implementation provides non recurrent link genes from output nodes to hidden, output, or even itself. But I don't really know.

Perhaps it should be a configurable option to not form nonrecurrent output links, especially for mutations as pruning the new mutations at runtime from client code greatly impacts runtime in the realtime simulation use cases.

Change logger

We need to change logger to more performant and common one, like zap

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.