Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -10,26 +10,54 @@ tags:
|
|
| 10 |
|
| 11 |
Frozen spatial observation encoder for [OpenFront.io](https://openfront.io)
|
| 12 |
RL agents: compresses tile ownership + terrain + fallout + static structures
|
| 13 |
-
into a
|
| 14 |
-
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
Full details, training code, results, and roadmap:
|
| 18 |
**[github.com/djmango/openfront-ai](https://github.com/djmango/openfront-ai)**
|
| 19 |
|
| 20 |

|
| 21 |
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
|
|
|
|
|
|
| 25 |
|
| 26 |
```python
|
| 27 |
import torch
|
| 28 |
from ae.model_v3 import SpatialAE
|
| 29 |
|
| 30 |
-
ckpt = torch.load("
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
model.load_state_dict(ckpt["model_state_dict"])
|
| 33 |
model.eval()
|
| 34 |
-
z = model.encode(owner_slots, terrain, static_planes) # (B, 64, H/
|
| 35 |
```
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
Frozen spatial observation encoder for [OpenFront.io](https://openfront.io)
|
| 12 |
RL agents: compresses tile ownership + terrain + fallout + static structures
|
| 13 |
+
into a latent grid (any map size). Structure detection is at precision/recall
|
| 14 |
+
1.0 per class for every model below.
|
| 15 |
+
|
| 16 |
+
**Current best: `ae_v31_d8.pt`** — v3.1 architecture (terrain-conditioned
|
| 17 |
+
nearest-upsample decoder, focal loss, border-dense sampling, cosine LR) with
|
| 18 |
+
the latent at 1/8 resolution instead of 1/16. Trained 40k steps on a mixed
|
| 19 |
+
corpus of bot self-play and real archived human games.
|
| 20 |
+
|
| 21 |
+
Border-tile accuracy (the hard metric — overall tile accuracy saturates at
|
| 22 |
+
~99% for all models), uniform 256-crop eval:
|
| 23 |
+
|
| 24 |
+
| checkpoint | latent | human border | bot border | human tiles | bot tiles |
|
| 25 |
+
|---|---|---|---|---|---|
|
| 26 |
+
| `ae_v31_d8.pt` | 64ch @ 1/8 | **89.3%** | **96.1%** | 99.6% | 99.8% |
|
| 27 |
+
| `ae_v31.pt` | 64ch @ 1/16 | 78.5% | 90.7% | 99.1% | 99.6% |
|
| 28 |
+
| `ae_v3.pt` (bot-only) | 64ch @ 1/16 | 71.8% | 87.5% | 99.2% | 99.4% |
|
| 29 |
+
|
| 30 |
+
The ablation story: mixing human games into training fixes the human-domain
|
| 31 |
+
gap, the v3.1 decoder/loss fixes add a few points, and latent *resolution*
|
| 32 |
+
(not channel count) is what finally cracks border geometry — borders are
|
| 33 |
+
high-frequency spatial detail that can't be bought back with more channels.
|
| 34 |
|
| 35 |
Full details, training code, results, and roadmap:
|
| 36 |
**[github.com/djmango/openfront-ai](https://github.com/djmango/openfront-ai)**
|
| 37 |
|
| 38 |

|
| 39 |
|
| 40 |
+
Trained on
|
| 41 |
+
[djmango/openfront-snapshots](https://huggingface.co/datasets/djmango/openfront-snapshots)
|
| 42 |
+
(bot) and
|
| 43 |
+
[djmango/openfront-human-games](https://huggingface.co/datasets/djmango/openfront-human-games)
|
| 44 |
+
(human).
|
| 45 |
|
| 46 |
```python
|
| 47 |
import torch
|
| 48 |
from ae.model_v3 import SpatialAE
|
| 49 |
|
| 50 |
+
ckpt = torch.load("ae_v31_d8.pt", map_location="cpu", weights_only=False)
|
| 51 |
+
a = ckpt["args"]
|
| 52 |
+
model = SpatialAE(
|
| 53 |
+
latent_c=a["latent_c"],
|
| 54 |
+
terrain_cond=a.get("terrain_cond", False),
|
| 55 |
+
upsample_decoder=a.get("upsample_decoder", False),
|
| 56 |
+
latent_down=a.get("latent_down", 16),
|
| 57 |
+
)
|
| 58 |
model.load_state_dict(ckpt["model_state_dict"])
|
| 59 |
model.eval()
|
| 60 |
+
z = model.encode(owner_slots, terrain, static_planes) # (B, 64, H/8, W/8)
|
| 61 |
```
|
| 62 |
+
|
| 63 |
+
`ae.pt` (v1 tile-only `TileAutoencoder` in `model.py`) is kept for history.
|