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.
KeyControllerto controll via keyboardDumbControllera simple controller that just follows the ball with some hiccupsDQLControllera first Deep-Q-Learning controller that learns on hard-coded features (position of the ball, force of the ball and positions of the paddles).VisualDQLControllerDeep-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 installTo run in hot module reloading mode:
npm startTo create a production build:
npm run build-prodContributions welcome! If you'd like to add a new controller, add a new class that inherits from BaseController and create a pull request.