File size: 1,607 Bytes
f94e7f6
 
c7928dd
 
 
f94e7f6
c7928dd
f94e7f6
 
 
c7928dd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
44
45
46
47
48
49
50
---
title: Microzero Play
emoji: 🧪
colorFrom: indigo
colorTo: blue
sdk: static
app_file: index.html
pinned: false
---

# MicroZero

MicroZero is a tiny AlphaZero-style Tic-Tac-Toe agent. A shared neural trunk predicts
both move priors and position value. Monte Carlo Tree Search converts those estimates
into stronger self-play targets, while terminal outcomes supervise value learning.

The training loop uses:

- neural-guided PUCT search;
- root Dirichlet exploration;
- policy targets from MCTS visit counts;
- terminal win/draw/loss value targets;
- all eight square-board symmetries;
- a bounded replay buffer.

Evaluation alternates playing first and second against random and exact minimax
opponents.

## Verified results

- 7,626 trainable parameters;
- 980 neural-MCTS self-play games;
- 24,000-example bounded replay buffer after symmetry augmentation;
- 384 wins, 16 draws, and zero losses over 400 games against random play;
- 200 draws and zero losses over 200 games against exact minimax.

The exact opponent is used only for final evaluation, not as a source of training
targets. Full metrics and the per-iteration learning history are stored in
`artifacts/microzero/evaluation.json`.

## Reproduce

```powershell
uv run python projects/microzero/train.py
```

## Hosted showcase

This free static Space preserves the complete original Gradio source, trained artifacts, evaluation files, and local launch requirements. Hugging Face now requires PRO for CPU-backed Gradio hosting, so the public landing page is static while the checked-in `app.py` remains the authoritative runnable demo.