SignedHyperbolicValueTransform#
- class torchrl.modules.SignedHyperbolicValueTransform(epsilon: float = 0.001)[source]#
Signed-hyperbolic transform for large-magnitude value targets.
- Parameters:
epsilon (float, optional) – Positive linear correction that keeps the inverse Lipschitz continuous. Defaults to
1e-3.
Examples
>>> import torch >>> from torchrl.modules import SignedHyperbolicValueTransform >>> transform = SignedHyperbolicValueTransform(epsilon=1e-3) >>> value = torch.tensor([-100.0, 0.0, 100.0]) >>> transformed = transform(value) >>> transformed tensor([-9.1499, 0.0000, 9.1499]) >>> transform.inverse(transformed) tensor([-100.0000, 0.0000, 100.0000])
See also
torchrl.modules.functional.signed_hyperbolic()andtorchrl.modules.functional.signed_parabolic()for the functional form, andSymLogValueTransformfor an alternative nonlinear transform.Note
See Observe and Look Further: Achieving Consistent Performance on Atari (Pohlen et al., 2018).