Neural network decisions
Seven normalized game observations flow through a fully connected 7 → 8 → 6 → 2 network to select paddle movement.
AI-Pong uses a genetic algorithm to evolve neural networks that learn to rally against a CPU opponent. Watch the population play, inspect the network, and explore the training process.
Could not load or run the model. Reload to retry.
A Python project that brings together neural networks, a genetic algorithm, and a rendered Pong simulation.
Seven normalized game observations flow through a fully connected 7 → 8 → 6 → 2 network to select paddle movement.
Players are evaluated, selected, crossed, and mutated to make each new generation. Batched PyTorch inference helps evaluate the population in parallel.
Arcade renders a representative game and network view; the same simulation can also train headlessly and save run metrics and model checkpoints.
Each generation turns game performance into the next population of candidate players.
Candidate networks observe the game and choose paddle actions while their fitness is measured.
The genetic algorithm ranks players, retains survivors, and probabilistically selects parents for crossover.
Offspring inherit network parameters, receive mutations, and form the population for another round.
7 observations 8 6 2 actions
Project demo · rendered gameplay and network view
The rendered runner displays a population representative alongside a live network visualization. The GIF is a project demo; it is not evidence that a particular model is a trained elite.
Explore the architectureSet up the project, install its dependencies, then start the rendered genetic algorithm.
# Install dependencies
python -m pip install -r requirements.txt
# Start rendered training
python -m src.main
Training continues until interrupted unless a generation limit is set. Validation is an informational signal, not a guarantee of general reliability or a condition that stops training. See the training guide for options and validation guidance.