Shortcuts

TanhDelta

class torchrl.modules.TanhDelta(param: Tensor, min: Union[Tensor, float] = - 1.0, max: Union[Tensor, float] = 1.0, event_dims: int = 1, atol: float = 1e-06, rtol: float = 1e-06, **kwargs)[source]

Implements a Tanh transformed_in Delta distribution.

Parameters:
  • param (torch.Tensor) – parameter of the delta distribution;

  • min (torch.Tensor or number, optional) – minimum value of the distribution. Default is -1.0;

  • max (torch.Tensor or number, optional) – maximum value of the distribution. Default is 1.0;

  • event_dims (int, optional) – number of dimensions describing the action. Default is 1;

  • atol (number, optional) – absolute tolerance to consider that a tensor matches the distribution parameter; Default is 1e-6

  • rtol (number, optional) – relative tolerance to consider that a tensor matches the distribution parameter; Default is 1e-6

  • batch_shape (torch.Size, optional) – batch shape;

  • event_shape (torch.Size, optional) – shape of the outcome;

property mean: Tensor

Returns the mean of the distribution.

property mode: Tensor

Returns the mode of the distribution.

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