unilab.utils.reward¶
Utility functions for reward config handling.
Functions
|
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 rootrewardsection.target_field (
str) – Env config override key the mapping is mounted under.
- Return type:
- Returns:
Dictionary with
target_fieldas the env config override key.- Raises:
ValueError – If the reward config is missing or empty, or the
target_fieldis not the supported"rewards"override key.