1 / 36

NN – cont.

NN – cont. Alexandra I. Cristea. USI intensive course “Adaptive Systems” April-May 200 3. We have seen how the neuron computes, let’s see What it can compute? How it can learn?. What does the neuron compute?. Perceptron, discrete neuron. First, simple case: no hidden layers

olwen
Télécharger la présentation

NN – cont.

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. NN – cont. Alexandra I. Cristea USI intensive course “Adaptive Systems”April-May 2003

  2. We have seen how the neuron computes, let’s see • What it can compute? • How it can learn?

  3. What does the neuron compute?

  4. Perceptron, discrete neuron • First, simple case: • no hidden layers • Only one neuron • Get rid of threshold – b becomes w0 • Y – Boolean function : > 0 fires  0 doesn’t fire

  5. 1 t=1 Threshold function f (w0 = - t = -1)  f 

  6. X2 1 0 1 X1 Y X1 X2 t=1 0 0 1 1 1 1 W1=1 W2=1 f Y = X1 or X2

  7. X2 1 0 1 X1 Y X1 X2 t=1 0 0 0 1 0 1 W1=0,5 W2=0,5 f Y = X1 and X2

  8. 1 t=1 Y = or(x1,…,xn) w1=w2=…=wn=1

  9. 1 t=1 Y = and(x1,…,xn) w1=w2=…=wn=1/n

  10. X2 X2 X2 X2 0 1 0 1 0 1 X1 X1 X1 Y Y Y 0 0 0 1 0 1 0 0 1 1 11 0 -1 1 1 1 1 X1 What are we actually doing? W0=-1; W1 =7; W2=9 W0=1; W1 =7; W2=9 w0+w1*X1+w2*X2 W0=-1; W1 =0,7; W2=0,9

  11. Linearly Separable Set w0= - 1 w1= - 0,67 w2= 1 x1 w0+w1*x1+w2*x2 x2

  12. Linearly Separable Set w0= - 1 w1= 0,25 w2= - 0,1 x1 w0+w1*x1+w2*x2 x2

  13. Linearly Separable Set w0= - 1 w1= 0,25 w2= 0,04 x1 w0+w1*x1+w2*x2 x2

  14. Linearly Separable Set w0= - 1 w1= 0,167 w2= 0,1 x1 w0+w1*x1+w2*x2 x2

  15. Non-linearly separable Set

  16. Non Linearly Separable Set w0+w1*x1+w2*x2 w0= w1= w2= x1 x2

  17. Non Linearly Separable Set w0+w1*x1+w2*x2 w0= w1= w2= x1 x2

  18. Non Linearly Separable Set w0+w1*x1+w2*x2 w0= w1= w2= x1 x2

  19. Non Linearly Separable Set w0+w1*x1+w2*x2 w0= w1= w2= x1 x2

  20. Perceptron Classification Theorem A finite set X can be classified correctly by aone-layer perceptronif and only if it is linearly separable.

  21. Typical non-linearly separable set: Y=XOR(x1,x2) x1 Y=1 Y=0 1,1 0,1 x2 0,0 1,0 w0+w1*x1+w2*x2

  22. How does the neuron learn?

  23. W1*X1+W2*X2 X1 X2 Learning: weight computation • W1*(X1=1)+W2*(X2=1)>=(t=1) • W1*(X1=0)+W2*(X2=1)<(t=1) • W1*(X1=1)+W2*(X2=0)<(t=1) • W1*(X1=0)+W2*(X2=0)<(t=1)

  24. Perceptron Learning Ruleincremental version ROSENBLATT (1962) FOR i:= 0 TO n DO wi:=random initial valueENDFOR; REPEAT select a pair (x,t) in X; (* each pair must have a positive probability of being selected *) IF wT * x' > 0 THEN y:=1 ELSE y:=0 ENDIF; IF y  t THEN FOR i:= 0 TO n DO wi:= wi +  (t-y) xi' ENDFORENDIF; UNTIL X is correctly classified

  25. wnew x’ x’ w wniew x’ + - x’ w changes in the direction of the input w Idea Perceptron Learning Rule wi:= wi +  (t-y) xi' t=1 y=0 (wTx’0) wnew=w + x’ t=0 y=1 (wTx’>0) wnew=w - x’

  26. For multi-layered perceptrons w. continuous neurons,a simple and successful learning algorithm exists.

  27. e1=d1-y1 y2、d2 Hidden layer e2=d2-y2 y3、d3 e3=d3-y3 Input Output y4、d4 e4=d4-y4 BKP:Error y1、d1 Hidden layer error?

  28. Forward propagation value value y1 y2=w*y1 Synapse W: weight neuron1 neuron2 Weight serves as amplifier! Value (y1,y2)= Internal activation

  29. Backward propagation value value e1=?? e2 Inverse Synapse W: weight neuron1 neuron2 Weight serves as amplifier! Value(e1,e2)= Error

  30. Backward propagation value value e1=w*e2 e2 Inverse Synapse W: weight neuron1 neuron2 Weight serves as amplifier! Value(e1,e2)= Error

  31. e1=d1-y1 y2、d2 Hidden layer e2=d2-y2 y3、d3 e3=d3-y3 Input Output y4、d4 e4=d4-y4 BKP:Error O1 I1 y1、d1 O2 O2, I2 Hidden layer error?

  32. Output O1 Input I1 e1 w1 w2 e2 w3 e3 Hidden layer ee[j] = ie[i]w[j,i] Backpropagation: Backpropagation to hidden layer O2, I2

  33. Update rule for 2 weight types • ① I2(hidden layer), O1( system output) • ② I1(system input), O2( hidden layer ) ① Δw =α(d[i]-y[i]) f’(S[i])f(S[i]) = =αe[i] f(S[i])(simplification f’=1 for repeater, e.g.) S[i] = jw[j,i](t)h[j] ② Δw =α( ie[i]w[j,i])f’(S[j])f(S[j]) =α ee[j]f(S[j]) S[j] = kw[k,j](t)x[k]

  34. Backpropagation algorithm FOR s:= 1 TO r DO Ws := initial matrix(often random); REPEAT select a pair (x,t) in X;y0:=x; # forward phase: compute the actual output ys of the network with input x FOR s:=1 TO r DO ys:= F(Ws ys-1) END; # yr is the output vector of the network # backpropagation phase: propagate the errors back through the network # and adapt the weights of all layers dr:= Fr’ (t -yr) ; FOR s:=r TO 2 DO ds-1 := Fs-1' WsT ds; Ws:=Ws+  ds ys-1T; END; W1:=W1+  d1 y0T UNTIL stopcriterion

  35. Conclusion • We have seen binary function representation with single layer perceptron • We have seen a learning algorithm for SLP • We have seen a learning algorithm for MLP (BP) • So, neurons can represent knowledge AND learn!

More Related