NEAT implementation using FLux

Heya,

I am trying to implement a simplified version of the NEAT algorithm in julia for a project. I was just wondering what the best way of mapping my genomes into actual code it. Can I build flux models “neuron by neuron”? Do I need to instead write some sort of parser that converts my genomes into a model.

If so any direction to similar project would be welcome. I found https://github.com/Andy-P/NEAT.jl/blob/master/networks/nn.jl but the author seems to be building their own implementation from scratch and I was hoping a complier/parser from genome to a flux model would be feasible instead.

Another avenue I was thinking about was instead brute forcing mutation of weights onto a FLux model but I know that that doesn’t usually converge well and was part of the reasoning behind NEAT in the first place.

Any thoughts are welcome, sorry for the rather open ended question.
Sa

I wrote an example of evolving MLP where the Flux model weights are directly mutated. However, example is outdated as I changed some operator names in newer versions of Evolutionary package.

It’s not NEAT, but it could give you some ideas.

1 Like

Another piece that probably does not do what you need but might be helpful:
https://github.com/DrChainsaw/NaiveNASflux.jl

There is nothing in there which helps with the translation to genes though as it is designed for more explicit mutation operations.

The CompGraph should make it easier to write programs that reason about the structure of the model and it has facilities to attach metadata to its vertices, but it is such a small part of it so you might be better of rolling your own.

One way I can imagine it could be made to work with NEAT is if you add some genome metadata to each vertex and let the sequence of the model just be the concatenation of that metadata of the vertices in topological order. I lack deeper knowledge of NEAT to say if this is a useful approach though.