Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -6,39 +6,30 @@ tags:
|
|
| 6 |
- games
|
| 7 |
---
|
| 8 |
|
| 9 |
-
# OpenFront
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
|
|
|
| 15 |
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
- Loss: border-weighted cross-entropy reconstruction of owner slots
|
| 19 |
-
- Trained on [djmango/openfront-snapshots](https://huggingface.co/datasets/djmango/openfront-snapshots)
|
| 20 |
-
(250 games, 10 maps, random 256x256 crops): 30k steps, batch 16, ~40 min on
|
| 21 |
-
an RTX 3070. 1.0M params.
|
| 22 |
|
| 23 |
-

|
| 34 |
|
| 35 |
```python
|
| 36 |
import torch
|
| 37 |
-
from ae.
|
| 38 |
|
| 39 |
-
ckpt = torch.load("
|
| 40 |
-
model =
|
| 41 |
model.load_state_dict(ckpt["model_state_dict"])
|
| 42 |
model.eval()
|
| 43 |
-
z = model.encode(owner_slots, terrain) # (B, 64, H/16, W/16)
|
| 44 |
```
|
|
|
|
| 6 |
- games
|
| 7 |
---
|
| 8 |
|
| 9 |
+
# OpenFront spatial autoencoder
|
| 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 64-channel latent per 16x16 region (any map size). v3 numbers: 99.4%
|
| 14 |
+
tile accuracy, 87-99% border-tile accuracy, structure detection at
|
| 15 |
+
precision/recall 1.0 per class.
|
| 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 |
+
Files: `ae_v3.pt` (current, `SpatialAE` in `model_v3.py`) and `ae.pt`
|
| 23 |
+
(v1 tile-only `TileAutoencoder` in `model.py`). Trained on
|
| 24 |
+
[djmango/openfront-snapshots](https://huggingface.co/datasets/djmango/openfront-snapshots).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
```python
|
| 27 |
import torch
|
| 28 |
+
from ae.model_v3 import SpatialAE
|
| 29 |
|
| 30 |
+
ckpt = torch.load("ae_v3.pt", map_location="cpu", weights_only=False)
|
| 31 |
+
model = SpatialAE(latent_c=ckpt["args"]["latent_c"])
|
| 32 |
model.load_state_dict(ckpt["model_state_dict"])
|
| 33 |
model.eval()
|
| 34 |
+
z = model.encode(owner_slots, terrain, static_planes) # (B, 64, H/16, W/16)
|
| 35 |
```
|