Shortcuts

NoisyLazyLinear

class torchrl.modules.NoisyLazyLinear(out_features: int, bias: bool = True, device: Optional[Union[device, str, int]] = None, dtype: Optional[dtype] = None, std_init: float = 0.1)[source]

Noisy Lazy Linear Layer.

This class makes the Noisy Linear layer lazy, in that the in_feature argument does not need to be passed at initialization (but is inferred after the first call to the layer).

For more context on noisy layers, see the NoisyLinear class.

Parameters:
  • out_features (int) – out features dimension

  • bias (bool, optional) – if True, a bias term will be added to the matrix multiplication: Ax + b. Defaults to True.

  • device (DEVICE_TYPING, optional) – device of the layer. Defaults to "cpu".

  • dtype (torch.dtype, optional) – dtype of the parameters. Defaults to the default PyTorch dtype.

  • std_init (scalar) – initial value of the Gaussian standard deviation before optimization. Defaults to 0.1

initialize_parameters(input: Tensor) None[source]

Initialize parameters according to the input batch properties.

This adds an interface to isolate parameter initialization from the forward pass when doing parameter shape inference.

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