Skip to content

t5lab.plug_ctde

plug_ctde

ctde_v0 nav-field adapter.

Turns MVProp's per-agent value field into an (N,H,W) DISTANCE-like field matching the contract of ctde_v0's controller.nav_distance_field (goal = minimum, descend to it), so the existing reactive descent controller reuses unchanged. MVProp produces a VALUE field (goal = maximum, ascend), so the adapter negates it.

Reads only MVProp (jax/equinox) — no ctde_v0 import — so it smoke-tests locally.

mvprop_field

mvprop_field(mvprop, goal_cells, blocked)

(N,H,W) distance-like field. goal_cells (N,2) int; blocked (N,H,W) bool.

Source code in experiments/t5lab/plug_ctde.py
21
22
23
def mvprop_field(mvprop, goal_cells, blocked):
    """(N,H,W) distance-like field. ``goal_cells`` (N,2) int; ``blocked`` (N,H,W) bool."""
    return jax.vmap(lambda g, b: _one_agent_field(mvprop, g, b))(goal_cells, blocked)