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