Skip to content

TrajectoryCaptureProcessor ​

python
TrajectoryCaptureProcessor(configuration: TrajectoryTrainingConfiguration | None, metrics: MetricsTracker, store: TrajectoryStore | None) -> None

Converts 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, or None when trajectory training is disabled.

Source

Properties ​

store ​

python
store: TrajectoryStore | None

Return the shared trajectory store.

Returns:

  • TrajectoryStore | None – The store, or None when trajectory training is disabled.

Source

Methods ​

load_state_dict ​

python
load_state_dict(state: dict[str, Any]) -> None

Restore capture state from checkpoint data.

Parameters:

  • state (dict[str, Any]) – The serialised state.

Source

load_trajectory_store_checkpoint_data ​

python
load_trajectory_store_checkpoint_data(state: dict[str, Any]) -> None

Restore only the reusable trajectory store from a separate checkpoint payload.

Parameters:

  • state (dict[str, Any]) – The serialised reusable trajectory-store payload.

Source

log_metrics ​

python
log_metrics(step: int) -> None

Emit 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.

Source

record_episode ​

python
record_episode(trajectory_file: EpisodeTrajectoryDataSource, episode_data: dict[str, float], step: int, *, outcome: EpisodeOutcome, start_reference: TrajectorySliceReference | None = None) -> None

Record 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.

Source

runtime_state_dict ​

python
runtime_state_dict() -> dict[str, Any]

Serialise capture runtime state stored inside the main experiment checkpoint.

Returns:

  • dict[str, Any] – The serialised runtime state.

Source

snapshot_potential ​

python
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 example win_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.

Source

trajectory_store_checkpoint_file ​

python
trajectory_store_checkpoint_file(compress: bool, *, checkpoint_step: int, midpoint_start_episode_cell_counts: dict[TrajectoryKey, int] | None = None) -> CheckpointFile | None

Build 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, or None when trajectory training is disabled.

Source