VIPRewardTransform¶
- class torchrl.envs.transforms.VIPRewardTransform(*args, **kwargs)[source]¶
A VIP transform to compute rewards based on embedded similarity.
This class will update the reward computation
- forward(tensordict)[source]¶
Reads the input tensordict, and for the selected keys, applies the transform.
- transform_input_spec(input_spec: TensorSpec) TensorSpec [source]¶
Transforms the input spec such that the resulting spec matches transform mapping.
- Parameters:
input_spec (TensorSpec) – spec before the transform
- Returns:
expected spec after the transform