C1, W2 Programming Assignment

Hi everyone,
I have passed all tests above. when we put all methods into one method (model) it gave me this error. Please help me to solve this error. Thank you

I don’t recognize the text in your notebook from the Machine Learning Specialization.
What is the title of the notebook you’re working on?

Sorry for my mistake. its deep learning

Thanks for moving it to the correct course area.

That error usually means that you are “hard-coding” some of parameters that you are passing to optimize when you call it from model. E.g. are you sure there are no “equal signs” in the list of parameters like learning rate and number of iterations? If so, that means you are ignoring the actual parameters being passed in at the top level to model, right? That will not end well. :nerd_face:

1 Like

{moderator edit - solution code removed}

This is my code

Hi @Muhammad_Usama_Amin ,

You have hard coded the value for learning rate, num of iterations, and the flag for printing. It is a common practice to pass parameter to the calling function, allowing different value to be used if preferred. The error you have encountered is precisely due to hard coded values being passed to optimize() when the public test is executed.

1 Like