GithubHelp home page GithubHelp logo

neat's Introduction

About me

  • American programmer
  • 16 y/o
  • Learning self-taught developer (py, java, rust, go, etc; mainly backend, ai, and opensource so far)
  • DevOps enthusiast
  • Rustacean ๐Ÿฆ€

My Main Skills

neat's People

Contributors

hypercodec avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

neat's Issues

Potentially merge `flush_state` into `predict`

Because it's being constantly run after predictions anyway, it's probably wise to just merge the two and prevent the whole host of issues associated with it. Still not sure whether it's worth doing a refactor like this so late in development though.

Rare hang

Not sure how this is happening but in extremely rare circumstances it is possible to hang indefinitely. See #57 workflow run for more info.

My guess is there is one very small outlying situation that causes a rwlock to be locked and used by a child node, but this shouldn't be possible with the well-tested circulation prevention algorithm. This definitely requires further debugging, but it is so rare and obscure that it is difficult to catch it and the details about what happened.

Write more tests

There clearly aren't enough tests here, as I keep coming across runtime errors in production that should have been caught by the actions.

[TODO] Combine `NeuralNetwork` and `NeuralNetworkTopology`

The original idea with having these split off was to have the NeuralNetwork struct inputs have smart pointers to the layer before, but this never really was implemented (and is likely impossible to implement without big performance costs). Right now it is just a bunch of useless cloning to access certain functions.

Useless atomic operations?

NeuralNetworkTopology uses Arc<RwLock<NeruonTopology>> but never uses async code. It would be better to only use something like Rc<RefCell<NeuronTopology>>.

[TODO] different types of crossover mutation

There should be an option to perform crossover mutation by merging/averaging neurons instead of 50% chance of having a neuron from one network or the other.

Will likely implement the same way as mutation_rate and mutation_passes.

Feature docs

should use #[doc(feature = "something")] and #[cfg(any(feature = "something", doc))] to include feature documentation.

`topology` module extrapolation

The topology.rs file is starting to get really long, so it would be good to turn this into a directory module soon to keep it maintainable and readable.

[TODO] Cuda support

Allows AIs to run on the GPU for increased parallelization. Might be difficult/impossible to implement with all these RwLocks, probably requires a major rewrite.

Change the way neuron values are cached in NeuralNetwork.

By moving the cache to a separate HashMap or something, neurons would not need to be stored in a RwLock, greatly reducing the amount of data being cloned while transferring between topology and mutable. Additionally, flush_state could be merged into predict without fear of performance issues because the map can simply be replaced by a new one in memory, which is way faster than the current iterative approach.

Code cleanup

Should rewrite or refactor some of the code to make it faster/more readable.

[TODO] topology defaulting API

Currently, nets are initialized by linking all output nodes with all inputs and applying sigmoid to all outputs. Instead of this, maybe could introduce some sort of "network constructor" trait that lets certain structs init a neural network (ex: SigmoidMLP::new<I, O>() -> NeuralNetworkTopology<I, O> or something of the sort).

Lacks a lot of true NEAT conventions

Because this crate was sort of rushed, it is more of an abstract and unfamiliar implementation of NEAT rather than the actual algorithm. This should be solved later as this crate is further developed.

Serde feature

Should add ability to serialize topologies/genomes

Example agents don't learn

Following a comment I made in #50, the examples' fitness graphs look like this:
fitness plot

This does not have any sort of upward trend at all, just looks like random data.

First change could be to try running these examples with a lot of generations to see if it is just statistical noise from not having enough generations.

If that is not the case, it is likely either an issue with the fitness function or a much larger core issue that needs solving.

Custom activation fn example

This will help introduce people to the new activation registry API and overall just enhance the ease of use of this crate.

More mutations

Current add neuron mutation should use weight 1 for first connection and preserve weight for second.

Also should have remove neuron mutation.

[TODO] activation fn registry

While the most widely-used activation functions are predefined, it'd be better to have some sort of registry so that the serde deserialization works with custom activations.

It would also be good to note that there should be a separate flag or something for those activation functions which do not want to be randomly mutated to/fro.

`max_index` function can panic

Somehow (in very rare circumstances) the partial_cmp will return None. I believe this may be caused by #53.

thread 'main' panicked at /workspaces/neat/src/runnable.rs:296:57:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Aborted (core dumped)

A neuron can depend on the same input multiple times

Possibly the cause of #58, as I noticed this in the neuron dump by @Bowarc (also in #58). A neuron can have multiple references to the same neuron as input. This, when combined with rayon, makes it so that, as it performs parallelized iteration on the neurons, there is a chance they try to write to the same neuron at the same time, causing a deadlock.

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.