Exercise 8 of week 2 not working code problem

i do all exercises go but i got this problem seems there is problem in past exercises

Hi, @Emhad_Taher. Have all of your functions prior to Exercise 8 passed their tests? The UnboundLocalError is fairly explicit. The optimize function requires a declaration of dw before it can be stored in a dictionary called grads. Be sure that you have run all the cells prior to executing the test cell for the model() functions. From that test cell, you can select from the menu: Cell → Run All Above.

It is a general principle of debugging that a perfectly correct function can throw errors if you invoke it with incorrect parameters. The arguments you are passing to optimize when you call it from model are wrong: compare your call to the definition of the function. There are several missing parameters.

1 Like

hello,@kenb thanks in advance for helping me , i passed all execises and optimize test is passed as figure below shown

@paulinpaloalto yeah that was the problem thank you very much for helping and your time :heart:
@kenb thank very much for your time and helping :heart: