t5lab.distill¶
distill
¶
Distil the MVProp planner toward the classical wavefront (controller.nav_distance_field).
WHY (probe_mvprop.py): RL-only MVProp never sharpens — at init the flood dies within ~5 cells,
the field is flat where agents are, and the gradient through K max-prop sweeps vanishes. The fix
is a dense supervised target: for random (walls, goal) samples, the classical BFS wavefront gives
the exact distance-to-goal field; MVProp learns to reproduce gamma^distance everywhere, which
makes its argmax-value move equal the classical shortest-path move. The teacher is used ONLY at
training time — at inference the planner is pure MVProp (no classical code runs), so the system
stays fully learned.
Output: a frozen MVPropPlanner checkpoint plugged into ctde_v0 as action_head.controller='mvprop'.
Run (GPU): PY=$HOME/ZymeraLab/.venv/bin/python PYTHONPATH=. GRID=32 STEPS=4000 OUT=mvprop_distilled.eqx $PY -m t5lab.distill
gen_wall
¶
gen_wall(key, grid, max_rects=5, p_open=0.3)
(H,W) bool — jittable random terrain: with prob p_open fully open, else up to
max_rects random filled axis-aligned rectangles (varied clutter for general routing).
Source code in experiments/t5lab/distill.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | |
sample_free_cell
¶
sample_free_cell(key, wall)
(2,) int32 — a uniformly random FREE cell (jittable categorical over free cells).
Source code in experiments/t5lab/distill.py
61 62 63 64 65 66 | |
oracle_field
¶
oracle_field(wall, goal, grid)
(H,W) target value field = the 4-connected geodesic gamma^dist to goal, computed by
propagate with ORACLE passability w = 1 - wall. This is the EXACT field a 4-move
agent should descend (von-Neumann geometry, same as the env action space and as MVProp's
own flood) — so the student can reproduce it exactly by learning w -> 1-wall. Walls and
unreached cells sit at ~0.
Source code in experiments/t5lab/distill.py
69 70 71 72 73 74 75 76 77 | |