Week 2, problems with model testing

Hello!

I’m experiencing a strange problem at the end of the model testing. My lab id is qqoutdyr.
The problem is that the grader expects some strange shape of d[‘w’]:

AssertionError: Wrong values for d['w']. [[ 0.144495  ]
 [-0.14292352]
 [-0.19867514]
 [ 0.21265057]] != [[ 0.08639757]
 [-0.08231268]
 [-0.11798927]
 [ 0.12866053]]

Assertion assert w.shape == (X_train.shape[0], 1) seems to be always correct. What is X then?

Thank you for your help!

I think you are misinterpreting the error message. That assertion failure is telling you that the values, not the shape, of your w are wrong. It is a 4 x 1 vector, but the values of your w are quite a bit different than the expected values, as you can see by comparing the two columns.

So you need to carefully examine the logic in your model function. If the lower level functions all passed their test cases, then the bug is most likely in model. One common type of error is to “hard-code” some of the values that you pass to the optimize function when you call it from model. There should be no equal signs in the parameter list of the call to optimize. Although those types of errors, usually cause earlier assertions to fail.

Another less common error is to use a different variable name for the return value from optimize than for the dictionary from which you retrieve the values of w and b after the call to optimize.

Thank you so much! Yes, I think that the problem must be in model, however I’m pretty sure that I’ve not committed any of the mentioned errors. All previous tests are passed and I’m still hopeless with that one.