I think that biases are almost always helpful.
(我认为偏见几乎总是有用的。)
In effect, a bias value allows you to shift the activation function to the left or right , which may be critical for successful learning. (实际上, 偏差值允许您将激活功能向左或向右移动 ,这对于成功学习可能是至关重要的。)
It might help to look at a simple example.
(看一个简单的例子可能会有所帮助。)
Consider this 1-input, 1-output network that has no bias: (考虑这个没有偏差的1输入,1输出网络:)
The output of the network is computed by multiplying the input (x) by the weight (w 0 ) and passing the result through some kind of activation function (eg a sigmoid function.)
(通过将输入(x)乘以权重(w 0 )并将结果通过某种激活函数(例如,sigmoid函数)来计算网络的输出。)
Here is the function that this network computes, for various values of w 0 :
(对于w 0的各种值,这是该网络计算的函数:)
Changing the weight w 0 essentially changes the "steepness" of the sigmoid.
(改变重量w 0基本上改变了S形的“陡度”。)
That's useful, but what if you wanted the network to output 0 when x is 2? (这很有用,但如果你希望网络在x为2时输出0怎么办?)
Just changing the steepness of the sigmoid won't really work -- you want to be able to shift the entire curve to the right . (只是改变S形的陡峭度并不会真正起作用 - 你希望能够将整条曲线向右移动 。)
That's exactly what the bias allows you to do.
(这正是偏见允许你做的事情。)
If we add a bias to that network, like so: (如果我们向该网络添加偏见,就像这样:)
...then the output of the network becomes sig(w 0 *x + w 1 *1.0).
(...然后网络的输出变为sig(w 0 * x + w 1 * 1.0)。)
Here is what the output of the network looks like for various values of w 1 : (以下是w 1的各种值的网络输出:)
Having a weight of -5 for w 1 shifts the curve to the right, which allows us to have a network that outputs 0 when x is 2.
(对于w 1,权重为-5将曲线向右移动,这允许我们在x为2时具有输出0的网络。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…