Skip to content

t5lab.run_phase1a

run_phase1a

Phase 1a — the go/no-go gate. Train T5 (Backbone + goal head + MVProp) from scratch on a walled terrain, zero-shot eval on the held-out SAR set, print coverage vs the reactive-25% and classical-79% references.

Run ON BALTHAR from TeamBlue/SharedExploration: PY=$HOME/ZymeraLab/.venv/bin/python SD=

PYTHONPATH=.:../../../FiedlerValueEstimation $PY -m t5lab.run_phase1a

Config schema + env contracts verified against ctde_v0. Remaining runtime unknowns are the Backbone obs channel count (read from obs.shape[1]) and the GridEnv FixedWall swap (mirrors the existing scratchpad eval_driver / render_classical).

coverage_on_map

coverage_on_map(cfg, actor, wall, key, steps=200)

Greedy zero-shot rollout on a fixed SAR wall -> coverage fraction of free cells.

Source code in experiments/t5lab/run_phase1a.py
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
def coverage_on_map(cfg, actor, wall, key, steps=200):
    """Greedy zero-shot rollout on a fixed SAR wall -> coverage fraction of free cells."""
    env = _env_with_wall(cfg, wall)
    stencil = make_stencil(cfg)
    obs, state = env.reset(key)
    k = key
    for _t in range(steps):
        k, sk = jax.random.split(k)
        pos = state.body.position
        adj = _eu.kb_adjacency(pos, cfg)
        blocked = _navfield_blocked(state, cfg)
        z = actor.belief(obs, adj, inference=True)
        goal_logits, _v, _l2 = actor.heads(z)
        gi = jnp.argmax(goal_logits, -1)
        h, w = state.wall.shape
        goal = goal_targets(pos, stencil, h, w)[jnp.arange(pos.shape[0]), gi]
        move = jnp.argmax(actor.move_logits(pos, goal, blocked), -1)
        obs, state, *_ = env.step(state, move, sk)
    covered = np.asarray(state.covered).astype(bool)
    free = ~np.asarray(wall).astype(bool)
    return float((covered & free).sum()) / float(free.sum())