Technical Briefing
How Neuroevolution Works
Teaching agents through selection and mutation
Neuroevolution combines a tiny neural network per agent with a genetic algorithm. Agents play, receive fitness from survival score, and the next generation is sampled from the best performers.
Data Pathway
Population
Evolution
Learned Policy
1) Agent brain architecture
Each bird has a 5-8-2 feed-forward neural network using sigmoid activations.
Forward pass
const hidden = Matrix.multiply(this.weights_ih, inputMatrix);
hidden.add(this.bias_h);
hidden.map(x => 1 / (1 + Math.exp(-x)));
const output = Matrix.multiply(this.weights_ho, hidden);
output.add(this.bias_o);
output.map(x => 1 / (1 + Math.exp(-x)));2) Fitness-proportionate selection
After a generation dies, scores are squared, normalized, and used as selection probabilities.
Selection logic
for (const bird of savedBirds) {
bird.score = Math.pow(bird.score, 2);
sum += bird.score;
}
for (const bird of savedBirds) {
bird.fitness = bird.score / sum;
}3) Mutation for exploration
Children copy parent weights and apply low-probability perturbations to discover better control policies.
Weight mutation
const mutateFn = (val: number) =>
Math.random() < rate ? val + (Math.random() * 2 - 1) * 0.1 : val;
this.weights_ih.map(mutateFn);
this.weights_ho.map(mutateFn);Mission Debrief
No gradient backpropagation needed.
Selection + mutation can learn useful behaviors.
Visualization makes policy improvement easy to observe.