mr-pong-rl-demo / README.md
multimodalart's picture
multimodalart HF Staff
Mr. Pong interactive demo: browser-side play + server-side match video & benchmark
13eb3cb verified
|
Raw
History Blame Contribute Delete
1.42 kB
metadata
title: Mr. Pong
emoji: πŸ“
colorFrom: blue
colorTo: gray
sdk: gradio
sdk_version: 6.24.0
app_file: app.py
short_description: Play table tennis against a PPO agent
python_version: '3.12'
startup_duration_timeout: 30m
models:
  - fromziro/MrPong
tags:
  - reinforcement-learning
  - ppo
  - game

πŸ“ Mr. Pong

An interactive demo for fromziro/MrPong β€” a 28,484-parameter actor–critic MLP trained with PPO and self-play for 10M steps to play 2D table tennis.

Three tabs:

  • Play Mr. Pong β€” the policy is exported from the checkpoint and evaluated in your browser (plain JavaScript, ~26K MACs per decision), so the agent's paddle reacts at the same 40 sub-steps/second the physics runs at, with no network latency. The critic's value estimate V(s) is shown live.
  • Watch a match β€” the real PyTorch checkpoint plays a full match against one of the scripted baselines from the model card, rendered to video server-side.
  • Benchmark β€” replays the model card's evaluation protocol over N matches.

The physics environment (pong_engine.py) and the baseline opponents are a 1:1 port of the author's reference inference.py, so behaviour matches the reported numbers.

Runs entirely on CPU: a policy forward pass is a 12β†’160β†’160β†’3 MLP.

Model, environment and baselines by FromZero, Apache-2.0.