DLS Course 1- week 2 - assignment 2 - Exercice 8

Can someone help me understand this ? The cost list was not part of the exercice but I have this error and I don’t know where it’s coming from. I passed all the other tests of the assignement.

Hi, @CJP. Good work passing all of the test up to this point. In this exercise, you need to implement your previous functions by calling correctly them in the model function.

Your cost object returned by the model function has dimension 20–it should only be 1. More precisely, it should be a Python list with only one element. The element should be a scalar. As you try to fix the function, it might be helpful to insert a print statement as the last line (just before the return statement) such as print(d[“costs”]).

My guess is that you “hard-coded” the keyword arguments from the model function “signature” such as “num_iterations = 2000” etc., in the function call in the body of the ‘model’ function. For a function to be useful, it must be flexible enough to handle all specified arguments of the function parameters. More concretely, the functions called within model must “inherit” the arguments from the main function. E.g. num_iterations=num_iterations.

Hi @kenb,
Thank you! I will give it a try :+1:t4:

Je vous en prie, Caroline. I’m guessing!