Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
496 views
in Technique[技术] by (71.8m points)

artificial-intelligence - 偏差在神经网络中的作用(Role of Bias in Neural Networks)

I'm aware of the Gradient Descent and the Back-propagation Theorem.

(我知道梯度下降和反向传播定理。)

What I don't get is: When is using a bias important and how do you use it?

(我没有得到的是:什么时候使用偏见很重要,你如何使用它?)

For example, when mapping the AND function, when I use 2 inputs and 1 output, it does not give the correct weights, however, when I use 3 inputs (1 of which is a bias), it gives the correct weights.

(例如,当映射AND功能时,当我使用2个输入和1个输出时,它不会给出正确的权重,但是,当我使用3个输入(其中1个是偏置)时,它会给出正确的权重。)

  ask by Karan translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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的各种值,这是该网络计算的函数:)

网络输出,给定不同的w0权重

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的各种值的网络输出:)

网络输出,给定不同的w1权重

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的网络。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...