Reinforcement Learning with Pong in the browser via TensorFlow.js by @cpury 🚀
Demo: https://cpury.github.io/pong-rl/
With the default options, watch it learn the game in ~10 minutes!
Blog post coming soon 📝
Color scheme: https://coolors.co/3a3c3f-e5e5e6-f06543-2ec0f9-e7e247
Implements a Pong-like game as well as a controller interface to add arbitrary controllers to the game.
KeyController
to controll via keyboardDumbController
a simple controller that just follows the ball with some hiccupsDQLController
a first Deep-Q-Learning controller that learns on hard-coded features (position of the ball, force of the ball and positions of the paddles).VisualDQLController
Deep-Q-Learning directly on the pixels. SLOW!
- Three difficulty levels
- Live mode: When disabled, learning happens without drawing or waiting for user
- TensorFlow.js for neural networks
- Bulma as CSS framework
- Parcel.js for bundling
First, install dependencies:
npm install
To run in hot module reloading mode:
npm start
To create a production build:
npm run build-prod
Contributions welcome! If you'd like to add a new controller, add a new class that inherits from BaseController
and create a pull request.