Deep learning Course 1 week 2 coding assignment error

hello folks,
i am getting error while combining all the functions in the model as following.can you help me out? it was saying to use 2000 iterations and saving cost value in "costs " array with length of 20 but while testing it is giving error as require array of length 1 for costs !!!

AssertionError Traceback (most recent call last)
in
1 from public_tests import *
2
----> 3 model_test(model)

~/work/release/W2A2/public_tests.py in model_test(target)
126
127 assert type(d[‘costs’]) == list, f"Wrong type for d[‘costs’]. {type(d[‘costs’])} != list"
→ 128 assert len(d[‘costs’]) == 1, f"Wrong length for d[‘costs’]. {len(d[‘costs’])} != 1"
129 assert np.allclose(d[‘costs’], expected_output[‘costs’]), f"Wrong values for d[‘costs’]. {d[‘costs’]} != {expected_output[‘costs’]}"
130

AssertionError: Wrong length for d[‘costs’]. 20 != 1

Hi there,
the model_test function invokes the model function for 50 iterations like this:
d = target(X, Y, x_test, y_test, num_iterations=50, learning_rate=0.01)

Could you please remove the public_tests.py file by selecting and clicking on the trash icon and refresh the workspace ?

Hi @Akshay_Eknath_Mali ,

Make sure there are no hard coding values used in the model() function. When calling the optimize() function, pass in parameters only.