W2_A2_Model_Test_Getting the right length for the d['costs']

Hello, Ahmad Abugoush.

Welcome to the community.

It seems that you are hard-wiring/hard-coding the values in the cell to optimize the function. This is causing an assertion error.

Also, the return value for the model is a dictionary containing the lists of objects. So, how it’s throwing wrong? Check the codes again and you will certainly be able to crack it on your own!

In the beginning thanks for helping, but it still gives the same error after I have checked for the variables and names and this is me own code:

{Moderator Edit: Solution Code Removed}

As Rashmi mentioned, you hard-coded the number of iterations by setting it to 2000 and learning_rate to 0.5.

PS: Sharing your code is not allowed. Next time, share your full error only.