imitation.testing.reward_nets#
Utility functions for testing reward nets.
Functions
|
Create a simple reward ensemble. |
Classes
|
A mock reward net for testing. |
- class imitation.testing.reward_nets.MockRewardNet(observation_space, action_space, value=0.0)[source]#
Bases:
RewardNet
A mock reward net for testing.
- __init__(observation_space, action_space, value=0.0)[source]#
Create mock reward.
- Parameters
observation_space (
Space
) – observation space of the envaction_space (
Space
) – action space of the envvalue (
float
) – The reward to always return. Defaults to 0.0.
- forward(state, action, next_state, done)[source]#
Compute rewards for a batch of transitions and keep gradients.
- Return type
Tensor
- training: bool#