W4_A2 part 2 L_layer_model cost

Hello,
I am stuck now for 2 days on this L_layer_model exercise. In this exercise, I passed 2 tests and failed 2 tests. Now, from what was printed and comparing it to the other answers in this forum, it’s clear to me that the calculated cost is wrong. (0.77 or something is expected while I have 0.69) Now in the 2 layer model the cost was calculated just fine, so I don’t think the problem is with the compute_cost function. But the initialize_parameters_deep function and the L_model_forward seems to be working just fine in the tests on the previous assignment (as do all the helper functions). Does anyone know what the problem might be or what I could do to fix this?
Thanks in advance

As in this assignment, you only need to call the functions with correct arguments, so, I guess you are calling them with incorrect arguments.

Okay nevermind, I solved it. I entered all the helper functions in a different cell again and apparently you are not supposed to do that x)

Yes, you are not supposed to do that. Even deleting a comment line can give you unexpected errors.

1 Like

Ah, yes, that’s a good point: if you include your own implementations of the helper functions, you get different answers. It turns out that they had to use a more sophisticated “init” function for the “deep” case to get reasonable convergence. They didn’t bother mentioning that, since it’s a more advanced topic that will be covered in detail in Course 2 of the series, so “stay tuned” for that.

1 Like