TrajectoryCaptureProcessor
TrajectoryCaptureProcessor(configuration: TrajectoryTrainingConfiguration | None, metrics: MetricsTracker, store: TrajectoryStore | None) -> NoneConverts emitted trajectory files into RL-side store updates.
Initialize the processor.
Parameters:
configuration(TrajectoryTrainingConfiguration | None) – Optional trajectory training configuration.metrics(MetricsTracker) – Metrics tracker.store(TrajectoryStore | None) – The shared trajectory store, orNonewhen trajectory training is disabled.
Properties
store
store: TrajectoryStore | NoneReturn the shared trajectory store.
Returns:
TrajectoryStore | None– The store, orNonewhen trajectory training is disabled.
Methods
load_state_dict
load_state_dict(state: dict[str, Any]) -> NoneRestore capture state from checkpoint data.
Parameters:
state(dict[str, Any]) – The serialised state.
load_trajectory_store_checkpoint_data
load_trajectory_store_checkpoint_data(state: dict[str, Any]) -> NoneRestore only the reusable trajectory store from a separate checkpoint payload.
Parameters:
state(dict[str, Any]) – The serialised reusable trajectory-store payload.
log_metrics
log_metrics(step: int) -> NoneEmit every store-derived metric (capture counters, curriculum, archive, repository, utilities).
Called from the recording path AND from every episode boundary regardless of recording: with trajectory recording disabled (required under action perturbers) no episode ever reaches record_episode, and until 2026-08-14 that silently switched off every Trajectories/* metric -- a sticky-action walk ran blind, curriculum included. The reporter's own write gates make repeated calls cheap.
Parameters:
step(int) – The global step for metrics.
record_episode
record_episode(trajectory_file: EpisodeTrajectoryDataSource, episode_data: dict[str, float], step: int, *, outcome: EpisodeOutcome, start_reference: TrajectorySliceReference | None = None) -> NoneRecord a full trajectory emitted at episode end.
Parameters:
trajectory_file(EpisodeTrajectoryDataSource) – The complete trajectory.episode_data(dict[str, float]) – Episode metrics associated with the trajectory.step(int) – The global step for metrics.outcome(EpisodeOutcome) – The completed episode's outcome.
runtime_state_dict
runtime_state_dict() -> dict[str, Any]Serialise capture runtime state stored inside the main experiment checkpoint.
Returns:
dict[str, Any]– The serialised runtime state.
snapshot_potential
snapshot_potential(utility_key: str, field_names: list[str]) -> dict[tuple[int, ...], float]Snapshot a backpropagated utility's per-cell net values for lock-free potential-based shaping.
Parameters:
utility_key(str) – The backpropagated utility (for examplewin_proximity).field_names(list[str]) – The cell-key fields to extract, in order.
Returns:
dict[tuple[int, ...], float]–{(cell field values as ints): value}for every tracked cell.
trajectory_store_checkpoint_file
trajectory_store_checkpoint_file(compress: bool, *, checkpoint_step: int, midpoint_start_episode_cell_counts: dict[TrajectoryKey, int] | None = None) -> CheckpointFile | NoneBuild a reusable trajectory-store checkpoint file from the in-memory store.
Parameters:
compress(bool) – Whether the serialised file should be compressed.midpoint_start_episode_cell_counts(dict[TrajectoryKey, int] | None) – Optional midpoint-start episode starts keyed by cell.
Returns:
CheckpointFile | None– The checkpoint file, orNonewhen trajectory training is disabled.