I am attempting to pass my activation values into my prediction array. I’m using np.where to assign my 0 and 1 values based on the A2 value produced by forward_propagation. However, I’m running into the error below and do not understand how to interpret them since my 1s and 0s are definitely integers.
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-78-eb08347ef392> in <module>
1 parameters, t_X = predict_test_case()
2
----> 3 predictions = predict(parameters, t_X)
4 print("Predictions: " + str(predictions))
5
<ipython-input-77-998941125bfd> in predict(parameters, X)
18 # predictions = ...
19 # YOUR CODE STARTS HERE
---> 20 A2, cache = forward_propagation(parameters, X)
21 predictions = np.array(np.where(A2 > 0.5, 1,0))
22
<ipython-input-12-70b90a51d44d> in forward_propagation(X, parameters)
18 # b2 = ...
19 # YOUR CODE STARTS HERE
---> 20 W1 = parameters["W1"]
21 b1 = parameters["b1"]
22 W2 = parameters["W2"]
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices