Hi @eeshita_pande,
You have incorrect implementation of the variable cost in your Ex 5.
Best,
Mubsi
Iām seeing a similar issue where compute_cost_test_case is not returning results in expected shapes.
The following cell returns (1,3) and (1,400) while A2 is expected to be (1,400) as well.
A2, t_Y = compute_cost_test_case()
print (A2.shape)
print (Y.shape)
Lab ID : ejyowuhq
Thanks
Hi @_daohang,
My apologise for replying this late. I was on a vacation. But Iām back now. Is this something you still need help me ? Let me know.
Thanks,
Mubsi
That means there is a bug in your code: you must be referencing global variables instead of the actual parameters passed into your function.
While I still believe there was something wrong in the provided code testing this specific function but Iām good now.
So I unblock myself quickly from it. Thanks.
Hi @Mubsi I am getting error in Week3 exercise 6 in backpropagation calculation of dZ1
can you help me what wrong I am doing ⦠lab id ebxwifkh
regards,
Jitendra
Mubsi is a pretty busy guy, so itās worth investing a little more effort in trying to debug this yourself. What is the error that you are getting? Please show us the output, including the full exception trace if thatās what happened.
@paulinpaloalto
I am getting error of wrong value of dW1
dW1 = [[-0.00022433 0.00055688]
[-0.00501012 0.01245478]
[ 0.00023946 -0.00059417]
[ 0.00290866 -0.00721879]]
db1 = [[-0.00013131]
[-0.00293254]
[ 0.00014001]
[ 0.00170148]]
dW2 = [[ 0.00078841 0.01765429 -0.00084166 -0.01022527]]
db2 = [[-0.16655712]]
AssertionError Traceback (most recent call last)
in
7 print ("db2 = "+ str(grads[ādb2ā]))
8
----> 9 backward_propagation_test(backward_propagation)
~/work/release/W3A1/public_tests.py in backward_propagation_test(target)
177 assert output[ādb2ā].shape == expected_output[ādb2ā].shape, f"Wrong shape for db2."
178
ā 179 assert np.allclose(output[ādW1ā], expected_output[ādW1ā]), āWrong values for dW1ā
180 assert np.allclose(output[ādb1ā], expected_output[ādb1ā]), āWrong values for db1ā
181 assert np.allclose(output[ādW2ā], expected_output[ādW2ā]), āWrong values for dW2ā
AssertionError: Wrong values for dW1
expected output:
dW1 = [[ 0.00301023 -0.00747267]
[ 0.00257968 -0.00641288]
[-0.00156892 0.003893 ]
[-0.00652037 0.01618243]]
db1 = [[ 0.00176201]
[ 0.00150995]
[-0.00091736]
[-0.00381422]]
dW2 = [[ 0.00078841 0.01765429 -0.00084166 -0.01022527]]
db2 = [[-0.16655712]]
I did the same steps as mentioned to calculate dZ1
{moderator edit - solution code removed}
Please look more carefully at the formula for dZ1. Your code does not match what the formula says.
thanks @paulinpaloalto I found the mistake in my code.
@Mubsi or @paulinpaloalto, Iām seeing an issue with Week3ās assignment in compute_cost where my expected output is correct but Iām getting an AssertionError for the tests. Could either of you please take a look and let me know how Iām messing things up? Thank you!
My lab ID is gracrakw
Mubsi can look at your lab, but the mentors cannot. Please show us the actual exception trace that you get when you run the test. If the assertion is failing, that means something is wrong with your output. The first step is to understand what the failure message is telling you. Mubsi is a busy guy, so itās better not to depend on him doing your debugging for you.
@paulinpaloalto, thank you for your response. The output is as follows:
cost = 0.6926858869721941
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
<ipython-input-65-9523b300d7a7> in <module>
3 print("cost = " + str(compute_cost(A2, t_Y)))
4
----> 5 compute_cost_test(compute_cost)
~/work/release/W3A1/public_tests.py in compute_cost_test(target)
124
125 assert type(output) == float, "Wrong type. Float expected"
--> 126 assert np.isclose(output, expected_output), f"Wrong value. Expected: {expected_output} got: {output}"
127
128 print("\033[92mAll tests passed!")
AssertionError: Wrong value. Expected: 0.5447066599017815 got: 1.0493608309109266
Expected output
cost = 0.6930587610394646
Seems the test case isnāt passing. I didnāt, however, hardcode anything and all of the rest of my code passes. Not quite sure what Iāve done wrong. Should I copy and paste my code?
It looks like youāve made one of the more popular mistakes on this one: you took the āsample codeā that they gave you and assumed it was the complete solution. Itās not. Please compare your code to the math formula for the cost and ask yourself:
Also note that your expected output is not correct. It differs starting in the third decimal place. That is not a rounding error: itās a real error. Rounding errors start in the 15th or 16th decimal place typically (depending on exactly what the computation is).
@Mubsi I got similar issue,
although passing all tests, all my values looking exactly as desired outputs, I couldnāt find hidden cells and I get grade of 88/100
I also couldnāt find my lab IDā¦
thanks,
Sheli
Hi @Sheli_Kohan,
Can you download your notebook and send it to me in a direct message ?
Thanks,
Mubsi
Hi,
Similar issue to other posters here. All tests have passed, but i get 88/100. I dont think Lab ID is visible in my assignment URL.
In my opinion grader should point to the function were error was made for students to figure out solutions themselves.
PS. I have commented out all optional code blocks as was suggested in other thread. Before that grader timed out.
Regards,
Michal
Hi Genpj,
Kindly share the grader output what being displayed at when you submit your solutions.
Thanks!
Hello, @Mubsi - getting the following output with the assignment grading tool:
All test are passed in the notebook and lab id is bawxcmkh.
Can you help me out ? Thanks