Neural network: How to calculate the error for a unit

不羁岁月 提交于 2021-01-23 08:07:54

问题


I am trying to work out question 26 from this exam paper (the exam is from 2002, not one I'm getting marked on!)

This is the exact question:

The answer is B.

Could someone point out where I'm going wrong?

I worked out I1 from the previous question on the paper to be 0.982.

The activation function is sigmoid. So should the sum be, for output 1:

d1 = f(Ik)[1-f(Ik)](Tk-Zk)

From the question:

T1 = 0.58
Z1 = 0.83
T1 - Z1 = -0.25
sigmoid(I1) = sigmoid(0.982) = 0.728
1-sigmoid(I1) = 1-0.728 = 0.272

So putting this all together:

d1 = (0.728)(0.272)(-0.25)
d1 = -0.049

But the answer should be d1 = -0.0353

Can anyone show me where I'm going wrong?

Edit 1: I tried to work backwards to understand the situation, but I still got stuck.

I said:

d1 = f(Ik)[1-f(Ik)](Tk-Zk)
-0.0353 = f'(Ik)(-0.25) (where I know -0.0353 is the right answer, and -0.25 is Tk - Zk)
0.1412 = f'(Ik)
0.1412 = f(Ik)[1-f(Ik)]
0.1412 = sigmoid(x).(1-sigmoid(x))

...but then I got stuck, if anyone has an idea


回答1:


The problem is, that the I₁ you got from the previous question is not the same I₁ you need for this task.

The value of I₁ changes depending on the input values(which are different for this question)!

For the solution of this question you can instead use the fact that f(Iₖ) = zₖ:

δₖ = f(Iₖ)·[1 - f(Iₖ)]·(tₖ - zₖ)

= zₖ·[1 - zₖ]·(tₖ - zₖ)

→ δ₁ = 0.83·[1 - 0.83]·(-0.25) = -0.2075·0.17 = -0.035275 ≈ -0.0353

→ δ₂ = 0.26·[1 - 0.26]·(0.70 - 0.26) ≈ -0.0847

→ δ₃ = 0.56·[1 - 0.56]·(0.20 - 0.56) ≈ -0.0887



来源:https://stackoverflow.com/questions/65430571/neural-network-how-to-calculate-the-error-for-a-unit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!