imitation.rewards.serialize#
Load serialized reward functions of different types.
Functions
|
Load serialized reward. |
|
|
Classes
|
Wrap reward function to add sanity check. |
- class imitation.rewards.serialize.ValidateRewardFn(reward_fn)[source]#
Bases:
RewardFn
Wrap reward function to add sanity check.
Checks that the length of the reward vector is equal to the batch size of the input.
- imitation.rewards.serialize.load_reward(reward_type, reward_path, venv, **kwargs)[source]#
Load serialized reward.
- Parameters
reward_type (
str
) – A key in reward_registry. Valid types include zero, RewardNet_normalized, RewardNet_shaped, RewardNet_unshaped, RewardNet_unnormalized, RewardNet_std_added.reward_path (
str
) – A path specifying the reward.venv (
VecEnv
) – An environment that the policy is to be used with.**kwargs – kwargs to pass to reward fn
- Return type
- Returns
The deserialized reward.