MCPcopy Create free account
hub / github.com/RoboVerseOrg/RoboVerse / _diff_frames

Function _diff_frames

scripts/parity_policy_simpler_env.py:134–147  ·  view source on GitHub ↗

Return list of per-step diffs between two policy trajectories.

(nat, wrp)

Source from the content-addressed store, hash-verified

132
133
134def _diff_frames(nat, wrp):
135 """Return list of per-step diffs between two policy trajectories."""
136 diffs = []
137 fn, fw = nat["frames"], wrp["frames"]
138 if len(fn) != len(fw):
139 diffs.append(f"length {len(fn)} vs {len(fw)}")
140 for i, (a, b) in enumerate(zip(fn, fw)):
141 for k in ("obs", "rew", "term", "trunc", "success", "instr"):
142 if a[k] != b[k]:
143 diffs.append(f"step{i}.{k}: {a[k]} != {b[k]}")
144 # action vector: exact equality (policy is deterministic given identical obs)
145 if a["act"] != b["act"]:
146 diffs.append(f"step{i}.act")
147 return diffs
148
149
150def check_task(task, *, seed, steps, init_rng):

Callers 1

check_taskFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected