Hi all,
I am getting the following error once running the code in Exercise 4 of W1 A2,
backward_propagation_with_dropout, while I passed all the test but for keep_prob = 0.86 in [16].
can anyone please help?
ValueError Traceback (most recent call last)
<ipython-input-16-9bfabb849b4f> in <module>
----> 1 parameters = model(train_X, train_Y, keep_prob = 0.86, learning_rate = 0.3)
2
3 print ("On the train set:")
4 predictions_train = predict(train_X, train_Y, parameters)
5 print ("On the test set:")
<ipython-input-3-0f6a391419fd> in model(X, Y, learning_rate, num_iterations, print_cost, lambd, keep_prob)
32 a3, cache = forward_propagation(X, parameters)
33 elif keep_prob < 1:
---> 34 a3, cache = forward_propagation_with_dropout(X, parameters, keep_prob)
35
36 # Cost function
<ipython-input-12-bd0abc0e42ea> in forward_propagation_with_dropout(X, parameters, keep_prob)
44 D1 = np.random.rand(2,5)
45 D1 = (D1 < keep_prob).astype(int)
---> 46 A1 = np.multiply(A1, D1)
47 A1 = A1 / keep_prob
48
ValueError: operands could not be broadcast together with shapes (20,211) (2,5)