Docsity

Neural Networks: A Comprehensive Study - Prof. Christopher H. Brooks, Study notes of Computer Science

Partial preview of the text

Download Neural Networks: A Comprehensive Study - Prof. Christopher H. Brooks and more Study notes Computer Science in PDF only on Docsity!

Artificial Intelligence Programming^ More Neural Networks^ Chris BrooksDepartment of Computer ScienceUniversity of San Francisco^ Department of Computer Science — University of San Francisco – p. 1/

?

24-2: Neural networks^ •^ A network is composed of layers of nodes^ ◦^ input, hidden, output layers in feedforward nets^ •^ An input is applied to the input units^ •^ The resulting output is the value of the function the netcomputes.

Department of Computer Science — University of San Francisco – p. 2/?

24-4: Delta rule^ •^ The appeal of perceptrons is the ability to automatically learntheir weights in a supervised fashion.^ •^ The weight updating rule is known as the

delta rule.

∑ • ∆w= α (t−^ o)xi d^ did^ d∈D • Where D^ is the training set,^ td^

is expected output and^ oisd^ actual output.^ Department of Computer Science — University of San Francisco – p. 4/

?

24-5: Example^ •^ Let’s suppose we want tolearn the majority functionwith three inputs^ •^ Firing fn:^ O(i) =∑^1 if^ wß>^0 ,^0 otherwisej^ j^ •^ bias: -0.1^ •^ α^ = 0.^1 •^ initially, all weights 0

inputs^ output^1 0 0 00 1 1 11 1 0 11 1 1 10 0 1 01 0 1 10 0 0 00 1 0 0 Department of Computer Science — University of San Francisco – p. 5/

?

24-7: Example^ inputs^ expected output^ w^

w2^ w3^ actual output^ new^ weights 1 0 0 0 0 0 0 0 0 0

0 0 0 0.1^ 0.

Department of Computer Science — University of San Francisco – p. 7/?

24-8: Example^ inputs^ expected output^ w^

w2^ w3^ actual output^ new^ weights 1 0 0 0 0 0 0 0 0 0

0 0 0 0.1^ 0.

0.1^0 0.1^ 0.2^ 0.

Department of Computer Science — University of San Francisco – p. 8/?

24-10: Example^ inputs^ expected output^ w^

w2^ w3^ actual output^ new^ weights 1 0 0 0 0 0 0 0 0 0

0 0 0 0.1^ 0.

0.1^0 0.1^ 0.2^ 0.

1 1 1 1 0.1^ 0.

0.1^1 0.1^ 0.2^ 0.

0 0 1 0 0.1^ 0.

0.1^0 0.1^ 0.2^ 0.

Department of Computer Science — University of San Francisco – p. 10/?

24-11: Example^ inputs^ expected output^ w^

w2^ w3^ actual output^ new^ weights 1 0 0 0 0 0 0 0 0 0

0 0 0 0.1^ 0.

0.1^0 0.1^ 0.2^ 0.

1 1 1 1 0.1^ 0.

0.1^1 0.1^ 0.2^ 0.

0 0 1 0 0.1^ 0.

0.1^0 0.1^ 0.2^ 0.

1 0 1 1 0.1^ 0.

0.1^1 0.1^ 0.2^ 0.

Department of Computer Science — University of San Francisco – p. 11/?

-^ At this point, the network is trained properly.^ ◦^ In many cases, we would need more iterations toconverge on a solution.

  • 24-12: Example inputs expected output w
    • w2 w3 actual output new weights
      • 0 0 0 0.1 0.
        • 1 1 0 1 0 0.
        • 0.1^0 0.1 0.2 0.
          • 1 1 1 1 0.1 0.
          • 0.1^1 0.1 0.2 0.
            • 0 0 1 0 0.1 0.
            • 0.1^0 0.1 0.2 0.
              • 1 0 1 1 0.1 0.
              • 0.1^1 0.1 0.2 0.
                • 0 0 0 0 0.1 0.
                • 0.1^0 0.1 0.2 0.
  • 24-13: Example inputs expected output w
    • w2 w3 actual output new weights
      • 0 0 0 0.1 0.
        • 1 1 0 1 0 0.
        • 0.1^0 0.1 0.2 0.
          • 1 1 1 1 0.1 0.
          • 0.1^1 0.1 0.2 0.
            • 0 0 1 0 0.1 0.
            • 0.1^0 0.1 0.2 0.
              • 1 0 1 1 0.1 0.
              • 0.1^1 0.1 0.2 0.
                • 0 0 0 0 0.1 0.
                • 0.1^0 0.1 0.2 0.
                  • 0 1 0 0 0.1 0.
                  • 0.1^1 0.1 0.1 0.

24-14: Gradient Descent and the Delta rule^ •^ Recall that perceptrons are only able to perfectly learn

linearly

separable^ functions.^ ◦^ This is their representational bias. • In other cases, we can still learn as much as is possible. • We’ll interpret this to mean minimizing the sum of squared error.∑^2 • E^ = 1/^2 (t−^ o)for^ d^ in training set.d^ d

Department of Computer Science — University of San Francisco – p. 14/?

24-16: Multilayer Networks^ •^ While perceptrons have the advantage of a simple learningalgorithm, their computational limitations are a problem.^ •^ What if we add another “hidden” layer?^ •^ Computational power increases^ ◦^ With one hidden layer, can represent any continuousfunction^ ◦^ With two hidden layers, can represent any function^ •^ Problem: How to find the correct weights for hidden nodes?

Department of Computer Science — University of San Francisco – p. 16/?

24-17: Multilayer Network ExampleOutput units^ ai^ Wj,i Hidden units^ aj^ Wk,j^ Input units^ ak

Department of Computer Science — University of San Francisco – p. 17/?

24-19: Backprogagation^ •^ Notation:^ ◦^ a- output of the jth hidden unit.j^ ◦^ o- output of the ith output unit.i^ ◦^ t- output for the ith training examplei^ ◦^ Output error for output node

i:^ (t−^ o)i^ i ◦ Delta rule for output node i: δ= (t− o) ∗ g(input) ∗ (1 −^ g(input))i i iii • Weight updating (hidden-output):^ W=^ W+^ α^ ∗^ a∗^ δj,i^ j,i^ j^ i ′ • Same as the perceptron rule, except that we use use^ g rather than just the difference between expected andactual.^ Department of Computer Science — University of San Francisco – p. 19/

?

24-20: Backpropagation^ •^ Updating input-hidden weights:^ •^ Idea: each hidden node is responsible for a fraction of the errorin^ δ.i^ •^ Divide^ δaccording to the strength of the connection betweeni^ the hidden and output node.^ •^ For each hidden node^ j ∑^ •^ δ=^ g(input)(1^ −^ g(input))^ j^

Wδj,ii i∈outputs • Update rule for input-hidden weights: • W= W+ α ∗ input∗ δjk,j k,j k Department of Computer Science — University of San Francisco – p. 20/

?