- class torchrl.modules.utils.biased_softplus(bias: float, min_val: float = 0.01)¶
A biased softplus module.
The bias indicates the value that is to be returned when a zero-tensor is passed through the transform.
bias (scalar) – ‘bias’ of the softplus transform. If bias=1.0, then a _bias shift will be computed such that softplus(0.0 + _bias) = bias.
min_val (scalar) – minimum value of the transform. default: 0.1
- forward(x: Tensor) Tensor ¶
Defines the computation performed at every call.
Should be overridden by all subclasses.
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.