-
sigmoid函数,tf.nn.sigmoid, 1 / (1 + exp(-x))
a = tf.constant([1.1, 2.1,3.1 ,4.1]) tf.nn.sigmoid(a) #[0.7502601, 0.8909032, 0.9568927, 0.9836975]
- 导数:S(x)’ = S(x) * (1 - S(x))
- 映射区间0~1, 对称, 单调
-
tanh函数,tf.nn.tanh
b = tf.nn.tanh(a) # [0.8004991, 0.970452 , 0.9959493, 0.9994508]
- 导数:tanh(x)’ = 1 - tanh(x) ^ 2
-
relu函数 tf.nn.relu
tf.nn.relu(a)
- 模仿神经元的行为,达到一定阈值神经元才会被激活,筛选出相关的神经元
-
softsign
tf.nn.softsigh(input)
- f(x) = x / (1+|x|)
激活函数总结
最新推荐文章于 2023-03-16 23:19:18 发布