Hedgehog-ai

Hedgehog-ai

Bardo - neuroevolution (a powerful and underrated type of AI) through Elixir

Hello I would like feedback on an experimental neuroevolution (including substrate encoding) library called Bardo based on the amazing work of Gene Sher.

Neuroevolution is a powerful and underrated type of AI that is well suited to Erlang and Elixir.

Features

  • Topology and Parameter Evolving Neural Networks (TWEANN): Neural networks evolve their structure and weights over time
  • Efficient ETS-based Storage: Simple and fast in-memory storage with periodic backups
  • Modular Sensor/Actuator Framework: Easily connect networks to different environments
  • Built-in Evolutionary Algorithms: Includes selection algorithms and mutation operators
  • Substrate Encoding: Hypercube-based encoding for efficient pattern recognition
  • Example Environments: XOR, Double Pole Balancing, Flatland, and Simple FX simulations

License

Distributed under the Apache License 2.0. See LICENSE for more information.

Acknowledgements

This is a vibe coded port of this project: github - Rober-t/apxr_run

Which was based on this code: Gene Sher - DXNN2

Based on concepts from this amazing book: Handbook of Neuroevolution Through Erlang by Gene Sher.

This is experimental

I’m testing it out some personal projects but I would love feedback and contributors.. it may be totally crap.. so I would appreciate someone who is cleverer than me giving it a go.

I understood everything in Genes book up until substrate encoding where it started getting fuzzy.. so I’m trying to really understand it..

It seems vagually similar to Hierarchical temporal memory - Wikipedia and I wonder it its posssible to create a HTM based substrate encoding using sparse representations of data.. or integrate HTM in some way.

All the best,
hibernatus

Most Liked

Hedgehog-ai

Hedgehog-ai

Gene just responded with some really interesting feedback on the DXNN2 github issues : )

I personally find this trend of LLM based agents disconcerting, not least because they are incredibly wasteful and inefficient. Just because we can use the emergent properties of huge natural language / transformer based ML to write code doesn’t mean we necessarily should IMO.

Neuroevolution based agents seem far better than LLM agents for most of the use cases that LLM based agents are being targeted at… NE agents can continuously learn and adapt.. and be evolved to solve a problem efficiently.

LLMs could be used to create scapes, actuators, sensors the initial conditions for an NE system or as part of a fitness function. Either by writing code or using a DSL. There seems to be some great opportunities to combine NE with transformers and other ML that Gene has pointed out.

I do use various AI tooling but I’ve noticed that the agentic LLM based systems use an excessive amount of tokens (a suspiciously large amount of tokens)… tend to diverge and create new work that they have to clean up.. costing more money…

LLMs seem to be a great business model for big tech but will you still use them if we have powerful neuroevolution systems?

NE systems that evolved code and agents to solve a problem without needing to send data to a third party or spend money on tokens.. efficient enough to run on your own infrastructure?

I don’t really care that NE systems are black boxes.. the same is true of any sufficiently powerful ML models.

If anyone else has drank enough of the LLM kool-aid and wants to collab on NE… get in touch.

hibernatus@use.startmail.com

Hedgehog-ai

Hedgehog-ai

Hey yes.. I’m doing a new version of this that leverages Nx, axon and writing it from scratch by hand… to make sure its high quality. It will take longer but I’ll post the new library in a week or two.. its going really well so far and its so much better actually coding and understanding everything going slowly

I used claude code to port Erlang code to make Bardo. agentic LLM agents are an expensive way to make a mess and I’m now completely against LLM code generators.. rubber ducking is fine.. / AI search.

So yeah its embarrassing but this new library I’m working on will leverage Nx and its really exciting already. At least I made contact with Gene Sher and got some nice feedback and I’m now inspired to share a quality library soon/

Just to give you some details: Using Nx/axon its possible to serialize the NN and I’m experimenting with using it as the phenotype.. then the mutated NN runs and gets the reward / fitness score. It is possible to leverage Nx servings to run many parallel NN for training and the final fittest NN will also be able to run as a distributed Nx serving.

Hedgehog-ai

Hedgehog-ai

There was a port of DXNN2 (mentioned in the readme) and Bardo is a port of that to Elixir with extra bits like a HTM experiment. Its purely for educational use.

I have a new library that uses Nx that I can release it now however I want to test it on some real life use cases. I’ll share it regardless in a few days : )

Schultzer

Schultzer

There might be a lot to gain with leveraging tinygrad GitHub - tinygrad/tinygrad: You like pytorch? You like micrograd? You love tinygrad! ❤️ for the backend of the computation and if you like cutting edge stuff, there is outside of the mainstream light checkout: Predictive Vision in a nutshell – Piekniewski's blog

Elixir/Erlang are great for writing lexer, parser and compilers in. Although the VM sucks at anything math heavy. Like gemm.

Nezteb

Nezteb

I noticed that the project was archived as “failed AI slop”? :sweat_smile:

Where Next?

Popular in RFCs Top

senconscious
EctoJuno is a package that provides parsing, validation and applying sorting parameters for your ecto queries on models. Currently sortin...
New
BartOtten
This thread once discussed Routex in it’s early form. It has been repurposed to gather feedback and discusses pre-releases. Currently: p...
New
wingyplus
I just publish a library called redoc_ui_plug | Hex. The library renders Redoc UI from the openapi specification url. I used this library...
New
tiagodavi
I’ve just created and published my first Elixir library! Ex4j combines the power of Ecto schema with the Bolt protocol + an elegant DSL ...
New
noizu
Hello, I wrote a more comprehensive llama_cpp nif wrapper noizu-labs-ml/ex_llama: (github.com) inspired by the unfortunately doa jereg...
New
bluzky
Hi everyone, I would like to introduce my new project OrangeCMS, it’s an application that help you to create/edit content post for your ...
New
puemos
Hey everyone :waving_hand: Code: GitHub - puemos/overbooked: Overbooked is a self-hosted flexible workplace platform for indie co-wor...
New
marick
TL;DR I’ve forked the Lens package, changed the API some, added new lens makers and – most importantly – added a ton of documentation. In...
New
brettbeatty
At my work we build a lot of mix tasks for backfills and other maintenance tasks. Even with OptionParser we seem to copy a lot of boilerp...
New
manuel-rubio
There was some time when I started thinking about giving a boost to Lambdapad, the initiative from @garretsmith in Erlang that I loved wa...
New

Other popular topics Top

yurko
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 record...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New

We're in Beta

About us Mission Statement