Dear course mentors,

As I am going through the exercise 3, I got an unclear KeyError notification as following:

KeyError Traceback (most recent call last)

in

28 print(“\033[92mAll tests passed!”)

29

—> 30 optimize_test(optimize)

in optimize_test(target)

9 Y = [4, 14, 11, 22, 25, 26]

10 old_parameters = copy.deepcopy(parameters)

—> 11 loss, gradients, a_last = target(X, Y, a_prev, parameters, learning_rate = 0.01)

12 print(“Loss =”, loss)

13 print(“gradients["dWaa"][1][2] =”, gradients[“dWaa”][1][2])

in optimize(X, Y, a_prev, parameters, learning_rate)

41

42 # Update parameters (≈1 line)

—> 43 parameters = update_parameters(gradients, parameters, lr = learning_rate)

44

45 ### END CODE HERE ###

~/work/W1A2/utils.py in update_parameters(parameters, gradients, lr)

71 def update_parameters(parameters, gradients, lr):

72

—> 73 parameters[‘Wax’] += -lr * gradients[‘dWax’]

74 parameters[‘Waa’] += -lr * gradients[‘dWaa’]

75 parameters[‘Wya’] += -lr * gradients[‘dWya’]

KeyError: ‘Wax’

I am not sure about what this indicates so turning for help in this forum, thanks for your support.