NoisyLinear¶
- class torchrl.modules.NoisyLinear(in_features: int, out_features: int, bias: bool = True, device: Optional[Union[device, str, int]] = None, dtype: Optional[dtype] = None, std_init: float = 0.1)[原始碼]¶
噪聲線性層。
出自《用於探索的噪聲網路》(Noisy Networks for Exploration),https://arxiv.org/abs/1706.10295v3
噪聲線性層是一種線上性層權重中新增引數化噪聲的層。這種引入的隨機性可用於 RL(強化學習)網路的智慧體策略中,以幫助進行高效探索。噪聲的引數與其他剩餘網路權重一起透過梯度下降進行學習。通常採用分解式高斯噪聲。
- 引數:
in_features (int) – 輸入特徵維度
out_features (int) – 輸出特徵維度
bias (bool, 可選) – 如果為
True,則會在矩陣乘法中新增一個偏置項:Ax + b。預設為Truedevice (DEVICE_TYPING, 可選) – 層的裝置。預設為
"cpu"dtype (torch.dtype, 可選) – 引數的資料型別。預設為
None(預設 PyTorch 資料型別)std_init (標量, 可選) – 最佳化前高斯標準差的初始值。預設為
0.1