C2_W4_Assignment issue with compute_cost and back_propogation

When i execute the pre-defined compute_cost, the output i am getting does not match the expected output and the unit tests for back propagation are failing though i am getting the correct output. I have spent close to 2 hours on this assignment at this point and i am lost.

The fact that the cost does not agree is a bug in the notebook that has been reported, but apparently not fixed yet. Here’s another recent thread about this issue.

But on the back prop tests, if you don’t pass the local tests, it means something is wrong with your code. Notice that the “Expected values” there only show the shapes of things, so getting those correct is a pretty low bar for success. The actual unit tests fail with mismatching values, as you can see in the output you show.

Actually looking at your values versus the “Expected” values, notice that all the positive values seem to agree, but when the expected values are negative, you are showing zeros. So that would seem to indicate that you’ve got the ReLU logic in the wrong place in your code.

1 Like