W3 Assignment - exercise 4 expected vs actual output


I am receiving conflicting expected vs actual output…

[0.49362137 0.48619837 …] vs expected [0.49920157 0.49922234 0.49921223 …]

also the unit test fails with Wrong output of Z2. Test for i = 0.

I’ve rechecked several times … and all prior unit tests pass…

Can someone please advise on how to resolve ?

Thanks… – Germán


I have the same issue, if I manage to solve it I will let you know.


1 Like

Take a closer look at the parameters for Z2. Reviewing the schematics of the NN should help spotting the issue :wink:



I did review the schematic and the subscripts for Z2 match… i.e. W2, b2…

All of the previous unit tests pass. ??

– Germán

Make sure you pass correct values to multiply by W2.

1 Like

As far as I can discern… there is only one value ‘X’… or ?

1 Like

X is the collection of input values which goes into the first layer of the NN. Please, take a closer look at the schematics. Also, there’s a hint in the order of variable assignments!


Ok… now I understand re: the arrangement of layers… the expected actual vs expected is now correct. thank you… the subscripts vs superscripts are confusing… but now its clear…

However, the unit tests are still failing with the following…
Test case “change_weights_check”. Wrong output of Z1 for X =
[[ 5.46584646 6.71120407 7.21301753 … 1.77559174 3.52245562

There is another thread stating that this is perhaps a bug ??

Hi @dlphsrle7 ,

Thanks for your quick responde. I really appreciate it.

The answer was at the beginning.
Screen Shot 2023-03-01 at 1.28.40 PM

I understand your point, see below. I think that the answers are the same as the expected output, but 1 test failed.


1 Like

Thanks Bruno,

Yes, there is much detail to resolve… it is taking now several re-reads and re-video watches… the hints in this thread really helped… kind of voilá

Good to make your acquaintance…

1 Like

Glad you both got it :slightly_smiling_face: The 1 failing test is a known issue: Failed Tests on final C2_W3 Assignment, but received 100 points

Hi @dlphsrle7 ,

Yes, I am trying to use this platform to consult and solve doubts.

My pleasure! :raised_hands:t6:

Hi @daniilkorotin , thank you for your time.

I have one last question and it is not related to this problem. Do you know why the following course on Probability & Statistics is not working?

I am already enrolled, ¿Should I wait until April 19 as it says on the program page?

Again, thank you.

1 Like

Glad to help. It says it starts on April, 19 on the course page. If I recall correctly, it was announced at the beginning of this specialization that it’s in the works and will be rolled out gradually. In a while I’m taking another specialization to reinforce my knowledge :grin:

That was my issue as well. I should have payed closer attention to the equations.