This project uses Deep Q-Learning (DQN) implemented in TensorFlow.js with WebGPU acceleration. The neural network learns to play Pong through experience, using:
- A deep neural network to approximate Q-values for actions
- Experience replay to learn from past gameplay
- Target network for stable learning
- WebGPU acceleration for fast neural network computations in the browser
The AI learns through self-play, where:
- The same neural network controls both paddles
- Each paddle sees the game from its own perspective
- The AI learns to both defend and score
- Training progresses through stages:
- Stage 1: Learn to rally (hit the ball)
- Stage 2: Learn to score while defending
Training Mode: The AI plays against itself to learn the game.
Testing Mode: You can play against the trained AI!
Controls: