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)[source]¶
带噪声的懒式线性层。
此类使得带噪声的线性层成为懒式(lazy)的,这意味着 `in_feature` 参数不需要在初始化时传递(但会在层第一次调用后推断出来)。
有关带噪声层的更多背景信息,请参阅 `NoisyLinear` 类。
- 参数:
out_features (int) – 输出特征维度
bias (bool, optional) – 如果为
True
,则会在矩阵乘法 Ax + b 中添加偏置项。默认为True
。device (DEVICE_TYPING, optional) – 层的设备。默认为
"cpu"
。dtype (torch.dtype, optional) – 参数的 dtype。默认为 PyTorch 的默认 dtype。
std_init (scalar) – 优化前的初始高斯标准差值。默认为 0.1