Let's solve this step by step. The main concept here is Nesterov Accelerated Gradient (NAG). The trick is that NAG calculates the gradient at a look-ahead position, not at the current weight.

Step 1: Write down the given values

ParameterValue
Input x0.5
True output y1
Initial weight w05
Initial bias b0-5
Momentum β0.9
Learning rate η0.1
Current velocity u80.8
Current weight w92.5
Current bias b90

We need to calculate:

∇wL at the look-ahead position

Step 2: Understand the NAG formula

NAG uses two equations:

Velocity update:

ut=βut−1+∇L(wt−βut−1)

Weight update:

wt+1=wt−ηut

Notice something important:

NAG first looks ahead using:

wt−βut−1

Then calculates the gradient at that position.

Step 3: Calculate the look-ahead weight

We are given:

w9=2.5,u8=0.8

Using:

w10=w9−βu8

Substitute:

=2.5−(0.9×0.8)

=2.5−0.72

w10=1.78

Step 4: Calculate the look-ahead bias

Similarly:

b10=b9−βu8

Substitute:

=0−(0.9×0.8)

b10=−0.72

Now we have our look-ahead position:

Step 5: Calculate the sigmoid output

Remember the sigmoid formula:

y^=11+e−z

Where:

z=wx+b

Substitute the look-ahead values:

z=(1.78×0.5)+(−0.72)

z=0.89−0.72

z=0.17

Now apply sigmoid:

y^=11+e−0.17

y^≈0.5424

Step 6: Calculate the gradient

This is the most important step.

For a sigmoid neuron with the given MSE loss:

∂L∂w=(y^−y)y^(1−y^)x

We know:

Substitute:

=(0.5424−1)(0.5424)(1−0.5424)(0.5)

Solve each part:

=(−0.4576)(0.5424)(0.4576)(0.5)

∂L∂w≈−0.0569

Final answer: −0.057 ≈ −0.056

What to remember for the exam

The entire question follows just these 4 steps:

StepWhat to do
1Look-ahead weight: w−βu
2Look-ahead bias: b−βu
3Calculate sigmoid output using look-ahead values
4Calculate gradient using (y^−y)y^(1−y^)x

Important exam trick:

Don't confuse these two:

And one more thing: The question asks for the gradient of the look-ahead value, NOT the next updated weight. Therefore, you don't need to calculate the final velocity or update the weight using learning rate 0.1.


 

Let's modify the original question so that instead of asking for the gradient of the look-ahead value, it asks for the next weight and bias after the NAG update.

Revised question (exam format)

A sigmoid neuron has a single input x=0.5 and the true output is y=1. The initial weight and bias are w0=5 and b0=−5.

The model uses Nesterov Accelerated Gradient Descent (NAG) with momentum parameter β=0.9 and learning rate η=0.1. The loss function is:

L(w)=12(y^−y)2

After 10 iterations (starting from iteration zero), the parameter values at iteration t=9 are:

u8=0.8,w9=2.5,b9=0

Calculate the next updated weight and bias after one NAG iteration.

Step-by-step solution

Step 1: Calculate look-ahead weight

NAG formula:

wlookahead=w9−βu8

=2.5−(0.9×0.8)

wlookahead=1.78

Step 2: Calculate look-ahead bias

blookahead=b9−βu8

=0−(0.9×0.8)

blookahead=−0.72

Step 3: Calculate predicted output

First calculate:

z=wx+b

z=(1.78×0.5)−0.72

z=0.17

Apply sigmoid:

y^=11+e−0.17

y^=0.5424

Step 4: Calculate gradient

For sigmoid with MSE:

∇L=(y^−y)y^(1−y^)x

Substitute:

=(0.5424−1)(0.5424)(1−0.5424)(0.5)

∇L=−0.0569

Step 5: Calculate new velocity

u9=βu8+∇L

=0.9(0.8)−0.0569

u9=0.6631

Step 6: Calculate updated weight

w10=w9−ηu9

=2.5−(0.1×0.6631)

w10=2.43369

Step 7: Calculate updated bias

b10=b9−ηu9

=0−(0.1×0.6631)

b10=−0.06631

Final answer

Updated weight

2.43369

Updated bias

-0.06631

What to remember for the exam

If question asks for...Stop at...
Gradient of look-ahead valueStep 4
New velocityStep 5
Updated weightStep 6
Updated weight and biasStep 7

One important correction: In the original question, the look-ahead bias was calculated using the same velocity u8, as shown in the provided solution. We have followed that convention here.

Also, the given answer −0.056 is rounded; using more accurate sigmoid calculations gives approximately −0.0569.