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 Linear 层具有惰性,即在初始化时无需传入 in_feature 参数(而是在首次调用该层后推断得出)。
有关带噪声层的更多背景信息,请参阅 NoisyLinear 类。
- 参数:
out_features (int) – 输出特征维度
bias (bool, 可选) – 如果为
True
,则会在矩阵乘法中添加一个偏置项:Ax + b。默认为True
。device (DEVICE_TYPING, 可选) – 层的设备。默认为
"cpu"
。dtype (torch.dtype, 可选) – 参数的数据类型。默认为默认的 PyTorch 数据类型。
std_init (标量) – 优化前高斯标准差的初始值。默认为 0.1