Course 1 week 4 assignment 2: wrong output for parameter but costs OK

I have an issue with both ex of assignment2: wrong output for parameters (W,b) but costs results at each interaction were all right. I used the functions provided like pic and I think I gave that argument right but it still does not change. anyone can help?



Capture2

Here are my results from the two_layer_model test cell:

Cost after iteration 1: 0.6926114346158595
Cost after first iteration: 0.693049735659989
Cost after iteration 1: 0.6915746967050506
Cost after iteration 1: 0.6915746967050506
Cost after iteration 1: 0.6915746967050506
Cost after iteration 2: 0.6524135179683452
 All tests passed.

You’ll notice that my cost values shown are the same as what you show except for the very last one. If you look at the logic in public_tests.py for two_layer_model_test, you’ll see that there are 4 different test cases. The first 3 of them use learning_rate = 0.0075, which is the default value in the update_parameters routine. But the 4th case uses 0.1. That’s the one where your cost value is different, so that probably indicates that your are “hard-coding” the learning rate value when you call update_parameters from two_layer_model.

1 Like

I think maybe you are right. but now i have trouble accessing lab

It could just be that your “login cookie” for Coursera has expired. Try logging out and logging in again.

1 Like

It’s still like this and I tried deleting my cache and logged again.

It’s solved. Thanks for your help!

1 Like