快捷方式

NoisyLazyLinear

class torchrl.modules.NoisyLazyLinear(out_features: int, bias: bool = True, device: DEVICE_TYPING | None = None, dtype: torch.dtype | None = None, std_init: float = 0.1)[源代码]

带噪声的懒惰线性层。

此类使 Noisy Linear 层“懒惰”,即在初始化时无需传递 in_feature 参数(但在调用该层第一次之后会自动推断)。

有关带噪声层更多背景信息,请参阅 NoisyLinear 类。

参数:
  • out_features (int) – 输出特征维度

  • bias (bool, optional) – 如果为 True,则会在矩阵乘法 Ax + b 中添加一个偏置项。默认为 True

  • device (DEVICE_TYPING, optional) – 层的设备。默认为 "cpu"

  • dtype (torch.dtype, optional) – 参数的数据类型。默认为 PyTorch 的默认数据类型。

  • std_init (scalar) – 优化前的��数标准差的初始值。默认为 0.1

initialize_parameters(input: Tensor) None[源代码]

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.

文档

访问全面的 PyTorch 开发者文档

查看文档

教程

为初学者和高级开发者提供深入的教程

查看教程

资源

查找开发资源并让您的问题得到解答

查看资源