快捷方式

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。預設為 True

  • device (DEVICE_TYPING, 可選) – 層的裝置。預設為 "cpu"

  • dtype (torch.dtype, 可選) – 引數的資料型別。預設為 None(預設 PyTorch 資料型別)

  • std_init (標量, 可選) – 最佳化前高斯標準差的初始值。預設為 0.1

文件

查閱 PyTorch 的全面開發者文件

檢視文件

教程

獲取面向初學者和高階開發者的深度教程

檢視教程

資源

查詢開發資源並獲得問題解答

檢視資源