unilab.utils.reward

Utility functions for reward config handling.

Functions

resolve_reward_dict(cfg, *[, target_field])

Extract and validate the reward config from a composed Hydra config.

unilab.utils.reward.resolve_reward_dict(cfg, *, target_field='rewards')[source]

Extract and validate the reward config from a composed Hydra config.

Parameters:
  • cfg (DictConfig) – Hydra DictConfig containing the root reward section.

  • target_field (str) – Env config override key the mapping is mounted under.

Return type:

dict[str, dict[str, Any]]

Returns:

Dictionary with target_field as the env config override key.

Raises:

ValueError – If the reward config is missing or empty, or the target_field is not the supported "rewards" override key.