Ex 5 Week4 Step by Step assignment

I​ think I have written the correct code but for some reason the notebook just keeps processing the cell 11 and doestn output. Cell 10 is the function.

T​here is a * on the cell hence it means it is running but I kept it for 15mins and still no output.

I​ tried restarting the kernel and running all cels as well. but no result. cant move forward too because of this.

what should I be doing?

You need to debug your code. It sounds like you must have an infinite loop or something equivalent to that. Put some print statements in to see what is happening.

If I’m correctly interpreting what you are saying, you are asking about L_model_forward. There is a loop in that function, but it’s hard to see how you could turn that into an infinite loop. Maybe recursion would be one way, but that should throw a stack overflow exception in way less than 15 minutes of execution.

Yes sir. It worked. I was passing in the ‘relu’ and ‘sigmoid’ activations wrongly as direct strings. Idk how that solved the problem but it worked.

Maybe it was not getting into an of the if statements and hence not running. Not sure. but resolved. Thanks for the reply

I’m glad to hear that you found the solution. The problem you are describing would have caused it to fail, but I would have expected it just to fail immediately and print an error message about some variable being referenced before assignment, rather than just hanging indefinitely.

But if it works now, that’s great and it’s not worth worrying about what caused the weird 15 minute delays.

1 Like