Hi all,
I am getting too many indices error. abit confuse on how I defined J_plus[i], can anyone please give me some hint?
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-15-c57ee5e9e05a> in <module>
3 cost, cache = forward_propagation_n(X, Y, parameters)
4 gradients = backward_propagation_n(X, Y, cache)
----> 5 difference = gradient_check_n(parameters, gradients, X, Y, 1e-7, True)
6 expected_values = [0.2850931567761623, 1.1890913024229996e-07]
7 assert not(type(difference) == np.ndarray), "You are not using np.linalg.norm for numerator or denominator"
<ipython-input-14-b29acbec361a> in gradient_check_n(parameters, gradients, X, Y, epsilon, print_msg)
38 theta_plus = np.copy(theta+ epsilon)
39
---> 40 theta_plus[i] = np.copy(theta_plus[i]+ epsilon)
41
42 J_plus[i], _ = forward_propagation_n(x, y, vector_to_dictionary( theta_plus[i] ))
IndexError: too many indices for array