What happened to logistic regression codes?

hi there! may I ask what could let this problem show up?
I tried to check the predict part, the optimize part and the initialize part, found nothing wrong with them. And all tests worked fine. so why such kind of assertionError showed up?

The following cell failed: from public_tests import * model_test(model) The error was: --------------------------------------------------------------------------- AssertionError Traceback (most recent call last) in 1 from public_tests import * 2 ----> 3 model_test(model) ~/work/submitted/courseraLearner/W2A2/public_tests.py in model_test(target) 131 assert type(d[‘w’]) == np.ndarray, f"Wrong type for d[‘w’]. {type(d[‘w’… 132 assert d[‘w’].shape == (X.shape[0], 1), f"Wrong shape for d[‘w’]. {d['w… → 133 assert np.allclose(d[‘w’], expected_output[‘w’]), f"Wrong values for d[… 134 135 assert np.allclose(d[‘b’], expected_output[‘b’]), f"Wrong values for d[… AssertionError: Wrong values for d[‘w’]. [[0.] [0.] [0.] [0.]] != [[ 0.08639757] [-0.08231268] [-0.11798927] [ 0.12866053]]

Which course are you attending?

You’ve posted in the “AI Discussions” forum area, but it sounds like your question applies to a specific course. For that, you should use the “Course Q&A” forum, find your course from the dropdown list, and then select the appropriate week number tag.

oh thanks a lot !!! i’ll try to post it in the course discussion forum of Deep Learning :blush:

This looks like it is DLS C1 W2 the Logistic Regression assignment. I just moved the thread using the little “edit pencil” on the title.

It looks like the problem is that your w values are not getting updated by gradient descent. So if your previous functions like propagate and optimize pass their tests, the problem must be in how you deal with the returned parameter values from the optimize call. Probably you are using an incorrect or misspelled variable name somewhere.