Neural Network Assignment: Perceptron Weights and Backpropagation Rules - Prof. Worthy Mar, Assignments of Computer Science

A neural network assignment with instructions to find weights for a perceptron to output specific logical functions, fill out a table to determine new weights after training iterations, and derive the backpropagation rules for perceptrons using a tanh excitation function.

Typology: Assignments

Pre 2010

Uploaded on 03/10/2009

koofers-user-r9d-1
koofers-user-r9d-1 ๐Ÿ‡บ๐Ÿ‡ธ

10 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Neural Network Assignment
Due December 10th
The first two questions are required. Question three is 10% extra credit.
1. You are given a simple Perceptron with 3 inputs, A, B, and C that uses a step
function with threshold of 0.5 (on the step boundary the output of the step
function is not defined). Find weights between 0 and 1 such that the output is:
a. (A and B) or C
b. A and (B or C)
2. You are given the following Perceptron to train on the xor function. Fill out the
table provided in order to determine what the new weights will be after two
training iterations. Use the weight modification rules provided in class for a
sigmoidal excitation function, with the following change. For the hidden and
output neurons, there is a bias that is applied to the sigmoid functions. This can be
interpreted as implied neuron that always fires and whose weight is set equal to
that bias. This allows one to learn biases for the neurons as well as learning the
weights. Use รŸ = 0.5.
wbias,h1 wa,h1 wb,h1 wbias,h2 wa,h2 wb,h2 wbias,o wh1,o wh2,o
Initial weights 0.68 0.38 0.83 0.5 0.71 0.43 0.30 0.19 0.19
Timestep Case erro errh1 errh2 ?w
bias,h1 ?w
a,h1 ?w
b,h1 ?w
bias,h2 ?w
a,h2 ?w
b,h2 ?w
bias,o ?wh1,o ?w
h2,o
1 a=0,b=0 -0.0279 -0.00312 0 0 0 0
a=0,b=1
a=1,b=0
a=1,b=1
wbias,h1 wa,h1 wb,h1 wbias,h2 wa,h2 wb,h2 wbias,o wh1,o wh2,o
New weights 0.37989
2 a=0,b=0
a=0,b=1
a=1,b=0
a=1,b=1
a
b
h1
h2
o
pf3
pf4

Partial preview of the text

Download Neural Network Assignment: Perceptron Weights and Backpropagation Rules - Prof. Worthy Mar and more Assignments Computer Science in PDF only on Docsity!

Due December 10th

The first two questions are required. Question three is 10% extra credit.

  1. You are given a simple Perceptron with 3 inputs, A, B, and C that uses a step function with threshold of 0.5 (on the step boundary the output of the step function is not defined). Find weights between 0 and 1 such that the output is: a. (A and B) or C b. A and (B or C)
  2. You are given the following Perceptron to train on the xor function. Fill out the table provided in order to determine what the new weights will be after two training iterations. Use the weight modification rules provided in class for a sigmoidal excitation function, with the following change. For the hidden and output neurons, there is a bias that is applied to the sigmoid functions. This can be interpreted as implied neuron that always fires and whose weight is set equal to that bias. This allows one to learn biases for the neurons as well as learning the weights. Use รŸ = 0.5.

wbias,h1 wa,h1 wb,h1 wbias,h2 wa,h2 wb,h2 wbias,o wh1,o wh2,o Initial weights 0.68 0.38 0.83 0.5 0.71 0.43 0.30 0.19 0. Timestep Case erro errh1 errh2? wbias,h1? wa,h1? wb,h1? wbias,h2? wa,h2? wb,h2? wbias,o? wh1,o? wh2,o 1 a=0,b=0 -0.0279 -0.00312 0 0 0 0 a=0,b= a=1,b= a=1,b= wbias,h1 wa,h1 wb,h1 wbias,h2 wa,h2 wb,h2 wbias,o wh1,o wh2,o New weights 0. 2 a=0,b= a=0,b= a=1,b= a=1,b=

a b

h1 h

o

  1. Attached is a derivation for the backpropagation rules for Perceptrons that use a sigmoidal excitation function. Derive an appropriate error function and weight update rule for Perceptrons that use a tanh excitation function. Make the rules as simple as possible by choosing appropriate substitutions โ€“ such as

oi (^) [ h ]for ( xi wi ) (^) i [ h ]

r r tanh โ‹…. (Hint:

( ( )) h ( ) x ( ) x x

x (^) 2 2 sec 1 tanh

tanh = = โˆ’ โˆ‚

[ ] [ ]

( i i ) i [ h ] ( ( in ) hid ) out

ihjo

xc f x w f f x w w w

P

ฮด

r r rr r r = โ‹… โ‹… โˆ‚

,

, , or

[ ] [ ]

( i i ) i [ h ] ( ( in ) hid )( ( ( in ) hid )) out

ihjo

xc f x w f f x w w f f x w w w

P

ฮด

r r r r r r r r r r = โ‹… โ‹… โˆ’ โ‹… โ‹… โˆ‚

,

, ,

for the hidden neurons. If we use the alternative identifications oi [ h ] f ( xi wi ) i [ ] h

r r โ‰ก โ‹… and

o j [ ] o f ( f ( x win ) whid )

r (^) r r r = โ‹… โ‹… , this becomes

[ ] [ ]

i [ h ] j [ ] o (^ j [ ] o )^ out

ihjo

xc o o o w

P

= โˆ’ ฮด โˆ‚

,

, .

Likewise, for the input neurons, we find

[ ] [ ]

( ( in ) hid ) hid ( ) j [ h ] i out

ii jh

xc f f x w w w f x w x w

P

ฮด

r (^) r r r r r = โ‹… โ‹… โ‹… โˆ‚

,

, , or

[ ] [ ]

i j [ h ] (^ j [ ] o )^ jhk [ ] o j [ ] h (^ j [ h ])^ out

ii jh

xc xo o w o o w

P

= โˆ’ โˆ’ ฮด โˆ‚

2 1 [], 1

,

, .

If we define the error for the hidden neurons to then be ฮด j [ h ] โ‰ก w j [ h ], k [ ] o oj [ h ] ( 1 โˆ’ oj [ ] h ) ฮด^ out ,

and the inputs xi to be considered as the outputs from the input neurons oi (^) [ ] i , then we can

finally combine both equations into

i j^ (^ j )^ j

ij

xc oo o w

P

= โˆ’ ฮด โˆ‚

,

, .