Hello,

I am currently working on Deep Neural Network, exercise 5.

I’m really annoyed because because of a function implemented initially (so not mine), I can’t get the 70/100 necessary to validate the course.

Indeed, I get this error message:

TypeError Traceback (most recent call last)

in

----> 1 parameters, costs = L_layer_model(train_x, train_y, layers_dims, num_iterations = 1, print_cost = False)

2

3 print("Cost after first iteration: " + str(costs[0]))

4

5 L_layer_model_test(L_layer_model)

in L_layer_model(X, Y, layers_dims, learning_rate, num_iterations, print_cost)

60 # parameters = …

61 # YOUR CODE STARTS HERE

—> 62 parameters=update_parameters(parameters, grads, learning_rate)

63

64 # YOUR CODE ENDS HERE

~/work/release/W4A2/dnn_app_utils_v3.py in update_parameters(parameters, grads, learning_rate)

378 # Update rule for each parameter. Use a for loop.

379 for l in range(L):

→ 380 parameters[“W” + str(l+1)] = parameters[“W” + str(l+1)] - learning_rate * grads[“dW” + str(l+1)]

381 parameters[“b” + str(l+1)] = parameters[“b” + str(l+1)] - learning_rate * grads[“db” + str(l+1)]

382

TypeError: tuple indices must be integers or slices, not str

However, I did not code the update_parameters function (it is implemented in the exercise).

I’m stuck and I don’t see how to do it.

I share with you my session code: cmxovzfu.

Thanks in advance for your help.