W4 A1 | Ex-4| Assertion error db.shape == b.shape | 2-layer model

In the 2 layer model, I’m getting an assertion error that db.shape == b.shape. I’ve printed both shapes and they are equal (7,1). Any suggestions on how to approach this would be appreciated.

There must be something wrong with your experimental methodology there: if the shapes are really the same, why does the assertion fail? Please note that there may be more than one test case there. Are you sure you’re looking at the values from all the test cases?

Or maybe the bigger issue is that you don’t have the ability to directly instrument the code in linear_backward, since that is imported from a utility file. It’s not your code from the “Step by Step” exercise. Well, you could “hand-import” it and then instrument it. But you need to be careful with that approach in general: hand-importing the “initialize deep” routine will fail the test cases here.

Dear @jeffreykkerns,

Can you please send me your notebook to me via personal message. I’ll look into it and let you know the problems and solutions.

1 Like

Hi Paul - thank you for your response. Problem has been solved. I mistakenly used b2 instead of b1 in the linear_activation_forward with ‘relu’.

1 Like

Thanks Girijesh - I have solved this problem.

Dear @jeffreykkerns,

you are welcome. Feel free to contact me any time.

1 Like