unilab.utils.reward

Utility functions for reward config handling.

Functions

extract_reward_config(cfg, *[, target_field])

Extract and validate reward config from Hydra config.

resolve_reward_dict(cfg)

Resolve the reward config from the final composed config.

unilab.utils.reward.resolve_reward_dict(cfg)[source]

Resolve the reward config from the final composed config.

Parameters:

cfg (DictConfig)

Return type:

dict[str, Any]

unilab.utils.reward.extract_reward_config(cfg, *, target_field='reward_config')[source]

Extract and validate reward config from Hydra config.

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

  • target_field (str)

Return type:

dict[str, dict[str, Any]]

Returns:

Dictionary with target_field as the env config override key.

Raises:

ValueError – If reward config is missing