Shortcuts

mappings

class torchrl.modules.utils.mappings(key: str)[source]

Given an input string, returns a surjective function f(x): R -> R^+.

Parameters:

key (str) – one of “softplus”, “exp”, “relu”, “expln”, or “biased_softplus”. If the key beggins with “biased_softplus”, then it needs to take the following form: `"biased_softplus_{bias}"` where `bias` can be converted to a floating point number that will be used to bias the softplus function. Alternatively, the `"biased_softplus_{bias}_{min_val}"` syntax can be used. In that case, the additional `min_val` term is a floating point number that will be used to encode the minimum value of the softplus transform. In practice, the equation used is softplus(x + bias) + min_val, where bias and min_val are values computed such that the conditions above are met.

Returns:

a Callable

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources