Week 2 Exercise 8 error

I think I have the correct implementation for all the code.
I directly put num_iterations, learning_rate, print_costs as parameters without hard-coding them with values when passing them to optimize()
and I did update w, b using params

but I got the following error:

also, my code successfully passes all the previous exersies

1 Like

Also, I did pass X_test to predict when calculating Y_prediction_test

Hi @dmeng , welcome to Discourse! I am not sure whether somebody already responded to you or whether you managed to fix the problem. Assertion errors typically have to do with either the initialization, passing the wrong parameters to the gradient descent, or using global variables instead of local variables when calling a function. Did you check for this and manager to resolve?

I’ve got this resolved. It seems that the issue was I messed up with indices in a loop. I used 1 instead of l (because they look very similar in Jupyter’s font). Thanks anyways!

[quote=“dmeng, post:1, topic:24568”]
I think I have the correct implementation for all the code.
I directly put num_iterations, learning_rate, print_costs as parameters without hard-coding them with values when passing them to optimize()
and I did update w, b using params