I think the instructions regarding the helpers functions at the beginning of Exercises 1 and 2 could be made a little clearer. “Use the helper functions you implemented in the previous assignment” suggested to me to copy-paste my code from Programming Assignment 1 into the current notebook (Programming Assignment 2) in order to define those functions. This worked for Exercise 1, with the 2-layer model, but I failed the tests for Exercise 2. I started running some tests, for instance making sure that the L_layer_model function called with layers_dims = (n_x, n_h, n_y) indeed reproduced the results from two_layer_model in Exercise 1. This drove me crazy a little bit until I realized that the helper functions were already imported through from dnn_app_utils_v3 import *. Using those, then everything instantly worked. I suspect the random seed in the imported initialize_parameters_deep is different from 1, which caused the first iteration of forward propagation to give a different value from the expected 0.77.
It could be just me, but maybe it would be useful to mention that the helper functions are already imported here?
No, it’s that the algorithm that they used in the “deep” init case is different. They tried using the simple algorithm from the “Step by Step” exercise, but it gives really terrible convergence with the particular dataset and network architecture used in the 4 layer case here. They had to use a more sophisticated algorithm that we will learn about in DLS Course 2. They didn’t mention this probably for one or both of the following reasons:
There is just too much to cover here in Course 1 and to explain the new algorithm would take too much space and time.
Maybe they didn’t call out the imports because they didn’t want to call attention to the fact that they have given you the solutions for the Step by Step exercise, other than in the case of the “Deep” init.
It turns out that initialization algorithms matter, although there is no one “silver bullet” choice that is best in all cases. This will be covered in detail in Week 1 of DLS Course 2, so please “stay tuned” for that.