The variable ‘parameters’ is a python dictionary, which is a data type for storing a collection of key: value pairs. When constructing the ‘key’ for the weights of a particular layer:
parameters[‘W’+str(l)] - here, l is the lower case of L, not the numeric value of 1, as l is an index used in the for loop.
Many thanks @Kic , I understand. But now the code is giving another error " AssertionError: Not all tests were passed for L_model_forward. Check your equations and avoid using global variables inside the function. " as AL.shape is (3,4) instead of (1,4). Where have I to look now? Which type of error is this? I just correct as you told me.
This is driving me crazy…
The best way to debug that type of problem is to start with the “dimensional analysis” on that test case, so that you know what should be happening. Here’s a thread which walks you through that.
@Spacedhictory also, personally (having seen many of these now myself), it helps to ‘walk back’ up the error thread.
I mean here, at least at a quick glance, perhaps the source of your error is suggested in the last output-- But in other cases, where a lot of other libraries/tests are being loaded, your error is more likely to be at the top of the list (it kind of just ‘percolates down’).