I have successfuly completed the week 3, programming assignment. this was the output of the driver training:

Cost after iteration 0: 0.693086

Cost after iteration 1000: 0.000220

Cost after iteration 2000: 0.000108

Cost after iteration 3000: 0.000072

Cost after iteration 4000: 0.000054

Cost after iteration 5000: 0.000043

Cost after iteration 6000: 0.000036

Cost after iteration 7000: 0.000030

Cost after iteration 8000: 0.000027

Cost after iteration 9000: 0.000024

W1 = [[ 0.71392202 1.31281102]

[-0.76411243 -1.41967065]

[-0.75040545 -1.38857337]

[ 0.56495575 1.04857776]]

b1 = [[-0.0073536 ]

[ 0.01534663]

[ 0.01262938]

[ 0.00218135]]

W2 = [[ 2.82545815 -3.3063945 -3.16116615 1.8549574 ]]

b2 = [[0.00393452]]

All tests passed!

But, when I explicity train the model using:

nn_model(X,Y,4,print_cost=True)

the output is:

Cost after iteration 0: 0.693116

Cost after iteration 1000: 0.282991

Cost after iteration 2000: 0.266770

Cost after iteration 3000: 0.259013

Cost after iteration 4000: 0.256956

Cost after iteration 5000: 0.253551

Cost after iteration 6000: 0.250299

Cost after iteration 7000: 0.247534

Cost after iteration 8000: 0.245734

Cost after iteration 9000: 0.244419

{‘W1’: array([[ -0.10976777, -11.04379218],

[-10.32466393, -10.50524738],

[ -2.98252288, -1.45933805],

[ 0.53725833, 0.24953177],

[ -4.59181086, -8.69485444],

[ -9.972046 , 12.69249904],

[ -1.8753276 , 4.98785028]]),

‘b1’: array([[-0.15050221],

[ 0.0648266 ],

[ 0.26964829],

[-0.06060059],

[-0.59661557],

[-0.18946601],

[-0.68132552]]),

‘W2’: array([[-10.3176535 , 6.82734816, -4.83699664, -3.24364976,

2.57823027, -6.39279918, 1.40952222]]),

‘b2’: array([[0.04254188]])}

The cost is not decreasing, and the output does not seem right. What is wrong?