我认为偏见几乎总是有帮助的。有效,偏置值允许您将激活函数向左或向右移动,这对于成功学习可能至关重要。
看一个简单的例子可能会有所帮助。考虑这个没有偏差的 1 输入、1 输出网络:
The output of the network is computed by multiplying the input (x) by the weight (w0) and passing the result through some kind of activation function (e.g. a sigmoid function.)
Here is the function that this network computes, for various values of w0:
Changing the weight w0 essentially changes the "steepness" of the sigmoid. That's useful, but what if you wanted the network to output 0 when x is 2? Just changing the steepness of the sigmoid won't really work -- you want to be able to shift the entire curve to the right.
这正是偏见允许你做的事情。如果我们向该网络添加偏差,如下所示:
...then the output of the network becomes sig(w0*x + w1*1.0). Here is what the output of the network looks like for various values of w1:
Having a weight of -5 for w1 shifts the curve to the right, which allows us to have a network that outputs 0 when x is 2.