latent_sokoban.dataset¶
latent_sokoban.dataset
¶
Trajectory generation and the shared dataset format.
Dataset format (one .npz shard + sidecar .json metadata):
frames uint8 (F, 64, 64, 3) all frames, episodes concatenated
actions int8 (F,) action taken FROM frame i; -1 on
the final frame of each episode
episode_starts int64 (E,) index of each episode's first frame
episode_lens int64 (E,) number of frames (T+1) per episode
goal_frames uint8 (E, 64, 64, 3) goal observation per episode
pushed bool (F,) transition from frame i pushed a box
invalid bool (F,) transition from frame i was a no-op
solved bool (E,) episode ended solved
kind int8 (E,) 0 random, 1 solver, 2 perturbed
levels str (E,) ascii level definitions
The transition (frames[i], actions[i], frames[i+1]) is a valid training tuple whenever actions[i] != -1.
rollout
¶
Execute actions from reset, rendering every frame.
Source code in latent_sokoban/dataset.py
perturbed_solution
¶
Insert random detour actions into an optimal solution. The episode may or may not still solve, and both outcomes are useful signal.
Source code in latent_sokoban/dataset.py
generate_shard
¶
Generate one dataset shard with the recommended composition: 50% random / 30% solver / 20% perturbed-solver trajectories.