Would you please try an experiment for us and see if that changes the results? Click âFile â Openâ to get the file explorer view of the assignment. Then delete all the âutility dot pyâ files, like public_tests.py, test_utils.py and so forth. Just click the check box and then click the trash can icon and confirm the dialog. Then click âHelp â Lab Help â Get Latest Versionâ. That will replace all those files with the current (latest) version.
Once youâve done that, please run the tests again and let us know if that changes the results or not.
Hi,
I also experienced the same issue even after I updated the files version. However, if I put the variables in front of the called function, i got an error âUnboundLocalError: local variable âparametersâ referenced before assignmentâ.
iâm having same issue cost function values are same as expected but the value of W1 is wrong i tried to run intialize parameters which also showed wrong values for W1 im using np.random.rand((a,b))*0.01. Can anybody help
That is the wrong rand function. Please have another careful look at the instructions. Notice that your values are all positive, but the expected values are both positive and negative. Thatâs also the wrong syntax for invoke one of the np.random functions: it is np.zeros and np.ones that take tuples as arguments.
I am also getting the same AssertionError: Wrong values for W1, although all previous tests were passed. I followed your instructuctions on getting latest versions of files but it didnât help.
Can you please help me with it?
Thank you!
I am getting following output:
Cost after iteration 0: 0.693497
Cost after iteration 1000: 0.693497
Cost after iteration 2000: 0.693497
Cost after iteration 3000: 0.693497
Cost after iteration 4000: 0.693497
Cost after iteration 5000: 0.693497
Cost after iteration 6000: 0.693497
Cost after iteration 7000: 0.693497
Cost after iteration 8000: 0.693497
Cost after iteration 9000: 0.693497
W1 = [[ 0.01788628 0.0043651 ]
[ 0.00096497 -0.01863493]
[-0.00277388 -0.00354759]
[-0.00082741 -0.00627001]
[-0.00043818 -0.00477218]]
b1 = [[0.]
[0.]
[0.]
[0.]
[0.]]
W2 = [[-0.01313865 0.00884622 0.00881318 0.01709573 0.00050034]]
b2 = [[0.]]
Notice that your cost values are not changing at all. The first thing to look for would be some problem in how you are doing the âupdate parametersâ step. E.g. using the wrong variable name for the dictionary containing the parameters that is returned from the update parameters call.
Yes, update_parameters was also my first checkpoint. Thank you for the help. A silly spelling mistake in nn_model was causing the issue. Fresh eyes could spot it. Sorry for the trouble.
In the future, I recommend you check the age of a thread before you post a reply. In this case, the thread had been cold for 3 years.
Fortunately Mentor Paul is still active, but in many cases, old threads are no longer monitored. In that case, starting a new thread is a better strategy.