GWAM_Data / docs /SCHEMA.md
ChangChrisLiu's picture
Document bundled realtime final graph weights in schema
f15d9d7 verified
|
Raw
History Blame Contribute Delete
3.82 kB
# GWAM_Data v1.2 sparse-v2 schema
This file mirrors the root `SCHEMA.md`. The current v1.2 sparse-v2 export uses:
```text
graph/node_state.npz: node_state float32[T, 256, 32]
graph/view_evidence.npz
graph/dynamic_edges.jsonl with contact + visibility_change
graph/visible_masks_rle.jsonl.gz with row-major binary RLE v2_vectorized
audit/phase2_summary.json after Phase 2
sparse visible-only Phase 2 visual features
```
Old dense v1/v1.1 concepts are historical only and are not emitted by v1.2 sparse-v2:
```text
317-D / 323-D node_feats
dense rel_state or rel_prior tensors
distractor as family index 1
events.jsonl state_on/state_off / grasp / release vocab
dense visual_views[T,N,3,256]
min_visible_px=10 or RLE v1
```
Current family ids:
```text
0 object, including distractors
1 reserved / forbidden old distractor id
2 surface
3 receptacle
4 fixture
5 articulated_part
6 handle
7 control, defined but unpopulated
8 region, defined but unpopulated
9 robot
```
Loaders must read `node_state_schema`, gate on the active channel before using padded rows, and treat instruction/goal/object-role metadata as supervision-only unless an experiment explicitly allows it.
See root `README.md` and root `SCHEMA.md` for the full normative contract.
## Live real-time environment graph compatibility
The on-disk release stores full episodes, while the real-time extractor returns one current simulator frame at a time. They use the same schema vocabulary:
```text
on-disk episode: node_state float32[T,256,32]
live current frame: node_state float32[256,32]
live K-frame buffer: node_state float32[K,256,32]
```
The live extractor in `realtime/gwam_realtime_env_graph.py` / `extractors/gwam_realtime_env_graph.py` uses the same:
```text
node_state_schema
family ids
active-mask policy
static prior edge labels: part_of, controls
dynamic edge labels: contact, visibility_change
view_evidence fields and normalized [0,1] units
row-major RLE mask codec when masks are requested
```
Real-time extraction is for users with their own RoboCasa/robosuite environment and assets. The public model-facing path is `extract_final_graph(visual_backend=Sam2ClipRealtimeFeatureBackend(...))`, which constructs a current-observed full final graph from current simulator state, current RGB frames, segmentation masks, SAM2 masked pooled features, and CLIP type features. It yields `x [N_real,342]` by default. `extract_current_graph()` is a lightweight Phase-1/debug path only. Future simulator states, future robot nodes, future contacts, goal-derived target-node ids, object role labels, and instruction-derived target edges are not default-safe evaluation inputs; use them only in explicitly labeled oracle or teacher-forced modes. Bundled direct-run weights live at `models/sam2/checkpoints/sam2.1_hiera_base_plus.pt` and `models/clip/ViT-B-32.pt` with hashes in `models/MODEL_MANIFEST.json`.
## Online final-graph extraction files
The public real-time inference/evaluation path can construct the full final graph for one current simulator step:
```text
extract_final_graph(visual_backend=Sam2ClipRealtimeFeatureBackend(...))
current env state/RGB/segmentation/masks + Phase 1 graph + Phase 2 SAM2/CLIP = x [N_real,342]
```
Bundled direct-run files:
```text
realtime/gwam_realtime_env_graph.py
examples/realtime_env_graph_eval_loop.py
scripts/setup_realtime_final_graph_env.sh
scripts/verify_realtime_final_graph.py
models/sam2/checkpoints/sam2.1_hiera_base_plus.pt
models/clip/ViT-B-32.pt
models/MODEL_MANIFEST.json
```
The default online final graph feature layout is:
```text
20 state dims + 10 family one-hot + 256 SAM2 masked pooled visual + 32 type_clip32 + 24 view evidence = 342
```
`extract_current_graph()` is a lightweight Phase-1/debug path only and is not the final model-input graph.