C1_W3_Logistic_Regression UNQ_C2: How do I debug this?

I am attempting a vectorized solution to UNQ_C2 in the final lab of the Supervised Learning course (Course 1 in the Machine Learning Specialization, Week 3).

I am getting the following error message and do not understand how it is happening. The code passes the first test, but fails on the second in this fashion:

I’m not sure what to make of this because in a vectorized solution I’m not initializing any such z_wb at all. What should I be looking for to debug this?

I don’t have access to this specialization but logically speaking there must be something wrong at the compute cost function or even the target() function. I would starting checking their implementation!

“target()” is provided by the test case. That’s not the issue.

Your code in compute_cost() isn’t computing the correct cost value.

Tip: Try adding some print() statements to display some intermediate results. Compare them to computing the same values by hand.

hi @0rb

intializing z_wb = b is incorrect.

go through the instructions again, you will find the solution.

Regards
DP

1 Like