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 层。
此类使 Noisy Linear 层变为 lazy,因为 in_feature 参数不需要在初始化时传递(但在首次调用该层后推断)。
有关 noisy 层的更多上下文,请参阅 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