Exercise 8 - model error:

Hi,

I’ve passed all the other graded cells but exercise 8 cell is giving me the this error:

AssertionError: Wrong values for d[‘w’]. [[ 0.14449502]
[-0.1429235 ]
[-0.19867517]
[ 0.21265053]] != [[ 0.08639757]
[-0.08231268]
[-0.11798927]
[ 0.12866053]]

I’ve tried to rework the optimize, propagate, and all the other cells that update w, b, and the cost function to no avail.

Appreciate any help, thanks

The usual cause of that sort of error is that you are not passing the correct parameters to optimize when you call it from model. The bug is not in the lower level functions: a perfectly correct function will return incorrect values if you call it incorrectly. You need to pass through the actual values passed into model at the top level for all parameters including the learning rate and number of iterations. There should be no “equal signs” in the list of parameters you are passing to optimize, because that would mean you are over-riding the requested values with defaults.

1 Like

Thank you. I wasn’t passing all the parameters like you said. Missed the num_iterations and the learning_rate.

Glad to hear those suggestions were helpful. Yes, omitting the optional parameters means you’d be getting the default values declared in the definition of optimize, which are different than the requested values.