unilab.training.experiment

Shared experiment tracking utilities for local files and W&B.

Functions

build_wandb_run_name(algo_name, task_name, ...)

build_wandb_settings(training_cfg, *, ...)

get_device_info_dict()

get_git_info(root_dir)

patch_rsl_rl_wandb_writer()

Patch rsl-rl W&B writer so it can reuse an already-open run.

Classes

ExperimentTracker

Tracks experiment metadata locally and optionally in Weights & Biases.

unilab.training.experiment.get_device_info_dict()[source]
Return type:

dict[str, str]

unilab.training.experiment.get_git_info(root_dir)[source]
Parameters:

root_dir (str | Path)

Return type:

dict[str, Any]

unilab.training.experiment.build_wandb_run_name(algo_name, task_name, log_dir)[source]
Parameters:
Return type:

str

unilab.training.experiment.build_wandb_settings(training_cfg, *, algo_name, task_name, sim_backend, log_dir)[source]
Parameters:
  • training_cfg (Any)

  • algo_name (str)

  • task_name (str)

  • sim_backend (str)

  • log_dir (str | Path | None)

Return type:

dict[str, Any]

class unilab.training.experiment.ExperimentTracker[source]

Bases: object

Tracks experiment metadata locally and optionally in Weights & Biases.

Parameters:
__init__(*, root_dir, log_dir, algo_name, task_name, sim_backend, training_cfg, full_cfg, device=None, collector_device=None, seed_info=None)[source]
Parameters:
property run: Any | None
property run_url: str | None
property wandb_settings: dict[str, Any]
start()[source]
Return type:

None

update_summary(summary=None)[source]
Parameters:

summary (dict[str, Any] | None)

Return type:

None

log_video(video_path, key='media/play_video')[source]
Parameters:
Return type:

None

finish()[source]
Return type:

None

unilab.training.experiment.patch_rsl_rl_wandb_writer()[source]

Patch rsl-rl W&B writer so it can reuse an already-open run.

Return type:

None

unilab.training.experiment.patch_rsl_rl_resume_state()[source]

Persist + restore Logger.tot_time / tot_timesteps across resume.

Without this patch, rsl-rl’s Logger.__init__ writes tot_time = 0 and tot_timesteps = 0 and OnPolicyRunner.load never refreshes them, so the Train/mean_reward/time and Train/mean_episode_length/time TensorBoard scalars (which use int(self.tot_time) as their step) restart from 0 on every resumed run and visually overlap the original segment. See issue #441.

The patch wraps OnPolicyRunner.save / OnPolicyRunner.load to round-trip a unilab_logger_state key in the saved dict. Legacy checkpoints (without the key) load unchanged.

Return type:

None