Very unlikely that the test case if foul–not unprecedented, but rare. When posting an issue its very helpful (quite necessary, actually) to insert a snapshot of the “Traceback”, i.e. the error log, produced by your execution. NOT your code which is a violation of the Coursera honor code. Please do that and we’ll see you on the flip side.
Things to verify while you get that traceback posted:
That your initialize_parameters(...) function passed its tests with matching output to the expected output. The notebook will not let you change the np.random.seed(2) statement so you are good there.
If so, there are pretty much just two sources error left. First, you need to retrieve the arrays from the parameters dictionary properly. Second your expressions for forward propagation need to be correctly specified. The instructions offer guidance on both.
OK, not much help there, but good practice for future posts. Your forward prop expressions are likely off. In addition to the sigmoid() and np.tanh() functions mentioned in the instructions, you will also need np.dot(). Time to put in your eagle eyes!
You need to adjust your notion of “close” here. Just for future reference note that an error in the second decimal place is not a rounding error: it’s a real error. We are doing 64 bit floating point here, so rounding errors are typically of order 10^{-16} or smaller. Here’s a thread which shows some examples of different ways to express a simple computation that can result in different values, but the errors are of the aforementioned small scale.