File size: 1,435 Bytes
19ab982
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e92b993
19ab982
 
 
 
 
 
 
 
 
 
 
 
 
e92b993
19ab982
 
 
 
 
 
 
 
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: Neural Pong
emoji: 🎮
colorFrom: blue
colorTo: purple
sdk: docker
pinned: false
license: mit
---

# Neural Pong

A real-time Pong game where frames are generated by a diffusion model trained with rectified flow matching. Control the blue paddle using arrow keys or WASD to play!

## Features

- **Real-time frame generation**: Uses a frame-autoregressive transformer with diffusion sampling
- **Interactive gameplay**: Control the paddle with keyboard inputs
- **Configurable parameters**: Adjust FPS and diffusion steps
- **Low-latency streaming**: Achieves ~16 FPS with 4 diffusion steps

## How to Play

1. Wait for the model to load (you'll see a loading spinner)
2. Click "Start Stream" to begin generating frames
3. Use **Arrow Keys** or **WASD** to control the blue paddle:
   - **Up/W**: Move paddle up
   - **Down/S**: Move paddle down
4. Adjust the FPS and diffusion steps using the controls
5. Click "Stop Stream" when done

## Technical Details

This demo uses a small transformer model trained with rectified flow matching to simulate Pong game frames conditioned on user inputs. The model generates 24×24 pixel frames in real-time using diffusion sampling with configurable steps. Performance targets ~16 FPS with 4 diffusion steps on GPU hardware.

## Model Architecture

- Frame-autoregressive transformer
- Rectified flow matching training
- Caching for efficient inference
- GPU-accelerated generation