PONG AI

Episode: 0

About This AI Pong Implementation

Technical Implementation

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

Self-Play Training

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:
    1. Stage 1: Learn to rally (hit the ball)
    2. Stage 2: Learn to score while defending

Game Modes

Training Mode: The AI plays against itself to learn the game.

Testing Mode: You can play against the trained AI!

Controls:

Move Up
Move Down