C1_W3_Logistic_Regression: compute_gradient AssertionError

Hi, I’m facing an AssertionError I can’t get past in my week 3 practice lab. I’m getting the following output:
dj_db at test w and b: -0.6
dj_dw at test w and b: [-44.83135361795273, -44.37384124957207]
This is actually pretty close to the required output, which is:
dj_db at test w and b (non-zeros):-0.5999999999991071
dj_dw at test w and b (non-zeros):[-44.8313536178737957, -44.37384124953978]

For one thing, i don’t understand why the values aren’t exactly the same, and for another, the error message is very puzzling:

AssertionError: Wrong value for dj_db. Expected: 0.28936094 got: 0.4188258252707137

It seems to be expecting a completely different value from the one we’re supposed to get as per the “Expected Output” part.

Can someone please help me figure this out?

There are multiple tests. Some are built into the notebook, some are in a utility python file.

All of them have their results displayed in the notebook. That’s why you see multiple sets of results.

1 Like

Ah, okay. Apparently we’re not supposed to post code here publicly, so can I message it to you? I can’t figure out what’s wrong with it anyway.

I believe this part of the assignment has detailed Hint codes, which pretty much give you the entire solution.

1 Like