Question on the W2 programming Assignment

Hello, I am reaching almost the end of my W2 programming assignment. I got stuck on section of “Merge all functions into a model” in which I got an error of shape misalignment. It would be great if someone could help me take a look into my codes. Thanks in advance!!

We can’t directly see your code. The thing to do would be to post the error output that you are getting. Also note that you filed this question in the generic forum AI Questions, so we can’t really tell which course you are talking about. Please use the “edit pencil” on the title to move it to the Course Q&A category for the course you are taking.

1 Like

That error says that your w value is the wrong shape. So where is that shape determined in the model function? It is by the argument you pass to the initialize function, right?

Notice that once you fix that bug, you are not done. The way you are calling optimize is “hard-coding” the values of the number of iterations and the learning rate. That means you are literally ignoring the values that are passed in to the model function at the top level: no matter what value is requested, you will always run 100 iterations. That will not end well. :nerd_face:

1 Like

Thank you so much! The errors are resolved now. Have a great weekend!!