LeakyReLU
類別keras.layers.LeakyReLU(negative_slope=0.3, **kwargs)
修正線性單元激活層的洩漏版本。
此層在單元未啟用時允許一個小的梯度。
公式
f(x) = alpha * x if x < 0
f(x) = x if x >= 0
範例
leaky_relu_layer = LeakyReLU(negative_slope=0.5)
input = np.array([-10, -5, 0.0, 5, 10])
result = leaky_relu_layer(input)
# result = [-5. , -2.5, 0. , 5. , 10.]
參數
0.3
。name
和 dtype
。