unilab.training.common

Shared helpers for training entrypoints.

Functions

assert_offpolicy_task_choice_matches_algo(cfg, *)

Reject off-policy configs whose cfg.algo.algo does not match the requested algo.

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 off-policy configs whose cfg.algo.algo does not match the requested 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:
Return type:

Logger