RReLU¶
- class torch.nn.RReLU(lower=0.125, upper=0.3333333333333333, inplace=False)[source][source]¶
逐元素地套用隨機洩漏修正線性單元函數(randomized leaky rectified linear unit function)。
此方法描述於論文:Empirical Evaluation of Rectified Activations in Convolutional Network。
該函數定義如下:
其中 是在訓練期間從均勻分佈 隨機取樣,而在評估期間, 固定為 。
- 參數:
lower (float) – 均勻分佈的下限。預設值:
upper (float) – 均勻分佈的上限。預設值:
inplace (bool) – 可選擇是否原地 (in-place) 執行操作。預設值:
False
- 形狀 (Shape)
輸入: ,其中 代表任意數量的維度。
輸出: ,與輸入形狀相同。
範例
>>> m = nn.RReLU(0.1, 0.3) >>> input = torch.randn(2) >>> output = m(input)