RewardClipping¶
- class torchrl.envs.transforms.RewardClipping(clamp_min: Optional[float] = None, clamp_max: Optional[float] = None, in_keys: Optional[Sequence[NestedKey]] = None, out_keys: Optional[Sequence[NestedKey]] = None)[source]¶
Clips the reward between clamp_min and clamp_max.
- Parameters:
clip_min (scalar) – minimum value of the resulting reward.
clip_max (scalar) – maximum value of the resulting reward.
- transform_reward_spec(reward_spec: TensorSpec) TensorSpec [source]¶
Transforms the reward spec such that the resulting spec matches transform mapping.
- Parameters:
reward_spec (TensorSpec) – spec before the transform
- Returns:
expected spec after the transform