class torchrl.modules.utils.biased_softplus(bias: float, min_val: float = 0.01)[source]

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[source]

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 Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.


Access comprehensive developer documentation for PyTorch

View Docs


Get in-depth tutorials for beginners and advanced developers

View Tutorials


Find development resources and get your questions answered

View Resources