C1_W3 Assignment Ex 4

I have an issue with the ex 4 in the Assignment of Single Perceptron Neural Networks for Linear Regression, I tried to call out each variable properly but still the same output:


TypeError Traceback (most recent call last)
in
----> 1 w3_unittest.test_forward_propagation(forward_propagation)

~/work/w3_unittest.py in test_forward_propagation(target_forward_propagation)
289
290 for test_case in test_cases:
→ 291 result = target_forward_propagation(
292 test_case[“input”][“X”],
293 test_case[“input”][“parameters”],

TypeError: forward_propagation() takes 2 positional arguments but 3 were given

Have you posted in the correct category?

You’re using one of the Short Course forum areas, but your question seems to be for one of the multi-course Specializations.

You can move your thread by using the “pencil” icon in the thread title.

Didnt realize, I think now is good :slight_smile:

This error usually means you are using an out-of-date copy of the programming assignment notebook or the w3_unittest.py file.

The check to be sure is, how many arguments are given in the function definition statement for forward_propagation()?

If there are only two, you’re using an old notebook.

Those are only two arguments, is there any way I can update the copy of the programming assignment?, I am a pretty newbie taking these courses, what would be the procedure?

Yes, you can get a new copy of the assignment notebook, and start over.

You can find the procedure in the M4ML FAQ. You can find it by using the forum Search tool.

I just updated the notebook and reboot the assignment but I am still getting the same error:

TypeError Traceback (most recent call last)
in
----> 1 w3_unittest.test_forward_propagation(forward_propagation)

~/work/w3_unittest.py in test_forward_propagation(target_forward_propagation)
289
290 for test_case in test_cases:
→ 291 result = target_forward_propagation(
292 test_case[“input”][“X”],
293 test_case[“input”][“parameters”],

TypeError: forward_propagation() takes 2 positional arguments but 3 were given

Now is working, I passed the 3 arguments and it worked, not sure if was something that I forgot to close the browser one last time, but once I closed it and reopen it, ran the cell and worked, appreciate!

That’s good news!

The autosave on the workspace doesn’t always work. So “Save and checkpoint” is recommended.

And you usually need to restart the kernel when there are any major changes to your assignment.

Good to know, thanks for the advise! :smiley: