a neuroevolution sandbox that rewrites its own topology
Written to find out whether the internals were understood, or only the diagrams.
Backpropagation is not the only way to search for an architecture, and this is the other way, run rather than described. The network modifies its own topology while training, adding and removing neurons, and its activation functions are selected genetically rather than chosen up front. Simulated annealing with Metropolis-Hastings acceptance lets it take a worse step to escape a local minimum, which is the whole reason a topology search is not simply hill climbing.
The design constraint is that it all fits in one file and draws itself. Five live matplotlib panels show the search as it happens rather than after it: the architecture as it changes shape, the loss, the mutation history, and the complexity measures the run tracks about itself. Watching an architecture search is a different kind of understanding from reading its final accuracy, and that is the point of the project rather than a decoration on it.
Underneath the presentation it is ordinary, careful machine-learning engineering. L2 and complexity penalties keep the topology search from simply growing the network until it memorises the data, which is the failure mode a self-modifying architecture walks into first. It is a teaching object and a sandbox, not a model anyone should deploy, and the repository is clear about that.
Almost every neural network is trained by backpropagation. There is another way: let the network mutate its own structure and keep whatever works. Quantum Neural Horror does that, and lets you watch it happen.
4 min read · 2026-08-28