Question

Exercise Optimization in neural network Consider a very simple neural network with two input values, one output value, and a

0 0
Add a comment Improve this question Transcribed image text
Answer #1

ANSWER:

The least square loss is basically the sum of squares of the residuals. A residual is defined as the predicted value subtracted from the true value.

Predicted value at (x1, x2) = sigmoid(w1x1 + w2x2 + b)

Considering the single piece of training data and the given weights, the loss is equal to

L = (true value - observed value)2

= (0 - sigmoid(w1x1 + w2x2 + b))2

= (sigmoid( (1)(1)+ (1)(-1) + 1))2

= (sigmoid(1))2

We are asked to perform gradient descent, this means we need to change the values of the weights and biases in such a way that the loss is decreased as much as possible.

To find this optimal change at the given point, we consider the loss function without plugging in the values of weights and biases, i.e

L(w1, w2 , b) = (sigmoid(w1(1)+ w2 (-1)+ b))2

= (sigmoid(w1 - w2+ b))2

Now, we use the fact that partial derivatives indicate the change in value with respect to the given weight.

al дw д(а(wi — 02 + b))? дw1θσ(w1 = 2σω- 2 + 6). Ow1 m2 + 6)

► 20(W1 - W2 + b)2(1 – 0(W1 - W2 +b))    (Since (0)0 - 1)(2) = d) )

Similarly

OL диша — 20(W1 l2 +b)=(1 – (ші Ш2 + b))

მL მს 23(2u1 — x2 + 6) (1 — 7(u1 — + ))

Now for the given weights,

OL 001 = 2)- 0 e+1e+1 this means as w1 is increasing loss is increasing therefore to decrease it, we have to take a step in the negative direction. Since the step size has already been mentioned. The new weight w1 = 1 - 2 = -1

მL მს 2 e -)2, # +1 & +1 0 Similar to w1 , b becomes 1-2 i.e b = -1

e OL Ow2 -2- 26 <0 e +1 e +1 This is opposite to the above case and hence we increase the weight for w2  i.e w2 = 3

NOTE:We can observe that the loss has not decreased, after taking the step. This is because the step size being too big, it overshooted.

Add a comment
Know the answer?
Add Answer to:
Exercise Optimization in neural network Consider a very simple neural network with two input values, one...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT