Skip to content

lit_sb3.utils.system

source module lit_sb3.utils.system

System information and logging configuration utilities.

Functions

source get_latest_run_id(log_path: str | Path = '', log_name: str = '') → int

Returns the latest run number for the given log name and log path,.

by finding the greatest number in the directories.

Parameters

  • log_path : str | Path — Path to the log folder containing several runs.

  • log_name : str — Name of the experiment. Each run is stored in a folder named log_name_1, log_name_2, ...

Returns

  • int — latest run number

source configure_logger(verbose: int = 0, tensorboard_log: str | Path | None = None, tb_log_name: str = '', reset_num_timesteps: bool = True) → Logger

Configure the logger's outputs.

Parameters

  • verbose : int — Verbosity level: 0 for no output, 1 for the standard output to be part of the logger outputs

  • tensorboard_log : str | Path | None — the log location for tensorboard (if None, no logging)

  • tb_log_name : str — tensorboard log

  • reset_num_timesteps : bool — Whether the num_timesteps attribute is reset or not. It allows to continue a previous learning curve (reset_num_timesteps=False) or start from t=0 (reset_num_timesteps=True, the default).

Returns

  • Logger — The logger object

Raises

  • ImportError

source get_system_info(print_info: bool = True) → tuple[dict[str, str], str]

Retrieve system and python env info for the current system.

Parameters

  • print_info : bool — Whether to print or not those infos

Returns

  • tuple[dict[str, str], str] — Dictionary summing up the version for each relevant package and a formatted string.