t5lab.planner¶
planner
¶
MVPropPlanner — the learned L1 controller plugged into ctde_v0 in place of greedy_move.
This is the ONLY new piece in the "exact previous architecture + planner" deal: an opaque,
FROZEN (distilled) module with a single move method whose signature and semantics mirror
controller.navfield_move — descend a per-agent value field toward the chosen goal, one
env-valid step, with the hard collision veto and a STAY fallback. The classical wavefront's
argmin distance becomes MVProp's argmax value (higher value = closer to goal); nothing
else changes. The RL loss never touches this module (the move is a deterministic readout during
collection, not part of loss_fn), so its distilled weights stay frozen throughout training.
MVPropPlanner
¶
Bases: Module
Wraps a (distilled) :class:MVProp net as a drop-in L1 controller.
fields
¶
fields(blocked, goal)
(N,H,W) known-walls + (N,2) goals -> (N,H,W) per-agent value fields.
Source code in experiments/t5lab/planner.py
37 38 39 | |
move
¶
move(pos, goal, blocked, valid_targets, action_valid, forbid_collision=True)
(N,) int32 move — MVProp value-field descent toward goal (mirror of
:func:controller.navfield_move). pos (N,2), goal (N,2), blocked (N,H,W)
per-agent known walls, valid_targets (N,A,2), action_valid (N,A).
For each agent: flood a value field to its goal over its own known-walls map, then among env-VALID actions take the one whose committed cell has the HIGHEST value (steepest ascent = closest to goal). The hard collision veto removes moves onto a currently-occupied cell; STAY is always selectable and is the fallback when no valid move strictly beats staying — so the emitted move is always env-valid, exactly like the greedy / navfield controllers.
Source code in experiments/t5lab/planner.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | |
mvprop_input
¶
mvprop_input(blocked_i, goal_i)
(H,W) known-walls + (2,) goal cell -> (2,H,W) MVProp input [blocked, goal_onehot].
The SINGLE source of truth for the channel layout, shared by the planner and the distillation trainer so training and inference see byte-identical inputs.
Source code in experiments/t5lab/planner.py
22 23 24 25 26 27 28 29 30 | |
load_planner
¶
load_planner(path, in_ch=2, K=32, gamma=0.9)
Deserialise a distilled MVPropPlanner from path (an eqx tree of a fresh template).
Source code in experiments/t5lab/planner.py
68 69 70 71 | |