Error after Assignment submission: Gradient Checking

Hi all,

I’m working on one of the programming assignment from the “Improving Deep Neural Networks: Hyperparameter Tuning, Regularization and Optimization” course.

The assignment is Gradient Checking and after submitting the work, the score was negative.

I noticed that I get an error in the last cell on the notebook (see attached screenshots).

The function being called in the last cell is gradient_check_n_test_case(), but is not referenced anywhere on the notebook.

Shouldn’t the function “gradient_check_n(parameters, gradients, X, Y, epsilon=1e-7, print_msg=False)” be called instead?

Also, the “parameters”, “gradients”, “X”, “Y” attributes which should be passed to the function, are not defined anywhere globally.


Hi @NickHalden,

The function gradient_check_n_test_case() comes from a helper file. You can take a look at the helper files by clicking, Files --> Open....

Looking at your screenshot, it is telling that you ran the code cell containing this function second (In[2]). In order for this function to load, you need to run the first code cell where all of the libraries and helper files are being imported.

Hope this makes sense,

Yes, there is a topic about the “name not defined” problem on the DLS FAQ Thread, q.v.

Many thanks both. That solved the issue. I may have mistakenly missed to run the first cell and haven’t realised it.