Course1 Week 3 Programming assignment (Exercise 8_nn model)

AssertionError: Wrong values for W1

Screen Shot 2565-05-27 at 09.52.53

Welcome to Discourse!
Can you please share your notebook as pdf on pm by clicking on my name so that I can have a look at that and suggest you what can be done
Probably it is due to you having a lower learning rate
But I will need to confirm it by seeing your notebook
Thanks and Regards,
Mayank Ghogale

1 Like

{moderator edit - notebook image removed}

This is my notebook.
Thanks and Regards,
Kotchaporn Klomjai

I do not remember it is already set as a default, or not … But, please try to remove setting the seed for a random number in "initialize_parameters(n_x, n_h, n_y). That is “np.random.seed(2)” in that function. (As the test program set the seed to 2, it should work for a local testing. But, when this routine is called from nn_model(), nn_mode sets its seed to 3. Overriding the seed may cause “small changes” in outputs.

By the way, it may be better not to post whole solution in here even in PDF format. If removing the seed works, then, please remove a PDF file.

Hello sir,
Please try this solution out and remove the pdf from here
You can share notebook to me on private message…not here sir
Thanks and Regards,
Mayank Ghogale

I have some more question though, i accidentally deleted util notebook. How can i retrieve them back ?

Hi, I am having an issue with Week 3 Programming assignment. Every time I turn in my notebook I get graded 0, I don’t understand why because I passed all the tests mentioned on the assignment. Could someone please help me with this?

All problem have solved already. Thanks

Hey @Kotchaporn_KLOMJAI,
I believe if you refresh your workspace, you can get all the files back, but make sure to store your progress if any in the corresponding assignment beforehand, perhaps by downloading the .ipynb notebook, since it will reset your progress.

H​ow to Refresh your Workspace

T​his reading item has instructions on how to refresh your workspace. This will come in handy whenever you’d need to fetch the (latest) assignment and/or other files. And in cases of opening the assignment runs into a 404 error .

H​ow to Refresh your Workspace:

O​ption 1 - Using Lab Help

  1. O​pen the assignment.
  2. After the assignment opens up, c​lick " File" (top left) and then " Open…"
  3. W​hen your workspace opens, select the check box before your assignment file. After it is selected, press " Shutdown" .
  4. U​sing the same procedure mentioned above, " Rename" your file. For instance you can change it from assignment_name.ipynb to assignment_name_v2.ipynb . By doing this you’ll be able to save your current progress on the assignment after the latest assignment file is fetched.
  5. Using the same procedure, " Delete" any other file, if any, that you want to get a fresh copy of.
  6. After renaming your file, click on the " Help" button on the top right of the page. From the panel that opens, click " Get latest version" button, and then " Update lab" .
  7. A​fter the page reloads go to File → Open… , as described in (2)
  8. Now you’ll see two notebook files. The one you renamed (as done in step 4) will have your previous progress, and the latest version. (Depending on how many previous versions you have kept saved, you could have more than two assignment files in the worksapce)

O​ption 2 - via URL

I hope this helps.


Hey @Prianka_Bose,
Welcome to the community. Can you please attach a screenshot of your grader output from the “My submissions” tab.


Sure, Elemento. Here is the what I received from the grader.

If you are sure that all the internal tests in the notebook pass, the most likely cause is that some other part of the notebook infrastructure that the grader depends on has gotten corrupted accidentally. One thing to try would be to get a clean copy using the topic on the DLS FAQ Thread and then very carefully “copy/paste” over just your completed code from the “YOUR CODE HERE” sections and then try again.

Or if you have added any extra code cells in the notebook, I think the grader on this particular assignment will fail like this. Please check and delete any such extra cells first and see if that helps. If that’s not it, then try the “clean copy” method.

Thanks for responding. I went to the thread you linked above but upon going to the “clean copy” method I am expected to “get a fresh copy” first which I am not able to do. Could you please help me with that?

The instructions are pretty explicit and complete. Here is the thread.

Elemento also gave a more condensed version of the instructions earlier on this thread. Have a look if my link is too verbose for you.