unilab.training.common

Shared helpers for training entrypoints.

Functions

assert_offpolicy_task_choice_matches_algo(cfg, *)

Reject offpolicy configs whose task owner path does not match the selected algo.

create_env(cfg, *, num_envs[, ...])

Construct an environment via the registry using the current Hydra config.

ensure_registries()

Import env modules so registry-based entrypoints can instantiate tasks.

get_hydra_runtime_choice(cfg, group)

Return a selected Hydra config-group choice when runtime metadata is available.

setup_logger(log_dir, algo_name, *[, echo, ...])

Create a simple file-backed logger for script-local progress messages.

unilab.training.common.ensure_registries()[source]

Import env modules so registry-based entrypoints can instantiate tasks.

Return type:

None

unilab.training.common.get_hydra_runtime_choice(cfg, group)[source]

Return a selected Hydra config-group choice when runtime metadata is available.

Parameters:
  • cfg (DictConfig)

  • group (str)

Return type:

str | None

unilab.training.common.assert_offpolicy_task_choice_matches_algo(cfg, *, algo_name=None)[source]

Reject offpolicy configs whose task owner path does not match the selected algo.

Parameters:
  • cfg (DictConfig)

  • algo_name (str | None)

Return type:

None

unilab.training.common.setup_logger(log_dir, algo_name, *, echo=True, filename='train.log')[source]

Create a simple file-backed logger for script-local progress messages.

Parameters:
  • log_dir (str | Path)

  • algo_name (str)

  • echo (bool)

  • filename (str)

Return type:

Logger

unilab.training.common.create_env(cfg, *, num_envs, env_cfg_override=None, sim_backend=None, task_name=None)[source]

Construct an environment via the registry using the current Hydra config.

Parameters: