File size: 1,420 Bytes
9165118
13eb3cb
 
 
 
9165118
 
 
13eb3cb
 
 
 
 
 
 
 
 
9165118
 
13eb3cb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---
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**](https://huggingface.co/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](https://huggingface.co/fromziro),
Apache-2.0.