Wrong values for b1 - update_parameters() Neural Networks and Deep Learning course, week-3 Planar Data Classification with One Hidden Layer assignment

I have checked the code it is correct but the execution shows assertion error - wrong values for b1.
Does anyone know how to solve this?

Hi @Nimeesha_Pachipulusu, please let me know for which assignment and course you are asking about? Unless we have this idea, we won’t be able to help you out. Thanks.

sorry for not including details.
The question is from Neural Networks and Deep Learning course, week-3 Planar Data Classification with One Hidden Layer assignment.

Hi @Nimeesha_Pachipulusu, the other outputs are fine. I think you might have typed the wrong code initially for b1 and then would have rewrote it. Just erase the code for b, b1, db etc for this cell, then save the work . Go to kernel–>click restart and clear output–> run the cells from the beginning and then rewrite the codes for b, b1 and db again. Let me see if this works in your favour or not :slight_smile:

Here are my results for that test case:

W1 = [[-0.00643025  0.01936718]
 [-0.02410458  0.03978052]
 [-0.01653973 -0.02096177]
 [ 0.01046864 -0.05990141]]
b1 = [[-1.02420756e-06]
 [ 1.27373948e-05]
 [ 8.32996807e-07]
 [-3.20136836e-06]]
W2 = [[-0.01041081 -0.04463285  0.01758031  0.04747113]]
b2 = [[0.00010457]]
All tests passed!

You’ll notice by comparing that the results for W1, W2 and b2 that you show agree with mine. It is only in the case of b1 that they differ. So that should be a pretty good clue where to look for the problem. Note that your b1 value is the correct shape (4 x 1), but there must be something specific about the line that updates b1 that is incorrect.

1 Like

Hi,
I tried doing this but did not work.
Can you tell me " Just erase the code for b, b1, db etc for this cell," what do you mean by this?
the code for b,b1 and db1 are in previous cells

Hi,
I have rechecked the code, it is all correct.
I am not sure how to fix this.

@Nimeesha_Pachipulusu, what I meant is, in your exercise 7- update_parameters, erase all the values of b1—> then save your work—> go to kernel—> click restart and clear all outputs—> run the cells from the beginning and then rewrite the codes for b1 again in the asked spaces and check out whether this works or not? :slight_smile:

Hi,

Thank you for the help.
There was a minor error in the code. Paul helped me debug it and now the error is fixed.

Regards,
Nimeesha

1 Like

Okay @Nimeesha_Pachipulusu. Great!