Skip to content

PPOExperimentMilestoneLog ​

python
PPOExperimentMilestoneLog(file_path: Path, config: PPOExperimentConfiguration, *, score_metric: str = 'score', score_bands: tuple[int, ...] = (100, 200, 300, 400, 500)) -> None

Append-only milestone log for PPO experiment runs.

Initialize the experiment milestone log.

Parameters:

  • file_path (Path) – CSV file updated in place for the active run.
  • config (PPOExperimentConfiguration) – Experiment configuration serialised into settings_json.
  • score_metric (str) – Episode-data key used for score-band milestones.
  • score_bands (tuple[int, ...]) – First-hit score thresholds to record for actor/tester progress.

Source

Methods ​

fieldnames ​

python
fieldnames() -> list[str]

Return the CSV field order for the milestone log.

Returns:

  • list[str] – The persisted field names.

Source

finish_run ​

python
finish_run() -> None

Mark the current run as stopped and stamp its end time.

Source

record_actor_episode ​

python
record_actor_episode(episode_data: dict[str, float], step: int, is_win: bool, timing: TimingSnapshot) -> None

Record first-hit actor milestones for one completed episode.

Parameters:

  • episode_data (dict[str, float]) – Numeric actor episode data.
  • step (int) – Actor environment step at episode completion.
  • is_win (bool) – Whether the actor episode ended in a win.
  • timing (TimingSnapshot) – Timing snapshot captured at completion.

Source

record_checkpoint ​

python
record_checkpoint(checkpoint_number: int) -> None

Record the latest saved checkpoint for the active run row.

Parameters:

  • checkpoint_number (int) – The checkpoint number that was just saved.

Source

record_tester_episode ​

python
record_tester_episode(episode_data: dict[str, float], episode: int, is_win: bool, timing: TimingSnapshot) -> None

Record first-hit tester milestones for one completed episode.

Parameters:

  • episode_data (dict[str, float]) – Numeric tester episode data.
  • episode (int) – Tester episode number at episode completion.
  • is_win (bool) – Whether the tester episode ended in a win.
  • timing (TimingSnapshot) – Timing snapshot captured at completion.

Source

start_run ​

python
start_run(run_id: str, output_directory: Path, *, game_name: str, algorithm: str, experiment_name: str) -> None

Create or refresh the current run row in the milestone log.

Parameters:

  • run_id (str) – Stable run identifier. Resumed runs should reuse the same ID.
  • output_directory (Path) – Output directory for the active run.
  • game_name (str) – Logical game name for the run.
  • algorithm (str) – Algorithm name, for example ppo.
  • experiment_name (str) – Concrete experiment class name.

Source