C2_W4_Assignment Exercise 4 - Back_prop

{moderator edit - solution code removed}

Test your function

w4_unittest.test_back_prop(back_prop)
Wrong output values for gradient of b1 vector.
Expected: [[ 0.56665733]
[ 0.46268776]
[ 0.1063147 ]
[-0.17481454]
[ 0.11041817]
[ 0.32025188]
[-0.51827161]
[ 0.08430878]
[ 0.19341 ]
[ 0.08339139]
[-0.35949678]
[-0.13053946]
[ 0.19055422]
[ 0.56405985]
[ 0.13321988]]
Got: [[0.56665733]
[0.46268776]
[0.1063147 ]
[0. ]
[0.11041817]
[0.32025188]
[0. ]
[0.08430878]
[0.19341 ]
[0.08339139]
[0. ]
[0. ]
[0.19055422]
[0.56405985]
[0.13321988]].
Wrong output values for gradient of b1 vector.
Expected: [[ 0.01864644]
[-0.31966546]
[-0.3564441 ]
[-0.31703253]
[-0.26702975]
[ 0.14815984]
[ 0.25794505]
[ 0.24893135]
[ 0.05895103]
[-0.15348205]]
Got: [[0.01864644]
[0. ]
[0. ]
[0. ]
[0. ]
[0.14815984]
[0.25794505]
[0.24893135]
[0.05895103]
[0. ]].
14 Tests passed
2 Tests failed
I don’t know why Wrong output values for gradient of b1 vector.
this images is b1 vector in Exercise 4 - back_prop

Hi @supehero001

Make sure your formula and the helper functions used in them are correct. Btw, in backprop, biases usually have their gradients computed based on the error from the current layer, ensure that this is implemented correctly, too.

Hope it helps! Feel free to ask if you need further assistance by sharing your code in private messages (you cannot share your code here!).

can I send my code and you help me review

I’ve had this conversation with @supehero001 in a private thread. The problem is that they ignored the code for l1 that was given in the template code in the clean notebook and replaced that with something else that is incorrect.

2 Likes