Week 4 Assignment 1 Exercise 5 Test failing

So I was implementing the L layer forward prop function. I am getting the correct value for AL but it still seems to be failing the test. Can someone help me out

Those are not the correct outputs for AL. Take a closer look: only the first and last of the 4 elements agree, right? So something is clearly wrong. How could some of the elements be correct and some wrong?

The other thing to note there in general is that there are actually two separate test cases: one you can see there in the notebook and another that is from the file public_tests.py. Also note that they are checking more than just the AL value: the second test also checks your cache output values if you open public_tests.py and have a look at the code.

Also note that from what we can see in your other thread about this is that you are working way too hard in the forward propagation code: you should only generate the caches. There is no need to reference any of the cache values in your actual forward propagation code: the relevant values are already sitting there in local variables that you can directly use. In the previous thread you were also applying both relu and sigmoid at the output layer. I hope that got fixed. There should be no need to directly call linear_forward from L_model_forward, right? You should only need to call linear_activation_forward: it then calls linear_forward.