快捷方式

NoisyLinear

class torchrl.modules.NoisyLinear(in_features: int, out_features: int, bias: bool = True, device: DEVICE_TYPING | None = None, dtype: torch.dtype | None = None, std_init: float = 0.1)[原始碼]

帶噪聲的線性層。

由“Noisy Networks for Exploration”提出,https://arxiv.org/abs/1706.10295v3

Noisy Linear Layer 是一個在權重上添加了引數化噪聲的線性層。這種誘導的隨機性可用於強化學習網路中,以幫助智慧體的策略進行有效的探索。噪聲的引數與任何其他剩餘的網路權重一起透過梯度下降進行學習。通常採用因子化高斯噪聲。

引數:
  • in_features (int) – 輸入特徵維度

  • out_features (int) – 輸出特徵維度

  • bias (bool, optional) – 如果為 True,則會在矩陣乘法 Ax + b 中新增一個偏置項。預設為 True

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

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

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

文件

訪問全面的 PyTorch 開發者文件

檢視文件

教程

為初學者和高階開發者提供深入的教程

檢視教程

資源

查詢開發資源並讓您的問題得到解答

檢視資源