Help! Code not running, after repeated tries

[ValidateApp | INFO] Validating ‘/home/jovyan/work/submitted/courseraLearner/W2A2/Logistic_Regression_with_a_Neural_Network_mindset.ipynb’
[ValidateApp | INFO] Executing notebook with kernel: python3
Tests failed on 2 cell(s)! These tests could be hidden. Please check your submission.

The following cell failed:

params, grads, costs = optimize(w, b, X, Y, num_iterations=100, learning_rate=0.009...

print ("w = " + str(params["w"]))
print ("b = " + str(params["b"]))
print ("dw = " + str(grads["dw"]))
print ("db = " + str(grads["db"]))
print("Costs = " + str(costs))

optimize_test(optimize)

The error was:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-16-3483159b4470> in <module>
----> 1 params, grads, costs = optimize(w, b, X, Y, num_iterations=100, learning_ra...
      2 
      3 print ("w = " + str(params["w"]))
      4 print ("b = " + str(params["b"]))
      5 print ("dw = " + str(grads["dw"]))

NameError: name 'optimize' is not defined

==========================================================================================
The following cell failed:

from public_tests import *

model_test(model)

The error was:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-20-9408a3dffbf6> in <module>
      1 from public_tests import *
      2 
----> 3 model_test(model)

NameError: name 'model' is not defined

There’s a section in the notebook that lists grader gotchas.
If you have followed all instructions in the section below (including resetting your workspace), please click my name and message your notebook as an attachment.

Important Note on Submission to the AutoGrader

Before submitting your assignment to the AutoGrader, please make sure you are not doing the following:

  1. You have not added any extra print statement(s) in the assignment.
  2. You have not added any extra code cell(s) in the assignment.
  3. You have not changed any of the function parameters.
  4. You are not using any global variables inside your graded exercises. Unless specifically instructed to do so, please refrain from it and use the local variables instead.
  5. You are not changing the assignment code where it is not required, like creating extra variables.

If you do any of the following, you will get something like, Grader not found (or similarly unexpected) error upon submitting your assignment. Before asking for help/debugging the errors in your assignment, check for these first. If this is the case, and you don’t remember the changes you have made, you can get a fresh copy of the assignment by following these instructions.

The learner was defining a function optimize_test and ignoring interpreter errors. There’s nothing wrong with the grader infrastructure.