Views
No views yet
| File | Description | Val IoU |
|---|---|---|
models/viability_cardinal_best_iou.pth | Cardinal model - 3-ch input, 4-ch binary output (N/S/E/W) | 0.9793 |
models/viability_continuous_angle_best_iou.pth | Angle model - 5-ch input (sin/cos theta), 1-ch arbitrary heading | 0.984 |
configs/training_config.yaml | Training configuration | - |
| Metric | Value |
|---|---|
| IoU (seen sizes) | 0.978 |
| IoU (unseen size 25x18) | 0.953 |
| Generalisation gap | 0.025 |
| Inference time | 8.8 ms/map (GPU) |
| Oracle speedup | 21.5x |
| PRM trap reduction | 81% |
1import torch, numpy as np
2from huggingface_hub import hf_hub_download
3import segmentation_models_pytorch as smp
4
5ckpt_path = hf_hub_download(
6 repo_id="DanielDDDs/topological-traps",
7 filename="models/viability_cardinal_best_iou.pth"
8)
9model = smp.Unet(encoder_name="resnet34", encoder_weights=None, in_channels=3, classes=4)
10state = torch.load(ckpt_path, map_location="cpu")
11model.load_state_dict(state["model_state_dict"])
12model.eval()
13
14def predict(occupancy, robot_L=30, robot_W=20):
15 x = np.zeros((1, 3, 512, 512), dtype=np.float32)
16 x[0, 0] = occupancy
17 x[0, 1] = robot_L / 512.0
18 x[0, 2] = robot_W / 512.0
19 with torch.no_grad():
20 out = torch.sigmoid(model(torch.from_numpy(x)))
21 return out[0].numpy() # (4, 512, 512) N/S/E/W viability
22
23viability = predict(occupancy_grid)
24north_viable = viability[0] > 0.51@misc{simanovsky2026neural,
2 author = {Daniel Simanovsky},
3 title = {Neural Prediction of Heading-Dependent Topological Traps},
4 year = {2026},
5 school = {Tel Aviv University},
6}